Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This is a simple sl file that encapsulates the most used passes: color, diffuse, occlusion, specular and environment reflections.
You can disable occlusion, specular and environment reflection calculations. Diffuse, ambient and specular are calculated using categories, so it is important to assign light shaders with categories as well.
It was tested using 3delight (and maya 2009).
If you use maya, 3delight and renderman codes, you may be interested in some sl. This shader may help you get started with basic functions.
- added occ_dark and occ_ambient - added code to handle displacement in occlusion (if "trace displacement" is disabled in the geo attributes, and the displacement shader export undisplaced P, occlusion will use it).
update may 17th 2009: In the occlusion AOV, I was using occlusion_raw so even when colored_occlusion was 1, you only could see the result in the beauty render. Now I've updated the code to output the colored result... You can still modify this in line 321:
renderAOV_OCC = occlusion_colored * Oi; // output colored occlusion insted of raw