Jump to content
  • Advertisement


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


Reading from a texture

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

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!