Hey to all,
I was reading up on some random documentation on the great series of tubes from my truck, about Ambient Lighting for Reflection and such, as well how it affects diffuse terms, etc.
Now I'm by no means an expert, so this is what most code looks like:
ambient * lambert * diffusemap + Spec
So here is my question, wouldn't my ambient (which is Z-world based by the way) affect both my, or atleast, ALL of my outcome? I just feel it really unnatural the way my Spec looks all nice and shiny and my diffuse is pitch black.
Thoughts?
Replies
the diffuse term calculates per light and doesnt factor in ambient light. so you add it.
also your forgetting your reflections
((ambient + lambert) * diffuse map) + ((specular + reflection) * spec map)
its can be handy to put in a diffuse and reflection power multiplier so that things dont get blown out(that formula doesnt account for conservation of energy). multiplying your ambient data by a ao bake greatly improves the look of the render.
so:
ambient = ambient cubemap * AO * Strength
diffuse = (n dot l)
spec = (spec + reflection map) * spec map * Strength
final = ambient + diffuse + spec