Rib Wrangling

This project demonstrates the basics of how a 3D scene is represented by Pixar's RenderMan scene description RIB file. Such RIB files are normally generated automatically by applications such as Houdini or Maya (plus Pixar's plugin). However, manually writing RIB files using a text editor focuses attention on the way that "elements" such as color, opacity, shading, lighting and coordinate systems are presented to Pixar's PhotoRealistic RenderMan rendering system.

Final Renders

Textures

Main RIB

Option "ribparse" "string varsubst" ["$"]
IfBegin "!defined(RMSTREE)"
Option "user" "string RMSTREE" ["/opt/pixar/RenderManForMaya-21.0-maya2016.5"]
IfEnd
Option "searchpath" "shader"["../../maya/projects/RfM_osl:@"]
Option "searchpath" "rixplugin" ["${RMSTREE}/lib/shaders:/home/mkesson/mount/fachome/maya/projects/RfM_ris:@"]
Option "searchpath" "texture" ["../textures:@"]
Option "searchpath" "archive" ["../archives:Cutter_Help/templates/Rib:custom_templates/Rib"]
#Option "statistics" "endofframe" [1]

Hider "raytrace" "int incremental" [1] "int minsamples" [0] "int maxsamples" [128] "float darkfalloff" [0.025]
Integrator "PxrPathTracer" "PxrPathTracer" "int maxPathLength" [10] "int allowCaustics" [0]
PixelVariance 0.05

Format 1080 720 1
Display "untitled" "it" "rgba"
Projection "perspective" "fov" [20]

Translate0 -1.5 15
Rotate -30 1 0 0
Rotate 50 0 1 0
Scale 1 1 -1
#DisplayFilter "PxrBackgroundDisplayFilter" "background" "color backgroundColor" [1 1 1]
WorldBegin
Bxdf "PxrSurface" "default"
"color diffuseColor" [0.6 0.6 0.6]
"float diffuseGain" [1.0]
"float presence" [1.0]
TransformBegin
Scale 4 4 4
#ReadArchive "cutrAxes.rib"
TransformEnd

ReadArchive "../ribs/cgsky.rib"
ReadArchive "lights/3pt.rib"

AttributeBegin
Translate 0 0 0
#ReadArchive "materials/bluePlastic.rib"
#Sphere 1 -1 1 360
ReadArchive "geo/teaKettle.rib"
AttributeEnd
AttributeBegin
Scale 100 1 100
ReadArchive "materials/ground.rib"
Polygon "P" [-0.5 0 -0.5-0.5 0 0.50.5 0 0.50.5 0 -0.5]
"st" [0 00 33 33 0]
AttributeEnd
WorldEnd

Kettle RIB

# Project 2

# body
AttributeBegin
AttributeBegin
Attribute "identifier" "name" ["kettle_body"]
ReadArchive "materials/copper_color.rib"
ReadArchive "materials/copper_bumps.rib"
Translate 0 0 0
Rotate -90 1 0 0
Cylinder 1.3 0 2 360
#"st" [ 1 11 20 12 2]
AttributeEnd

AttributeBegin
Attribute "identifier" "name" ["upper_body"]
ReadArchive "materials/copper_color.rib"
#ReadArchive "materials/copper_bumps.rib"
Translate 0 2 0
Rotate -901 0 0
Scale 1.3 1.3 1.3
Hyperboloid 1 0 00.6 0 .3360
AttributeEnd
# lid

AttributeBegin
Attribute "identifier" "name" ["lid_connector"]
ReadArchive "materials/copper_color.rib"
Translate 0 2.5 0
Rotate 90 1 0 0
Cylinder .9 0 .3 360
AttributeEnd
AttributeBegin
Attribute "identifier" "name" ["lid_mid"]
ReadArchive "materials/copper_color.rib"
Translate 0 2.5 0
Rotate -901 0 0
Hyperboloid .9 0 00.5 .6 .3360
AttributeEnd
AttributeBegin
Attribute "identifier" "name" ["top_lid"]
ReadArchive "materials/copper_color.rib"
Rotate -90 1 0 0
Disk2.8 .8 360
AttributeEnd
AttributeBegin
Attribute "identifier" "name" ["lid_handel"]
ReadArchive "materials/copper_color.rib"
Translate 0 3 0
Rotate 90 1 0 0
Cylinder .15 0 .3 360
AttributeEnd
AttributeBegin
Attribute "identifier" "name" ["lid_handel"]
ReadArchive "materials/copper_color.rib"
Translate 0 3 0
Sphere .19 -.15 2 180
AttributeEnd
AttributeEnd

# handle

