Advertisement Jump to content
Sign in to follow this  
captainfreedom

OpenGL glTexImage2D with GL_ALPHA

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

I am using opengl es. I thought that I would be saving memory by using glTexImage2D with GL_ALPHA rather than GL_RGBA, but according to the documentation (http://www.khronos.org/opengles/documentation/opengles1_1/gl_egl_ref_1_1_20041110/glTexImage2D.html) everything is just converted to RGBA in the end, so it makes no difference. Is this right?

Share this post


Link to post
Share on other sites
Advertisement
The function behaves as if it was expanded to RGBA with fixed RGB values, but that doesn't mean it actually happens. That is an implementation detail you don't know about.

Share this post


Link to post
Share on other sites
There are internal 8bpp formats, GL_LUMINANCE8 is usually preferred, I think. In your shader, all 4 components of texel.xyzw are filled with the same value.

Also, there are many alias-names to the same really-internal format, which is making things confusing imho. I rely on vendor-provided (nVidia/AMD) examples for how to define texture-formats.

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.

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!