View Full Version : Texture Mask
09-22-2000, 04:05 PM
Hi, I just wanted to know if its possible to do in a single pass (2 textures units) a final texture compose of those elements:
-first texture is a standard RGBA diffuse texture in GL_MODULATE mode with an alpha channel representing the shininess of the corresponding texel.
-2nd texture is a sphere map that is added to the first texture using it's alpha channel as a mask.
I've saw something like that in NVidia's demo "principe of shading"(shiny exemple) and I wanted to do it in opengl 1.1...
09-22-2000, 05:58 PM
I don't believe you can get the result you want except by using the NV_register_combiners extension. The EXT_texture_env_combine extension doesn't allow you to specify arguments like Arg0 + Arg1 * Arg2, so that is out of the question and I don't know of any other texture combine methods that would be available.
09-22-2000, 08:11 PM
I can't tell, from what you describe, exactly what you want to do, but it sounds like:
PrimaryColor * Tex0RGB + Tex1RGB * Tex0Alpha
If this is what you want to do, unfortunately, EXT_texture_env_combine is just not flexible enough.
NV_texture_env_combine4 is the easiest way to achieve this. You can set up the first stage to compute the exact equation above, and the second stage would just pass through the previous result (1*Previous + 0*0).
This would run in a single pass on all TNT/TNT2, GeForce, and Quadro hardware.
09-23-2000, 06:01 AM
Thank you... That's wath I was looking for... I do have an nvidia card... But for those how don't, is there what would be the multipass way to do it?
09-23-2000, 06:37 AM
Yep, if you have an alpha buffer it can be done in 2 passes. By using a destination alpha blend when drawing the environment map.
Or you can first draw the environment map, and then draw the base texture using an inverted source alpha blend. This way doesn't require an alpha buffer.
09-24-2000, 07:21 AM
Powered by vBulletin® Version 4.2.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.