PDA

View Full Version : 2-passes bump mapping / multiple lights



gemelli_d
10-25-2004, 11:33 PM
-I am trying to get bump mapping with multiple lights.
-I have stencil shadows and the scene is drawn one light by one light.
-Each "light pass" is added to the previous one using additive blending.
-I need 2 passes to get my bump (I have a GeForce 2) for each light.
The result is really bad.
screenshots (http://www.geocities.com/gemelli_d/opengl.htm)

F: frame buffer
N: dot3 pass
D: diffuse pass
For now it is:
F = (N+F)*D
What I need (I think):
F = F + (N * D)

The solutions I have are:
- buy something better than a GeForce 2 to do my bump in only one pass.
- find register/blending/texture settings to do it (I don't know if it is possible)
- use the accumulation buffer.

I'd like to try the third one like this:

for each light
clear the frame buffer
// here I already have my stencil shadows
render the objects using as many passes they need
if first light
copy the frame buffer to the accumulation buffer
else
add the frame buffer to the accumulation buffer
end
copy accumulation buffer to the frame buffer

Is the second solution possible ?
Is the third solution possible ?

Thanks.

gemelli_d
10-27-2004, 11:04 PM
I tried the accumulation buffer solution...It is too slow and I think I need more "bits" to avoid the black effect.
(link to the screenshots in the previous post)