What is the difference between the two functions?
Any performance difference?
Thanks..
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You create a texture using
glTexImage, and then update its contents withglTexSubImage. When you update the texture, you can update the entire texture, or just a sub-rectangle of it.It is far more efficient to create the one texture and update it than to create it and delete it repeatedly, so in that sense if you have a texture you want to update, always use
glTexSubImage(after the initial creation).Other techniques may be applicable for texture updates. For example, see this article on texture streaming for further information.
(Originally, this post suggested using
glMapBufferfor texture updates – see discussion below.)