AttributeBegin
Attribute "identifier" "name" ["main_handle"]
ReadArchive "materials/copper_color.rib"
Translate 0 3.3 0
Scale 1 .4 1
Torus 1.1 0.07 0 360 180
AttributeEnd
AttributeBegin
Attribute "identifier" "name" ["Rside_handle"]
ReadArchive "materials/copper_color.rib"
Translate 1.1 3.3 0.0
Rotate 90 1 0 0
Cylinder .07 0 1.3 360
AttributeEnd
AttributeBegin
Attribute "identifier" "name" ["Lside_handle"]
ReadArchive "materials/copper_color.rib"
Translate -1.1 3.3 0.0
Rotate 90 1 0 0
Cylinder .07 0 1.3 360
AttributeEnd

# spout
AttributeBegin
Attribute "identifier" "name" ["Lside_handle"]
ReadArchive "materials/copper_color.rib"
Translate -2.6 2.2 0.0
Rotate 90 1 0 0
Rotate 45 0 1 0
Cylinder .16 .2 1.5 360
AttributeEnd

AttributeBegin
Attribute "identifier" "name" ["Lside_handle"]
ReadArchive "materials/copper_color.rib"
ReadArchive "materials/copper_bumps.rib"
Translate -1 1 0
Rotate -90 1 0 0
Rotate -90 0 1 0
Sphere .6 0 2 360
AttributeEnd

AttributeBegin
Attribute "identifier" "name" ["Lside_handle"]
#ReadArchive "../ribs/flair.rib"
ReadArchive "materials/copper_color.rib"
Translate -2.15 1.78 0
Rotate -40 0 0 1
Rotate -90 0 1 0
Rotate 60 0 0 1
Paraboloid .25 .1 .5 360
AttributeEnd

AttributeBegin
Attribute "identifier" "name" ["Lside_handle"]
ReadArchive "materials/copper_color.rib"
Translate -1.5 1.15 0
Rotate -90 1 0 0
Rotate -90 0 1 0
Sphere .35 1 1 360
AttributeEnd


AttributeBegin
Attribute "identifier" "name" ["Lside_handle"]
ReadArchive "materials/copper_color.rib"
Translate -1.85 1.45 0
Sphere .25 1 1 360
AttributeEnd
AttributeBegin
Attribute "identifier" "name" ["Lside_torus"]
ReadArchive "materials/copper_color.rib"
Translate -1.77 1.38 0
Rotate 90 0 1 0
Rotate 30 1 0 0
Scale 2 2 2
Torus .1 0.025 0 360 360
AttributeEnd

Texture Color RIB

# txmake -mode periodic ../tiffs/CopperTexture.tif ../textures/CopperTexture.tex
Pattern "PxrTexture" "PxrTexture1"
"string filename" ["CopperTexture.tex"]
"int firstChannel" [0]
"int atlasStyle" [0]
"int invertT" [1]
"int filter" [1]
"float blur" [0.0]
"int lerp" [1]
"color missingColor" [1. 0. 1.]
"float missingAlpha" [1.0]
"int linearize" [1]

Pattern "PxrManifold3D" "PxrManifold3D1"
"float scale" [1]
"int use" [0]
"string pref" [""]
"string coordsys" [""]

Bxdf "PxrSurface" "PxrSurface1"
"float diffuseGain" [0]
"color diffuseColor"[1 1 1]

"int diffuseDoubleSided" [1]
"int diffuseBackUseDiffuseColor" [1]
"color diffuseBackColor" [0.18 0.18 0.18]

"reference color specularFaceColor" ["PxrTexture1:resultRGB"]
"float specularRoughness" [.39]
"float presence" [1]
"float reflectionGain" [.7]

 

Texture Displacement RIB

Pattern "PxrVoronoise" "PxrVoronoise2"
"float frequency" [18.0]
"float jitter" [1.0]
"float smoothness" [1.0]

Pattern "PxrWorley" "PxrWorley1"
"int surfacePosition" [0]
"float frequency" [8.0]
"int distancemetric" [0]
"float jitter" [0.75]
"float c1" [0.8]
"float c2" [-0.2]
"float minkowskiExponent" [4.0]
"int shape" [0]
"int clamp" [1]
"int invert" [0]
"float randomScale" [0.]
"float randomScaleCenter" [0.]
# Examples manifold connection
#"reference struct manifold" ["PxrManifold2D1:result"]
#"reference struct manifold" ["PxrManifold3D1:result"]

# "PxrWorley1:resultF"uses->|float|
# "PxrWorley1:resultRGB"uses->|color|





Pattern "PxrRemap" "PxrRemap2"
"reference color inputRGB" ["PxrWorley1:resultRGB"]
"float outputMin" [-1]
"float outputMax" [ 1]
"int clampOutput" [0]

Attribute "displacementbound" "float sphere" [.5]
Displace "PxrDisplace" "PxrDisplace1"
"int enabled" [1]
"float dispAmount" [0.005]
"reference float dispScalar" ["PxrRemap2:resultR"]

Reference Image

Challenges

I had a lot of trouble with creating the curved spout using the displacement and transparency map. Even after adjusting the bounding box area, the object looked like it was still being clipped.

Final Thoughts

If I were to do this project again, I would improve the lighting set up. The UV maps and textures could also be more complex now that I am used to using RIBs.