Using the vm_shadow attribute in light instancing to get instanced shadows.
Date Created:Friday December 29th, 2006 03:41 AM
Date Modified:Thursday August 14th, 2008 07:11 PM
Shadow instancing is in addition to light instancing, so we instance lights and shadows.
In addition to our light object, we have a points object that will become a series of lights that cast shadows.
1) Check on the Light's Render tab to make sure "Point Instancing" is checked on and a path to the points object is set.
Lets look in our points object:
2) Add normals using a Point SOP, setting the values to the default $NX, $NY, $NZ
The direction of the light is the reverse direction of the normal)
3) Add the vm_light attribute with an Attribute Create SOP.
opdef:/Shop/v_asadlight docone 1 atten 15 lightcolor `rand($PT)` `1-rand($PT)` 1 coneangle 15 conedelta 25
4) Add the vm_shadow attribute with an Attribute Create SOP.
opdef:/Shop/v_rayshadow shadowtype deep map "$HIP/shadow$PT.rat" spread 20
5) Navigate back up to the Light object's Shadow tab and fill in the same values you used the map parameter in the vm_shadow attribute. The only difference you must note is to use $IPT instead of $PT.
6) Also check on "Auto-Generate Depth Map" and "Deep Shadow Generation" toggles.
7) Leave the SHOP Shadow blank.
8) Turn off the "Auto-Generate Depth Map" when you are pleased with results.
Sometimes you can get clipped shadows. You can fix this by adjusting your focal length in the light you are referencing.
You also may need to turn up the Z-Depth Samples in the light shadow tab if you get jagged edges on your shadows.
Please login or Click Here to register for downloads
Shadow Instancing by Dan Lynch
is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
Based on a work at www.3daet.com
Permissions beyond the scope of this license may be available at http://www.3daet.com