This page demonstrates the basics of scripting using Pixar’s RenderMan scene description (rib) protocol. Writing rib files by hand focuses attention on the use of color, opacity and the fundamental concepts related to coordinate systems
The preliminary renders have been done using basic shading so that the geometry can be more easily seen.
The modeling, texturing, and lighting of the teapots were done by scripting .rib files.
WorldBegin TransformBegin Scale 1 1 1 TransformEnd Attribute "visibility" "trace" 1 Surface "tracedOcclusion" "float samples" 500 "float coneangle" 75.0 Point Based Occlusion
The script used to give an object a raytrace occlusion is simple. After the World Begins an attribute is given to tell the renderer what is going on. Visibility of the raytrace is turned on using the on/off switch(0/1) right after the “trace”. Then, like in maya, a surface is assigned so the occlusion can show. Make sure a ground plane is present to see the shadow under the object.
The same idea is used in the point-based occlusion, but renderman is nice enough to do the work for you. When you apply a point-based occlusion go to the renderman tools and click on Docs–> Other Passes–>Point-Based Occlusion. This will automatically copy the current file and open a new one with 2 passes: the bake pass and the beauty pass. This helps lower render time by keeping the bake pass and reusing the information for the beauty pass.
WorldBegin TransformBegin LightSource"shadowspot" 3 "float intensity" 5 "point from"[4 5 1]"to"[0 0 0] "shadowname" ["spot3.tex"] TransformEnd Attribute "visibility" "trace" 1 Attribute "visibility" "transmission"1 Deep Map Shadows
Raytraced Shadows with Color
LightSource"shadowspot"1"float intensity"7"lightcolor" [2.5 2 2]"coneangle"15"point from"[1 4 2]"to"[0 0 0]" shadowname" ["spot1.tex"] The 3 numbers represent RGB. So there is 2.5 red, 2 green,and 2 blue amounts for the light color.
In the first render using raytrace, the light is more blown out than that of the deep map render yet the intensity of the light remains the same in both. To get a raytrace shadow, you must specify what type of light wanted. If “spot” was typed without shadow with it, the image will render without a shadow. You must also tell it to turn the shadows on by typing “transmission” 1, basically meaning “shadows” on. A deep map shadow does not use the attribute “raytrace”like raytrace shadows. Deep Map renders the bake pass as if it is the light itself and calculates all the distances of the pixels then adjusts the lightness and darkness accordingly. The renderer takes the Apparent Distance and the True Distance and uses them to create a shadow with the prepass grayscale.
Surface "combo" "texname"["stripe.tex"] Surface "combo" "float Ks" 0.70 "float Kd" 0.50 "float Ka" 1.0 "float roughness" 0.10 "float smovetex" 0.0 "float tmovetex" 0.0 "float tiling" 1.0 "color specularcolor"[1.0 1.0 1.0] "string texname" ["stripe.tex"]
Textures can become fun as well as aggravating. Renderman has its own tool to automatically input a surface. Tileable textures are a great source and recommended so as to avoid those seams. All textures in this are simple photos taken online and mad tileable. Then I converted them to .tex files using Linux’s terminal with this script:
txmake stripes.tif ../textures/stripes.tex
It can be done directly in the .rib file also.Txmake takes files and creates multiple copies of the file as different sizes. This ensures the render the best size for the best render. Once the files is changed, you can create your own surface by inputing the above script. The second listed script is the automatic surface from rendermans tool set.
Option "searchpath" "shader" "@:../shaders" Option "searchpath" "texture" "../textures" Option "searchpath" "archive" "../archives PixelSamples 8 8 Format 1280 720 1 Translate 0 -0.2 2 Rotate -5 1 0 0 Rotate 45 0 1 0 Scale 1 1 -1 DepthOfField 10.0 1 4 Imager "background""background" [1 1 1] WorldBegin
Depth of Field Input
Depth of field is simple. Before your world begins, the renderer should know that you want depth of field added to your whole scene. So type in the above highlighted in their rightful place. Of course, it might come out grainy, so to fix that add pixel samples. Just like in maya, the pixel samples will clear up any graininess. Place it under the options before the camera settings. This is the area like mayas render settings.
Displacement “emboss” is difficult to get exactly right. Once you have input the above text in your .rib, the textures may blow up. Each texture is different, making the displacement more so. The “Km” placed after the displacement name is almost the same as bump depth in maya. I’ve set mine to “.01” and the effect is still a lot. If the displacement is making your object explode, then that is where the “bound” attribute comes in handy. It’s the same idea as the bounding box in maya. Of course each object has a seperate bounding box, but I just used one for all the polygons. It’s pretty high because it’s covering for all of the polygons. A few seams are slightly visible here and there.