final render image

VSFX 319 - Programming Models and Shaders

Matrix Composition in Renderman Code


Project Summary:
A demonstration of the basics of scripting shapes RenderMan scene description (rib) protocol. Writing rib files by hand focuses attention on the use of color, opacity and the fundamental concepts related to xyz coordinate system. The preliminary renders have been done using basic shading so that the geometry can be more easily seen.

Results:
Click on the image to the right to see the final render.

Basic Geometry

The basic shape of the "trix". It consists of 3 cylinders, 3 spheres, and a torus.
Attribute "identifier" "name" ["base_trix"]
Rotate 45 -1 1 0
Torus .3 0.05 0 360 360
Rotate -45 -1 1 0
Cylinder 0.1 1 0 360
Rotate -90 1 0 0
Cylinder 0.1 1 0 360
Rotate 90 1 0 0
Rotate 90 0 1 0
Cylinder 0.1 1 0 360
Rotate -90 0 1 0
Translate 1 0 0
Sphere .15 -1 1 360
Translate -1 0 1
Sphere .15 -1 1 360
Translate 0 1 -1
Sphere .15 -1 1 360

Here is the first of many iterations used to build the final grids. I've just duplicated the trix twice to make a small group.

Below is a small group is again duplicated to make a full line, the line is duplicated to make a full plane, and the planes are finally stacked one in front of another to make the full grid.

ReadArchive "double_line_trix.rib"
Translate -1 1 0
ReadArchive "double_line_trix.rib"
Translate -1 1 0
ReadArchive "double_line_trix.rib"
Translate -1 1 0
ReadArchive "double_line_trix.rib"
Translate 4 -4 0
ReadArchive "double_line_trix.rib"
Translate 1 -1 0
ReadArchive "double_line_trix.rib"
Translate 1 -1 0
ReadArchive "double_line_trix.rib"
Translate 1 -1 0
ReadArchive "double_line_trix.rib"
TransformEnd

Here is the final grid layout with the matching code (some of it has been trimmed out for brevity).
Final layout with basic shader Projection "perspective" "fov" 20
ShadingRate 1
Translate -2.5 -1 24
Rotate -28 1 0 0
Rotate 25 0 1 0
Scale 1 1 -1
Surface "plastic"
TransformBegin
ReadArchive "full_plane_trix.rib"
Translate -2 0 -3
ReadArchive "full_plane_trix.rib"
Translate -2 0 -3
ReadArchive "full_plane_trix.rib"
Translate 6 2.7 9
ReadArchive "full_plane_trix.rib"
Translate 2 0 3
ReadArchive "full_plane_trix.rib"
Translate 2 2.7 3
ReadArchive "full_plane_trix.rib"
TransformEnd

Basic Shading and Lighting

Below at left is the geometry with a basic plastic surface shader. To keep things simple and to clearly illustrate the geometry this basic shader was fine. Next came the actual lighting of the scene. First, I rendered my occlusion pass. In the center is the unclamped occlusion pass which caused some areas, particularly the planes further back, to become too dark. On the right is the clamped occlusion which kept the darkness above a certain point so that everthing is visible.

Grid with plastic shader   Unclamped occlusion   Clamped occlusion

At first I used depth map shadows because of some glitches I was having with ray tracing. Below are the .tex files generated by Cutter for each of the three shadow-casting lights in the scene. Ultimately I didn't need them because prefered the ray-traced shadows but I feel they serve as a good illustration of the z-depth of the scene from the point of view of the lights. On the left is the main light, the center is the left red light, and the right is the right blue light.

Main light view   Left red light view   Right blue light view

Advanced Lighting - Shadows

After rendering out pass after pass with depth map shadows I did a visual comparison of them versus ray-trace shadows and felt that, despite the longer rendering times, I prefered the ray-trace shadows for their sharper edges. I think it echoes the hardness of the grid well. What follows are renders showing each of the 4 lights in the scene on their own along with their code. Later, we will see how they all worked together and layered over each other to produce the final image.

Main White Light

Main light pass
LightSource "shadowspot" 1
"intensity" 65.0
"lightcolor" [1 1 1]
"from" [13 14 13]
"to" [0 0 0]
"shadowname" ["raytrace"]
"samples" 32.0
"width" 2.0


Left Red Light

Red light pass
LightSource "shadowspot" 2
"intensity" 115.0
"lightcolor" [1 .3 .3]
"from" [2 9 15]
"to" [0 0 0]
"shadowname" ["raytrace"]
"samples" 32.0
"width" 2.02.0


Right Blue Light

Blue light pass
LightSource "shadowspot" 3
"intensity" 110.0
"lightcolor" [.3 .3 1]
"from" [12 9 0]
"to" [0 0 0]
"shadowname" ["raytrace"]
"samples" 32.0
"width" 2.0


Dim Fill Light at Origin

Fill light pass
LightSource "pointnofalloff" 1
"intensity" .1
"lightcolor" [1.0 1.0 1.0]
"from" [1 1 1]


All Lights On and with Depth of Field added

Below are the final images. The first is with all 4 lights on and interacting with each other. The second is the same image but with depth of field applied. I focused on the second row back to add to the dimensionality and sense of depth of the image. To me, the image feels unfinished without it because of the many different layers of geometry and lighting.

final render image with no DOF final render image with DOF