# mental ray scene file from "Writing mental ray shaders" # http://www.writingshaders.com/scene_catalog.html verbose on link "phong.so" $include "phong.mi" link "point_light_shadow.so" $include "point_light_shadow.mi" link "add_colors.so" $include "add_colors.mi" link "framebuffer_put.so" $include "framebuffer_put.mi" options "opt" object space contrast .1 .1 .1 1 samples 2 2 frame buffer 0 "+rgba" frame buffer 1 "+rgba" end options light "light_1" "point_light_shadow" ( "light_color" .4 .4 .4 ) origin 4 5 6 end light instance "L1" "light_1" end instance light "light_2" "point_light_shadow" ( "light_color" .3 .3 .3 ) origin -4 5 0 end light instance "L2" "light_2" end instance light "light_3" "point_light_shadow" ( "light_color" .3 .3 .3 ) origin 2 5 -4 end light instance "L3" "light_3" end instance declare phenomenon color "phong_components" ( color "ambient" default 0 0 0, color "diffuse" default 1 1 1, color "specular" default 0 0 0, scalar "exponent" default 30, array light "lights" ) shader "diffuse_component" "phong" ( "ambient" = interface "ambient", "diffuse" = interface "diffuse", "specular" 0 0 0, "exponent" 0, "lights" = interface "lights" ) shader "specular_component" "phong" ( "ambient" 0 0 0, "diffuse" 0 0 0, "specular" = interface "specular", "exponent" = interface "exponent", "lights" = interface "lights" ) shader "fb_diffuse" "framebuffer_put" ( "color" = "diffuse_component", "index" 0 ) shader "fb_specular" "framebuffer_put" ( "color" = "specular_component", "index" 1 ) shader "add_components" "add_colors" ( "x" = "fb_diffuse", "y" = "fb_specular" ) root = "add_components" end declare material "red" "phong_components" ( "diffuse" 1 .5 .5, "specular" 2 2 2, "lights" ["L1", "L2", "L3"] ) end material material "yellow" "phong_components" ( "diffuse" 1 1 .5, "specular" 2 2 2, "lights" ["L1", "L2", "L3"] ) end material material "blue" "phong_components" ( "diffuse" .5 .5 1, "specular" 2 2 2, "lights" ["L1", "L2", "L3"] ) end material material "gray" "phong_components" ( "diffuse" .7 .7 .7, "specular" 2 2 2, "lights" ["L1", "L2", "L3"] ) end material camera "cam" output "fb0" "tif" "buffer_4_diffuse.tif" output "fb1" "tif" "buffer_4_specular.tif" output "rgba" "tif" "buffer_4.tif" focal 1.5 aperture 1 aspect 1.5 resolution 300 200 end camera ### bw.lookat(0,2,5,0,-.3,0) instance "camera-instance" "cam" transform 1 0 0 0 0 0.90849 0.417906 0 0 -0.417906 0.90849 0 0 0.272547 -5.37826 1 end instance instance "cone-1" geometry "bw_cone" ("name" "bw-cone") material "yellow" 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 1 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 2 globillum on globillum 3 end instance instance "column-1" geometry "bw_cylinder" ("name" "bw-column") material "red" 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 3 globillum on globillum 3 end instance instance "square-1" geometry "bw_square" () material "gray" transform 0.010 0.0 0.0 0.0 0.0 -0.0 0.010 0.0 0.0 -0.010 -0.0 0.0 0.0 -0.0 0.0050 1.0 tag 4 globillum on globillum 3 end instance instgroup "root" "camera-instance" "L1" "L2" "L3" "cone-1" "ball-1" "column-1" "square-1" end instgroup render "root" "camera-instance" "opt"