# mental ray scene file from "Writing mental ray shaders" # http://www.writingshaders.com/scene_catalog.html verbose on link "store_diffuse_photon.so" $include "store_diffuse_photon.mi" link "lambert.so" $include "lambert.mi" link "average_radiance.so" $include "average_radiance.mi" link "spotlight.so" $include "spotlight.mi" link "scaled_color.so" $include "scaled_color.mi" options "opt" object space contrast .1 .1 .1 1 globillum on photon trace depth 5 5 5 samples -1 2 trace depth 3 3 3 globillum accuracy 1000 .5 shadow on end options light "light" "spotlight" () origin 1 5 0 direction -.14 -1 -.1 spread .912 energy 2000 2000 2000 globillum photons 50000 end light instance "light_inst" "light" end instance # A "material Phenomenon" can include other types of shaders just like # a material. In this case, the "glambert" material Phenomenon # includes a photon shader using the same diffuse color that the # "lambert" shader does. Notice that the "ambient" component is # supplied to "lambert" by shader "average_radiance" using the typical # "=" syntax for shader referencing. declare phenomenon material "global_diffuse" ( color "diffuse" default 1 1 1, array light "lights" ) shader "indirect" "average_radiance" () shader "indirect_diffuse" "scaled_color" ( "base_color" = interface "diffuse", "scale_factor" = "indirect" ) material "lambert_with_photons" "lambert" ( "diffuse" = interface "diffuse", "ambient" = "indirect_diffuse", "lights" = interface "lights" ) photon "store_diffuse_photon" ( "diffuse_color" = interface "diffuse" ) end material root material "lambert_with_photons" end declare shader "red" "global_diffuse" ( "diffuse" 1 0 0, "lights" ["light_inst"] ) shader "green" "global_diffuse" ( "diffuse" 0 1 0, "lights" ["light_inst"] ) shader "blue" "global_diffuse" ( "diffuse" 0 0 1, "lights" ["light_inst"] ) shader "yellow" "global_diffuse" ( "diffuse" 1 1 0, "lights" ["light_inst"] ) shader "tan" "global_diffuse" ( "diffuse" .8 .8 .7, "lights" ["light_inst"] ) camera "cam" output "rgba" "tif" "material_phenomena.tif" focal 1.5 aperture 1 aspect 1.5 resolution 450 300 end camera instance "camera-instance" "cam" transform 1.0 0.0 0.0 0.0 0.0 0.908490 0.417906 0.0 0.0 -0.417906 0.908490 0.0 0.0 0.272547 -5.378263 1.0 end instance instance "cube-1" geometry "bw_cube" ("name" "cube") material "tan" transform 0.010 0.0 0.0 0.0 0.0 10.0 0.0 0.0 0.0 0.0 0.010 0.0 0.0 8.0 0.0 1.0 tag 1 globillum on globillum 3 end instance instance "cube-2" geometry "bw_cube" ("name" "cube") material "red" transform 7.660444 -0.428525 0.0 0.0 6.427876 0.510696 0.0 0.0 0.0 0.0 0.666667 0.0 0.0 0.0 0.0 1.0 tag 2 globillum on globillum 3 end instance instance "cube-3" geometry "bw_cube" ("name" "cube") material "tan" transform -0.0 0.50 8.660254 0.0 0.0 0.866025 -5.0 0.0 -0.10 -0.0 -0.0 0.0 0.0 -0.230385 -15.990381 1.0 tag 3 globillum on globillum 3 end instance instance "cube-4" geometry "bw_cube" ("name" "cube") material "tan" transform -0.0 -0.50 -8.660254 0.0 0.0 0.866025 -5.0 0.0 0.10 -0.0 -0.0 0.0 0.0 -0.230385 -15.990381 1.0 tag 4 globillum on globillum 3 end instance instance "cone-1" geometry "bw_cone" ("name" "bw-cone") material "green" transform 0.223607 -0.447214 -0.866025 0.0 -0.894427 -0.447214 0.0 0.0 -0.387298 0.774597 -0.50 0.0 0.085525 -0.789083 -0.592820 1.0 tag 5 globillum on globillum 3 end instance instance "ball-1" geometry "bw_ball" ("name" "bw-ball") material "blue" transform 1.818182 0.0 0.0 0.0 0.0 -0.0 -1.818182 0.0 0.0 1.818182 -0.0 0.0 -1.636364 0.545455 -0.0 1.0 tag 6 globillum on globillum 3 end instance instance "column-1" geometry "bw_cylinder" ("name" "bw-column") material "yellow" transform 1.812616 -0.845237 0.0 0.0 0.0 -0.0 -2.0 0.0 0.845237 1.812616 -0.0 0.0 -1.111022 -1.909353 -0.50 1.0 tag 7 globillum on globillum 3 end instance instgroup "root" "camera-instance" "light_inst" "cube-1" "cube-2" "cube-3" "cube-4" "cone-1" "ball-1" "column-1" end instgroup render "root" "camera-instance" "opt"