rib Wrangling

Working with rib files

This web page displays the results of modeling and rendering a scene using rib files

The rib wrangling project introduces us to using the scene description language to model and render. It is extremely difficult to percieve objects minus the comfort zone of easily moving the camera in 3D space. Here, one is at the mercy of the rendering window to keep checking the scenes progress.

Master Shot

rwMaster
Since there was no 3D space to move around and check the model, each new parameter had to be manually rendered and checked. This was frustrating at first but eventually I got the hang of it and I was able to visualize the object in 3D space with respect to the co ordinates and set parameters accordingly.

WIP Model

rwModel1

Complete Model

Script sample for model
#Coffee cup
    TransformBegin
        Translate -7 0 0
        Rotate 90 0 0 1
        Rotate 90 0 1 0
        Cylinder 2 0 4 360
    TransformEnd
  
    TransformBegin
        Translate -7 0 0
        Rotate 90 0 0 1
        Rotate 90 0 1 0
        Cylinder 1.4 0 4 360
    TransformEnd
  
  
    TransformBegin
        Translate -7 4 0
        Rotate 90 1 0 0
        Torus 1.7 0.3 0 360 360
    TransformEnd
  
    TransformBegin
        Translate -7 0 0
        Rotate 90 1 0 0
        Torus 1.7 0.3 0 360 360
    TransformEnd
  
    TransformBegin
        Translate -9 2 0
        Rotate 90 0 0 1
        Torus 1 0.3 0 360 180
    TransformEnd

rwModel2
By using only the basic available models, we had to design a scene that depicted teapots and other accessories. Since I am an avid coffee lover, I decided to stick to my comfort zone of making a french press and a coffee cup. I was able to create the required scene out of pure memory alone.

Shading

Shader script sample
#French press spout
    AttributeBegin
    Bxdf "PxrLMGlass" "PxrLMGlass1"
          # Examples of mixer and layer connections
          #"reference struct lmlayer" ["PxrLMMixer1:result"]
          #"reference struct lmlayer" ["PxrLMLayer1:result"]
          "int thin" [0]
          "float eta" [1.5]
          "color reflectionColor" [1 1 1]
          "color refractionColor" [.8 .8 .8]
          "float roughness" [0.01]
          "float absorption" [0.0]
          "color transmissionColor" [.5 .5 .5]
          "int shadows" [0]
          "normal bumpNormal" [0. 0. 0.]
          "float presence" [1]
          "int inputAOV" [0]
    AttributeEnd
  
    #Frenchpress handle and top
    AttributeBegin
        Bxdf "PxrLMPlastic" "PxrLMPlastic1"
        # Examples of mixer and layer connections
        #"reference struct lmlayer" ["PxrLMMixer1:result"]
        #"reference struct lmlayer" ["PxrLMLayer1:result"]
        "color diffuseColor" [0 0 0]
        "float diffuseRoughness" [0]
            "float translucence" [0]
        "color sheen" [0 0 0]
            "color incandescence" [0 0 0]
        "normal diffuseNn" [0 0 0]
        "color specularColor" [.6 .6 .6]
        "float specularRoughness" [0.1]
        "float specularAnisotropy" [0]
        "color specularEta" [1.5 1.5 1.5]
        "normal specularNn" [0 0 0]
        "vector specularTn" [0 0 0]
        "color clearcoatColor" [0 0 0]
        "float clearcoatRoughness" [0.01]
        "float clearcoatAnisotropy" [0]
        "float clearcoatEta" [1.3]
        "float clearcoatThickness" [0.0]
        "color clearcoatTransmission" [1 1 1]
        "normal clearcoatNn" [0 0 0]
        "vector clearcoatTn" [0 0 0]
        "float presence" [1]
        "int inputAOV" [0]
        "int sampleLightEmission" [0]
        AttributeEnd

The french press and a coffee mug don't have much of a displacement texture. So I had to work on getting the parameters right for the look and feel of glass, ceramic and metal. I have used PxRDisney and Metal and Plastic shaders respectively.

Test renders with shaders

rwShader2
Lighting - Classic three point lighting has been used for my scene.

Light script sample

Light setup script sample
#Light Rig
AttributeBegin
    AreaLightSource "RMSGeoAreaLight" 1 "float intensity" [11] "color lightcolor" [1 1 1]
    Attribute "visibility" "int camera" [0]
    Attribute "visibility" "int indirect" [0] "int transmission" [0]
    TransformBegin
        Rotate -90 0 1 0
        Rotate -40 1 0 0
        Translate 0 0 40
            Scale 10 10 1
        Sides 1
        #Bxdf "PxrConstant" "const" "color emitColor" [1 1 1]
        Polygon "P" [-0.5 -0.5 0  -0.5 0.5 0  0.5 0.5 0  0.5 -0.5 0]
    TransformEnd
AttributeEnd
  
AttributeBegin
    AreaLightSource "RMSGeoAreaLight" 1 "float intensity" [11] "color lightcolor" [1 1 1]
    Attribute "visibility" "int camera" [0]
    Attribute "visibility" "int indirect" [0] "int transmission" [0]
    TransformBegin
        Rotate -90  0 1 0
        Rotate -80 1 0 0
        Translate 0 0 40
        Scale 10 10 1
        Sides 1
        #Bxdf "PxrConstant" "const" "color emitColor" [1 1 1]
        Polygon "P" [-0.5 -0.5 0  -0.5 0.5 0  0.5 0.5 0  0.5 -0.5 0]
    TransformEnd
AttributeEnd
  
AttributeBegin
    AreaLightSource "RMSGeoAreaLight" 1 "float intensity" [12] "color lightcolor" [1 1 1]
    Attribute "visibility" "int camera" [0]
    Attribute "visibility" "int indirect" [0] "int transmission" [0]
    TransformBegin
        Rotate  90 0 1 0
        Rotate -40 1 0 0
        Translate 0 0 60
        Scale 10 10 1
        Sides 1
        #Bxdf "PxrConstant" "const" "color emitColor" [1 1 1]
        Polygon "P" [-0.5 -0.5 0  -0.5 0.5 0  0.5 0.5 0  0.5 -0.5 0]
    TransformEnd
AttributeEnd

More camera angles were added for a cinematic feel to the overall scene. I rendered them out and tweaked the parameters for light and samples until I was happy with the look of the scene.

Cinematic shots

rwCinematic1 rwCinematic2

Conclusion - Initially the coding was confusing and extremely dis orienting. Once I started getting results, I was able to understand the orientation of the XYZ axis. I was able to think out of the 3D space and create something using just the rib file.