Jump to content
  • Advertisement
Sign in to follow this  
dnaxx

OpenGL Set Pixel via OpenGL?

This topic is 4518 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! I have a texture, where pixels are individualy changed (usually just ~50-100 individual pixels/pass). Currently I do the pixel manipulation on an image which I load onto the graphic card every pass (with glTexImage2D()). This is of course very slow. Is there a way to efficientely manipulate pixels directly on the grafics card (without shaders)? thank you,

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
I never bothered doing anything like this so I hope others have more suggestions.

The best I know of is using glTexSubImage2D to replace the image (or portions). I hear it is faster when replacing a texture than using glTexImage2D.

As far as I know, this is the only other real option.

Share this post


Link to post
Share on other sites
I have also heared this, but when calling glTexSubImage2D() 100 times seems a lot.
The best way might be to do a performance test with both methods.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
No.. You don't use glTexSubImage2D for each pixel.

I guess I didn't make myself clear - your method seems the way to go but you would only use glTexImage2D to establish the initial dimensions/attribs on the card.

You would use glTexSubImage2D instead of glTexImage2D when updating it (like you aleady do).

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!