Sign in to follow this  

Deferred Shading - Multiple Lights

Recommended Posts

i tried to reply to this topic but it was retired.... 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?

Share this post

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

Share this post

Link to post
Share on other sites
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 this ok? i'm trying to see if i have anymore bugs....


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

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this