V

Avatar

Hemisphere Ambient Lighting

This is a very simple trick, nonetheless an interesting one. It might help make things look a bit better when you probably don’t really need to, but glew it to the back of your head and someday you will might find it useful.

Objects reflect it’s environment. That’s a fact. Everything around an object influences what you see. This trick simulates (in a very cheap way) that. Technically it just blends between two colors defined as ground and sky. It doesn’t take into account any other objects you might have in your scene. That’s a whole new topic.

How it works: The angle between the light direction and the normal defines the influence on a specific point:

float NdotL = dot( N, SkyLight );
float influence = NdotL * 0.5 + 0.5;
vec4 diffuse = mix( GroundColor, SkyColor, influence );

No Comments, Comment or Ping

Comments are closed.