Archived

This topic is now archived and is closed to further replies.

DOT3 colors

This topic is 5378 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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).

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites