Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A texture pack for a sponza model contains mask textures (black and white). I guess that I should read only a red channel from that texture, right ? I use deferred rendering and for shading calculations I use additive blending. A result is first save in a texture (for some post-process operations), so doesn't go directly to the default framebuffer. How to use a mask texture ?

share|improve this question

Mask textures basically let you choose different shading branches depending on texels info.

For example simplest reflection mask Result = Ambient.rgb + Mix(Diffuse.rgb * Texture.rgb, Reflection.rgb, Mask.r); will mask certain areas as reflective and others as normal.

Depending on mask texture format, e.g. GL_RGB it may have each channel used for different purpose (r for specular, g for reflection, b for something else). OpenGL allows number of texture format that have just one component GL_LUMINANCE if you need only one mask.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.