Example 2: Light Passes

Text    hb_plastic.sl    prepare.rib    interact.sl    interact.rib    Makefile

prepare.rib

Option "searchpath" "shader" ["&:.:../../lib/prman:../../shaders/plain"]

 

Format 640 480 1

 

Hider "hidden" "jitter" [0]

 

FrameBegin 0

 

Display FILENAME "tiff" "rgba"

 

ReadArchive "../lib/view.rib"

 

WorldBegin

 

#if LIGHT == 1

Attribute "identifier" "string name" ["ambient"]

LightSource "ambientlight" 1 "intensity" [1] "lightcolor" [1 1 1]

#endif

 

#if LIGHT == 2

Attribute "identifier" "string name" ["light1"]

LightSource "spotlight_rts" 2 "from" [0.402 0.227 -0.702] "to" [0.124 -0.422 0.005]

"intensity" [1] "coneangle" [0.75] "lightcolor" [1 1 1]

#endif

 

#if LIGHT == 3

Attribute "identifier" "string name" ["light2"]

LightSource "spotlight_rts" 3 "from" [-0.602 0.159 -0.162] "to" [-0.309 -0.751 0.130]

"intensity" [1] "coneangle" [0.7] "lightcolor" [1 1 1]

#endif

 

#if LIGHT == 4

Attribute "identifier" "string name" ["light3"]

LightSource "spotlight_rts" 4 "from" [0.214 -0.0148 1.630] "to" [0.113 -0.234 0.660]

"intensity" [1] "coneangle" [0.8] "lightcolor" [1 1 1]

#endif

 

Attribute "visibility" "string transmission" ["opaque"]

Attribute "visibility" "int trace" [1]

Attribute "trace" "displacements" 1

 

ReadArchive "../lib/scene.rib"

 

WorldEnd

 

FrameEnd