Example 3: Surface Attributes

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 "prepare.tif" "tiff" "rgba"

 

Declare "_P" "varying point"

Declare "_N" "varying normal"

Declare "_Cambient" "varying color"

Declare "_Cdiffuse" "varying color"

Declare "_Cspecular" "varying color"

Declare "_roughness" "varying float"

 

Display "+position.tif" "tiff" "_P"

Display "+normal.tif" "tiff" "_N"

Display "+ambient.tif" "tiff" "_Cambient" "quantize" [0 255 0 255]

Display "+diffuse.tif" "tiff" "_Cdiffuse" "quantize" [0 255 0 255]

Display "+specular.tif" "tiff" "_Cspecular" "quantize" [0 255 0 255]

Display "+roughness.tif" "tiff" "_roughness" "quantize" [0 255 0 255]

Display "+position_8bit.tif" "tiff" "_P" "quantize" [128 255 0 255]

Display "+normal_8bit.tif" "tiff" "_N" "quantize" [128 255 0 255]

ReadArchive "../lib/view.rib"

 

WorldBegin

 

ReadArchive "../lib/lights.rib"

 

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

Attribute "visibility" "int trace" [1]

Attribute "trace" "displacements" 1

 

ReadArchive "../lib/scene.rib"

 

WorldEnd

 

FrameEnd