Rib
Prebaked Ribs


return to main index



Introduction

Before attempting to produce a pre-baked RIB (ie. an archive) with Maya it is useful to gain an understanding of what an archive RIB is and how they are referenced by another RIB file. This tutorial assumes you are using the Cutter text editor.


What is an archive?

An archive, or pre-baked, RIB is similar to a beauty pass RIB except that it does not contain any camera statements or the statements WorldBegin & WorldEnd. Often an archive also omits shading and lighting statements as well.


original

Figure 1 - original model

3

Figure 2 - archive read 3 times


The simple model shown in figure 1 was rendered using the following archive RIB file.


umbrella.rib


AttributeBegin
    TransformBegin
        Rotate -90 1 0 0
        Cylinder 0.2 0 2 360
    TransformEnd
    TransformBegin
        Translate 0 2 0
        Rotate -90 1 0 0
        Cone 0.5 1 360
    TransformEnd
AttributeEnd

Although the archive shown above is trivial, it does conform to the format of a correctly structured RIB file. Apart from being much more complicated, archives generated by professional 3D applications such as Maya/RfM or Houdini follow the same format. They also include commented text at the head of their archive files that will indicate the size of the bounding box (minx miny minz maxx maxy maxz) of the geometry. For example,

    #bbox: -1 0 -1 1 2.5 1

Figure 2 was rendered using the following beauty pass RIB file. The ridges were produced using a simple OSL shader - corrugations.osl.


Rib File Using an Archive


Option "ribparse" "string varsubst" ["$"]
IfBegin "!defined(RMSTREE)"
    Option "user" "string RMSTREE" ["/Applications/Pixar/RenderManForMaya-21.0-maya2016"]
IfEnd
Option "searchpath" "shader"    ["PATH_TO_THE_CORRUGATED_OSL_SHADER:@"]
Option "searchpath" "rixplugin" ["${RMSTREE}/lib/shaders:./:@"]
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.005
  
Format 350 200 1
Display "untitled" "it" "rgba"
Projection "perspective" "fov" [20]
  
Translate  0 -1 10
Rotate -30 1 0 0
Rotate 20  0 1 0
Scale 1 1 -1
WorldBegin
    AttributeBegin
        Attribute "identifier" "string name" ["light1"]
        Rotate  0 0 1 0  # oribital
        Rotate -50 1 0 0 # elevation
        Translate 0 0 8  # dolly
        Scale 2 1 2
  
        Attribute "visibility" "int indirect" [0] "int transmission" [0]
        Attribute "visibility" "int camera" [0]
        Rotate 180 0 1 0 # do not change
        Light "PxrRectLight" "PxrRectLightShape3"
                "float exposure" [7]
                "color lightColor" [1 1 1]
                "float coneAngle" [90]
                "int enableShadows" [1]
                "color shadowColor" [0.2 0.2 0.2]
    AttributeEnd
    AttributeBegin
        Pattern "corrugations" "OSL_corrugations1"
        Attribute "displacementbound" "float sphere" [.01]
        Displace "PxrDisplace" "PxrDisplace1"
                "float dispAmount" [0.01]
                "reference float dispScalar" ["OSL_corrugations1:resultF"]
        Bxdf "PxrSurface" "PxrSurface1"
                "color diffuseColor" [0.3 0.3 0.3]
                "float diffuseRoughness" [0.0]
                "color specularFaceColor" [0.18 0.18 0.18]
        TransformBegin
            Translate -1.8 0 0
            ReadArchive "geo/umbrella.rib"
            Translate 1.8 0 0
            ReadArchive "geo/umbrella.rib"
            Translate 1.8 0 0
            ReadArchive "geo/umbrella.rib"
        TransformEnd
  
    AttributeEnd
    AttributeBegin
        Scale 50 1 50
        Bxdf "PxrSurface" "PxrSurface2"
                "color diffuseColor" [0.5 0.5 0.5]
        Polygon "P" [-0.5 0 -0.5  -0.5 0 0.5  0.5 0 0.5  0.5 0 -0.5]
                "st" [0 0  0 1  1 1  1 0]
    AttributeEnd
WorldEnd







© 2002- Malcolm Kesson. All rights reserved.