ShadowShader

From Odwiki

Jump to: navigation, search

A shadow shader is used to modulate the light from a LightShader. This is typically done by computing occlusion and changing the Cl variable accordingly. For example, in VEX a simple shadow shader might be:

  shadow
  simple_shadow()
  {
     Cl *= 1-fastshadow(Ps, L, 0.1);
  }

However, a shadow shader can actually change the Cl variable in any way it chooses. For example:

  shadow
  noisy_shadow()
  {
     vector mid = (Ps + P) * .5;
     Cl *= noise(mid);
  }


Back to MantraShaders

© 2009 od[force].net | advertise