Home Technical Talk

Shader - Ambient Hemispherics - Diffuse Term only or Lighting too?

polycounter lvl 12
Offline / Send Message
Ace-Angel polycounter lvl 12
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

  • r_fletch_r
    Options
    Offline / Send Message
    r_fletch_r polycounter lvl 9
    ambient + diffuse (light is additive)

    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
  • Ace-Angel
    Options
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    Ah, thanks, that make sense. Should have known better, cheers!
Sign In or Register to comment.