GL_LINEAR for color and GL_NEAREST for alpha


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?



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

Use two textures (rgb, alpha) and multitexturing.

Thanks kon, you reminds me that I could use another texture with filters GL_NEAREST to store alpha information in the same framebuffer object.