Skip to main content
gamedev.net
🔒 Locked

Deferred Shading - Multiple Lights

Started by AverageJoeSSU Mar 13, 2009 at 3:38 AM 2 replies 1.3k views
Original Post
AverageJoeSSU
AverageJoeSSU
i tried to reply to this topic but it was retired.... http://www.gamedev.net/community/forums/topic.asp?topic_id=477618 my issue is with my specular term in my lighting equation.... oColor = (emission + ambient + diffuse)*colorr + specular; where colorr is the albedo/diffuse color term... i researched a while back that i use GL_BLEND and multiply the colorr term at the end or on the last light.... is this true? and if it is... how do i go about adding my specular term if i have to multiply the colorr at the end.... doesnt that screw it up?
------------------------------ redwoodpixel.com
JarkkoL
JarkkoL
You should multiply the diffuse term for each light separately or otherwise your specular will get tinted also by the diffuse term. This might be an effect you want in some cases, but usually it's not.
AverageJoeSSU
AverageJoeSSU
Hey Guys,

So I have spent a good while with the point lights, and have managed to confuse myself.

my directional light seems to be lighting up all sides of my cube, and also, for point lights, will i get working results if i just draw the light's volume, without doing stencil test stuff?


i seemed to get blending working somewhat, but my point lights are a bit funky.... i would post a video but i'm still reviewing my code.

Lastly, ......

these lighting values give the following result...is this ok? i'm trying to see if i have anymore bugs....

">link


1.0 , 1.0, 1.0 , 0.0, //Emissive
4.1, 4.1, 4.1, 0.0, //Diffuse
0.0, 0.0, 0.0, 0.0, //Ambient
-0.4, -0.4, -0.4, 0.0, //Specular
5.0 ); //Shininess
Light1->setColor(1.0, 1.0, 1.0);

Thanks for the help
------------------------------ redwoodpixel.com

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.