Making a texture transparent with GL_MODULATE
I have the following setup that currently works fine:
glTexImage2D with GL_LUMINANCE (greyscale)
Set primitive material to metalic values
glShadeModel ( GL_SMOOTH ) ;
glEnable ( GL_LIGHTING ) ;
glActiveTexture ( GL_TEXTURE0 ) ;
glBindTexture ( GL_TEXTURE_2D, textureId ) ;
glEnable ( GL_TEXTURE_2D ) ;
glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ) ;
I get a nice shinny metallic surface with a texture on it ranging from transparent to black. The black regions still have reflexions, which is exactly what I want.
Now, I'd like to make that texture "more transparent" with user input. ie: I would like to be able to change the texture from its default look to all transparent.
Does anyone have some pointers? I hope I dont have do actually modify the texture memory!!
Tags for this Thread