I’m trying to use multipass rendering to mix emboss bumpmapping & environment gloss mapping. I know how to do them both separately, but i can’t find a way to mix them. Here is what i’m doing:
For emboss bumpmapping:
- I put the bumpmap into the color buffer, using standard texture coords.
- I shift the texture coords, enable additive blending ( GL_ONE,GL_ONE ), and add the inverse bumpmap to the color buffer,
- I enable x2 blending, back to standard tex. coords, and multiply the color buffer by the base texture.
For gloss mapping:
- I use spherical tex. gen. and put the environment map into the color buffer,
- I come back to standard tex. coords., enable multiplicative alpha blending ( GL_ZERO, GL_SRC_ALPHA ), and multiply the alpha gloss map with the color buffer.
- I enable additive blending ( GL_ONE, GL_ONE ) and add the base texture to the color buffer.
Ok, now, how can i do bumpmapping AND gloss mapping ? Both technics, in pass 1, destroy the previous content of the color buffer. I’d like my program to run on older cards ( Vaudoo family ), so i can’t use any specific Nvidia feature, or the destination alpha…
Is it possible to do? Any idea? And in general, what are the restrictions of multi-pass rendering ?