Sign in to follow this  
dnaxx

OpenGL Set Pixel via OpenGL?

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this