Advertisement Jump to content
Sign in to follow this  

Blit to Texture Memory

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

Can you blit textured quads to texture memory so you can turn around and use that texture on another quad? I am thinking this is how video textures are probably done. The reason why I ask is if you were making a GUI and wanted transparency for the gui window as a whole. I dont think you could blit each item on top another with same transparency level and obtain same result because they would show through each other where as the window was one unit you could apply a base transparency level. Or am I wrong about this?

Share this post

Link to post
Share on other sites
With the framebuffer object extension you can render to texture, and you can render anything you like, including quads.

If you want the resulting texture to draw with a fixed level of transparency you can accomplish this by using a RGB format texture and setting the current color prior txture to rendering the quad. In other words, once your GUI texture is rendered and you wish to render it over the scene, you can do this:

glColor4f(1.0, 1.0, 1.0, 0.5); // 50% alpha

The resulting RGB will be the GUI texture and the alpha will be 0.5. Combined with the appropriate blend parameters this should give you the desired effect.

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!