View Full Version : GL_LINEAR for color and GL_NEAREST for alpha

05-28-2007, 11:21 AM

I want to use alpha values to categorize objects on a texture into different groups. The texture is going to be downsampled, and the filters are set to GL_LINEAR to make smooth edges. The problem is the filters also make textels' alpha values linear, which causes me additional work for handling them. Is there any way to use GL_LINEAR for colors and GL_NEAREST for the alpha on a texture?


Olivier B.
05-28-2007, 12:28 PM

I'am sorry but I think is not possible. Try to make two pass.

05-28-2007, 12:39 PM
Use two textures (rgb, alpha) and multitexturing.

05-28-2007, 02:07 PM
Thanks kon, you reminds me that I could use another texture with filters GL_NEAREST to store alpha information in the same framebuffer object.