Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Lipofuse

Reading from a texture

This topic is 5838 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

Hi, How can read the color from a point on texture that is already stored in memory? which function should i call? Thanks

Share this post


Link to post
Share on other sites
Advertisement
glGetTexImage

Warning
be careful, it reads all the image, which is very slow.

A bit faster
If you need performance, render the texel you need on screen in a merely invisible place (eg pixel on a screen corner) and call glReadPixels on that pixel only.

Alot faster, but wastes RAM
Also the faster is to store the texture once in RAM and then do not free that memory. It wastes alot of memory but is clearly the fastest method. Note that this optimization does not work with dynamic textures.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!