##RenderMan RIB-Structure 1.0 version 3.03 ########################################################################### # # This RIB file give a demonstration of the use of automatic shadows # which can be attenuated by opacity of individual objects. # # Casting shadows: # By default, light sources do not cast shadows. The following RIB # sets a nonstandard attribute which causes any subsequently declared # light sources to automatically cast shadows using ray tracing: # Declare "shadows" "string" # Attribute "light" "shadows" "on" # LightSource .... # This attribute "affixes" itself to the lightsource when it's # declared. Note that it can be pushed and popped by AttributeBegin/End, # just like any other attribute. # # Occluder options: # When a light source casts shadows, by default the object casts a # shadow which blocks out light according to the Opacity in effect # when the object was declared. For some complex objects (like the # ones in this scene), the surface shader needs to be evaluated before # the renderer can know exactly what the opacity needs to be. This # is slower than the default, and only needs to be done when the # surface shader causes the opacity to change across the surface. In # this case, the proper attribute to set is: # Declare "casts_shadows" "string" # Attribute "render" "casts_shadows" "shade" # # These attributes are all described in the "BMRT User Guide". # ########################################################################### Option "searchpath" "shader" [".:../shaders:&"] Display "assn2.tif" "file" "rgb" "compression" "none" Format 640 480 -1 PixelSamples 1 1 Projection "perspective" "fov" 45 Translate 0 -2 8 Rotate -110 1 0 0 WorldBegin LightSource "ambientlight" 1 "intensity" 0.5 LightSource "distantlight" 1 "from" [0 1 4] "to" [0 0 0] "intensity" 0.8 # Declare "brickwidth" float # Declare "brickheight" float # Declare "mortarthickness" float AttributeBegin Color [ 1.0 1.0 1.0 ] Surface "brick" "brickwidth" .10 "brickheight" 0.025 "mortarthickness" 0.01 Polygon "P" [ 5 -5 0 5 5 0 -5 5 0 -5 -5 0] AttributeEnd AttributeBegin Color [ 1.0 1.0 1.0 ] Surface "wood2" Polygon "P" [ -5 -5 5 5 -5 5 5 -5 -5 -5 -5 -5 ] AttributeEnd AttributeBegin Translate 0 0 2 Color [1 1 .06] Surface "plastic" Sphere 1 -1 1 360 AttributeEnd WorldEnd