View Full Version : Grayscale in textures
12-19-2011, 04:24 PM
I want to create textures that are in gray format, so it is cheaper to use a 8 bit per pixel than 24/32 bit.
Which "internal format" and "format" do you suggest to me for using in "glTexImage2D"?
Thanks in advance...
12-19-2011, 05:19 PM
Here (http://www.opengl.org/wiki/Image_Format) is a comprehensive list of OpenGL image formats available. If you're using pre-GL 3.0, then you will probably want to use one of the INTENSITY or LUMINANCE formats, listed in the "Legacy Image Formats" section.
12-20-2011, 06:41 AM
So I am using OpenGl spec 3.1. To save memory space on the graphics card, can I use GL_RED for internal format and format to declare a grayscale?
In the fragment shader I suppose, I have to output a color with three identical figures in RGB...
12-20-2011, 07:16 AM
More specifically, you should use GL_R8 as internal format (means 8 bit red).
Btw, you are right about the rest.
12-20-2011, 11:54 AM
Thanks a lot!
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.