Jump to content
  • Advertisement
Sign in to follow this  
KaelisAsur

OpenGL Manual modification of texture pixel data.

This topic is 3776 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. First off, let me say im a beginner with OpenGL. What im trying to do is to render to target texture, then modify its pixels. From what i gather, for rendering to texture i need to use frame buffer object, and for texture modification - pixel buffer object. To be honest, im overwhelmed by all the information i need to gather and understand, wish there was some kind of tutorial for all this, but i guess ill manage. What im really confused about is how to use PBO for modifying textures. The only reference ive found so far is this: http://www.songho.ca/opengl/gl_pbo.html#unpack What i dont understand is how to copy pixels from texture to buffer, and how to actually modify said pixels while theyre in PBO. Im also not sure how to copy pixel data from buffer to texture. Am i right thinking that i just need to use glTexSubImage2D, using pointer to the target of PBO from glBindBufferARB for const GLvoid *pixels parameter?

Share this post


Link to post
Share on other sites
Advertisement
FBO based render to texture can be used if you will be using GL commands to render.
If you want to update the texture yourself, use glTexSubImage2D which is a sync operation.
PBO just helps to make that into a async operation so glTexSubImage2D returns immediately without the texture being updated. Sometime in the future, it gets updated.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!