DOT3 colors
Hi! I am using DOT3 to produce per-pixel lighting (and bumpmapping -of course) in my engine. Using GL_DOT3_RGB_EXT, how can I color the light. I''ve tried using secondary color, but it shades the shadowed part too. Please help me! Thanks!
Dan Fekete
p.s.: I am using vertex shader to calculate primary color which holds normalization data (I didn''t wanted to do in a cubemap way).
c(final) = Ambient + Sum(light[t].diffuse + light[t].specular) * texture + Sum(light[t].color)
So, if you were just using DOT3, and trying to do color, the (simplified)equation would be:
c(final) = Dot3(tex0,tex1) * tex2 + light[t].color
Where tex0 = normal map
tex1 = cube map
tex2 = decal
Since you're doing the vertex shader route for the normalization data, i'm not sure how you'd factor it in.
BTW, you can do that normalization in pixel shaders instead, which I know for sure is faster than cube mapping, (not sure about vertex though)
~Main
==
Colt "MainRoach" McAnlis
Programmer
www.badheat.com/sinewave
[edited by - duhroach on March 26, 2003 3:14:35 PM]
So, if you were just using DOT3, and trying to do color, the (simplified)equation would be:
c(final) = Dot3(tex0,tex1) * tex2 + light[t].color
Where tex0 = normal map
tex1 = cube map
tex2 = decal
Since you're doing the vertex shader route for the normalization data, i'm not sure how you'd factor it in.
BTW, you can do that normalization in pixel shaders instead, which I know for sure is faster than cube mapping, (not sure about vertex though)
~Main
==
Colt "MainRoach" McAnlis
Programmer
www.badheat.com/sinewave
[edited by - duhroach on March 26, 2003 3:14:35 PM]
Thanks. Do you know any way besides pixel shader. I don''t want it to have so high requirements. How does Doom3 calcs color for DOT3?? I don''t think it uses pixel shader.
My pixel shaders run on a geforce 2, w/ a single pass. Ultimatly, low end cards can achieve the same effect as high end, but with more passes.
IE, on the Geforce FX cards, I pull off Specular+Diffuse lighting, and shadow mapping from up to 60 lightsources in one pass. As you move down (geforce 3 etc) you can only calculate 20 lights per pass, and have to do a pass for lighting, then a pass for shadowing.
So it''s not that the lower cards can''t do the same process, it''s just that they take more passes to achieve the same effect.
~Main
==
Colt "MainRoach" McAnlis
Programmer
www.badheat.com/sinewave
IE, on the Geforce FX cards, I pull off Specular+Diffuse lighting, and shadow mapping from up to 60 lightsources in one pass. As you move down (geforce 3 etc) you can only calculate 20 lights per pass, and have to do a pass for lighting, then a pass for shadowing.
So it''s not that the lower cards can''t do the same process, it''s just that they take more passes to achieve the same effect.
~Main
==
Colt "MainRoach" McAnlis
Programmer
www.badheat.com/sinewave
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement