Example 3: Surface Attributes

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

interact.rib

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

 

Projection "perspective" "fov" [34]

 

Transform [ 1 0 0 0 0 1 0 0 0 0 1 0 0 0.3 2 1 ]

 

Rotate -20 1 0 0

 

FrameBegin 0

 

WorldBegin

 

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

 

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

 

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

 

LightSource "spotlight" 2 "from" [0.402 0.227 -0.702]

"to" [0.124 -0.422 0.005]

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

"lightcolor" [1 0.9 0.7]

 

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

 

LightSource "spotlight" 3 "from" [-0.602 0.159 -0.162]

"to" [-0.309 -0.751 0.130]

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

"lightcolor" [0.4 0.3 0.6]

 

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

 

LightSource "spotlight" 4 "from" [0.214 -0.0148 1.630]

"to" [0.113 -0.234 0.660]

"intensity" [1.6] "coneangle" [0.8]

"lightcolor" [0.6 0.0.3 0.0]

 

Attribute "identifier" "string name" ["surface"]

 

Surface "interact.sl"

 

Attribute "identifier" "string name" ["geometry"]

 

Geometry "image" "filename" [ "position.tif:P"

"normal.tif:N"

"ambient.tif:Cambient"

"diffuse.tif:Cdiffuse"

"specular.tif:Cspecular"

"roughness.tif:Froughness" ]

 

WorldEnd

FrameEnd