COMP 870 - Assignment 4


Aims | My experiments with Renderman | Source code and binaries | References | email: golas at cs dot unc dot edu |

This assignment had the following aims:


My experiments with Renderman®:

I took a Utah teapot, for which I found a RIB model on one of the reference sites, along with some displacement shaders. The basic model is shown below:

 Utah Teapot

I took a basic terrain displacement shader from one of Ken Musgrave's examples which uses fractals. A simple usage of the terrain bump displacement shader resulted in:


I used that shader as a base to start writing a shader of my own, and removed all but the base code and added a simple noise with 1 octave, to simply see the effects of noise.

First steps...

Surprisingly, the material so generated gave a nice look of leather. This was something which clearly demonstrates the power of using such a shading method. Just to see what adding excessive amounts of noise can do, I bumped up the noise parameters, i.e. magnitude and frequency, resulting in the image below.


That clearly doesn't look too good. The problem, I realised was that using the lower octaves of noise in the system I was using resulted in too noisy results. So, instead, I tried using octaves i to i+k, instead of 0 to k. They resulted in a clear improvement, as is shown below:

These image sequences show, in descending order, the results of using the offset i, from 3 to 0, and using 4 octaves of noise. The noise function is simply summ(2-i * dnoise(2i)). The results have an analogue in pasting coarser or finer grains of sand onto the teapot.

Finally, I made the shader I had envisioned at the beginning, an ocean surface displacement shader. Unfortunately, my new implementation didn't work as expected, and is still giving heightfields with holes. I had intended to use the program to generate heightfields on the fly which could be used in conjunction with Renderman's RunProgram command to generate procedural primitives. That would have allowed me to make a nice looking nature scene with a seashore. The formulation is borrowed from Tessendorf's ocean surface models. Since that didn't work, I used one of heightfields I had lying around from my previous implementation, and made a simple displacement shader that used the texture value to bump the value. That gave the following results:

The images are ordered in increasing scale factors of 1,5,10. The last image shows a disturbing amount of problems with the image. My initial attempts by increasing the shading rate did not fix it, the 3rd image is rendered with a shadingrate of 0.025! . To find a fix, and noticing the incessant cribbing my prman about displacebounds, I looked them up, and found that prman could not, as expected deal with arbitrary displacements, and there was an easy way of telling it an upper bound so it could compensate. That resulted in the following images:

This time I only gave ridiculously high scale values only, as I simply wanted to see how much prman could compensate. The results were impressive, the only major seams are at the texture boundaries where there is a discontinuity, and there is a distinct look of the ocean on the teapot :D .


Source code and binaries:


References (and some interesting sites found on the way):


Site last updated: Monday, November 11, 2008 2:19 AM