View Full Version : Simple Tex Env configuration

04-06-2004, 10:50 AM
Hi all;
Im implementing a glow fx (like in Tron), and i have to multiply RGB*alpha to get the glow sources visible...how do i configure the tex env combiners to do that?

04-06-2004, 11:55 AM
Look up the ARB_texture_env_combine (http://oss.sgi.com/projects/ogl-sample/registry/ARB/texture_env_combine.txt) extension. You want both GL_SOURCE(0|1)_RGB to be GL_TEXTURE, but one is taken from the color channels and one from the alpha channel, which is done via GL_OPERAND(0|1)_RGB.

edit: Assuming, of course, that RGB and A is comming from the same texture.

04-06-2004, 12:21 PM
Thanx! its working now....another question: how do i blur the texture, to blend with the final image? assume that im doing that by ARB, and to work with radeon 7500+ and geforce2+...

04-06-2004, 02:30 PM
How do you mean "blur the texture"? Setting mini-/magnification filter to GL_LINEAR (or GL_LINEAR_MIPMAP_LINEAR if using mipmaps) will blur the texture in some way, or do you want something else?

04-06-2004, 06:59 PM
Im trying to do something like this:
- create a pbuffer, enabling automatic mipmap generation and render to texture;
- each frame, render the scene to pbuffer, modulating the color (RGB) by the alpha;
- render the scene to the framebuffer, and draw a quad over the screen with the pbuffer, but or blurred (i dont know how to do that without FS) or with a mipmap level lower than the default, to get almost the same effect .
The problem now is that i couldnt configure it in the right way, or by creating the pbuffer without the correct parameters, or im not using the tex lod as i should...im setting the min lod and the max lod as the same value, to force the api to use the level i want, but for each level i put in function, the image doesnt change a bit... if somebody already did it, please help me!

04-07-2004, 06:56 AM
Its working now....but the quality of blur its not so good....did anyboy tried some configuration, like size of texture N->mipmap level M, that works fine?