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 ?
Seems to me a Radeon (with three texture
units) could conceivably do that in one
pass, assuming they have as fine-grained
control over color operation as the nVidia
register combiners. Which they probably
don’t
Thanks Serge, it was exactly what i was looking for. You are right about the formula, this is what i’d want to do.
I can use multitexturing with 2 TMUs, but definately no destination alpha. Unfortunately, i don’t think that with multitexturing only there is a solution to the problem
Bgl: i think that, on Nvidia’s hardware, it could be done in 2 pass with multitexturing and smart use of the register combiners. Unfortunately, it wouldn’t work on older hardware
I don’t understand how you can do it with
only two units. You have to read
A_bump, A_gloss and RGB_base, which are all
stored in different textures/maps, right?
Or do you store A_gloss as the alpha
component of the RGB_base texture?
He, no, i said " two pass with multitexturing "… that’s different That’s 2 possible textuers for pass1, and 2 possible textures for pass2… so you can manipulate up to 4 texture inputs.