CS 457/557 -- Winter Quarter 2017

Project #2

Noisy Displaced Elliptical Dots

100 Points

Due: January 30


This page was last updated: January 23, 2017


Requirements:

  1. The goal of this project is to turn Project #1's elliptical dots into more random-looking height "islands".

  2. You must use the RenderMan noise function somehow to create coherent noise. Exactly how you work it into your elliptical equations is up to you.

  3. First use noise to perturb the ellipse boundaries, possibly like this:

    	point PP = point "shader" P;
    	float magnitude = 0.;
    	float size = 1.;
    	float i;
    	for( i = 0.; i < 6.0; i += 1.0 )
    	{
    		magnitude += ( noise( size * PP ) - 0.5 ) / size;
    		size *= 2.0;
    	}
    
    	. . .
    
    	float numinu = floor( up / Ad );
    	float numinv = floor( vp / Bd );
    
    	float uc = numinu * Ad  +  Ar;  // center of this box
    	float vc = numinv * Bd  +  Br;
    	float du = up - uc;
    	float dv = vp - vc;
    	float oldrad = sqrt( du*du + dv*dv );
    	float newrad = ?????
    	float factor = ?????
    	du *= factor;
    	dv *= factor;
    
    
    	float d = ?????
    	color TheColor = Cs;
    	if( d <= 1. )
    	{
    		TheColor = color( 1., .5, 0. );
    	}
    

    where the RenderMan noise( ) function returns a value between 0. and 1.

  4. Then do something to add height. The height needs to be created with a RenderMan displacement shader. Calculate a displacement, disp, wherever you are right now. Remember that you are already computing a value d which is 0. at the ellipse center and 1. at the ellipse outer boundary. You could do something with that.
    (However, note that you would really like to have 0. at the ellipse boundary and not-zero at the ellipse center instead. Hmmm, how can you turn the range 0.-1. into the range 1.-0.?)

    displacement
    ovalnoised( float
                    Ad = 0.10,              // u diameter
                    Bd = 0.10,              // v diameter
                    NoiseAmp = 0.00,        // noise amplitude
                    DispAmp = 0.10          // displacement amplitude
    )
    {
    	. . .
    
            float numinu = floor( up / Ad );
            float numinv = floor( vp / Bd );
    
            float uc = numinu * Ad  +  Ar;  // center of this box
            float vc = numinv * Bd  +  Br;
            float du = up - uc;
            float dv = vp - vc;
            float oldrad = sqrt( du*du + dv*dv );
            float newrad = ?????
            float factor = ?????
            du *= factor;
            dv *= factor;
    
            float d = ?????
    
            float disp = ?????;
    	if( disp != 0. )
    	{
    		normal n = normalize(N);
            	P = P + disp * n;
            	N = calculatenormal(P);
    	}
    }
    

  5. Then, combine the two to do heights with noise:

  6. Finally, recreate your scene with bump-mapping instead.
    To do this, just re-calculate the normal, but don't displace the point:

            float disp = ?????;
    	if( disp != 0. )
    	{
    		normal n = normalize(N);
    		N = calculatenormal( P + disp * n );
    	}
    

    You can tell the difference by inspecting the silhouettes:
    Displacement-mappedBump-mapped

    Bump-mapping is a popular "cheat" in games. However, it doesn't work well in stereo displays and movies (why not?). Also, it is rarely used when using RenderMan. Displacement Mapping is used instead. (Why?)

  7. Be sure to apply RenderMan lighting.

  8. This must be done procedurally, i.e., with equations in Surface and Displacement Shader programs. No textures.

  9. The choice of geometry is up to you. You are allowed to contrive the size to make it work. Keep it simple at first, then, if there is still time, feel free to get creative.

Hints:

The Turn-In Process:

Your electronic turnin will be done at http://engr.oregonstate.edu/teach and will consist of:

  1. All source files (.rib, .sl) You can zip this all together if you want.
  2. Your PDF report describing what you did, why it works, and all of your images. Do not put your PDF into your zip file. Leave it out separately so my collect-all-the-PDFs script can find it.

Submissions are due at 23:59:59 on the listed due date.

Your PDF turnin will consist of:

  1. A cover page (name, Project #2)
  2. Source listings (.rib, .sl)
  3. A prose explanation of what you did and why it worked. (Your submission will not be considered valid unless you can explain why it works.)
  4. At least 3 images showing: (1) Surface noise only, (2) Surface and Displacement (displacement-mapped) noise, and (3) Surface and Displacement (bump-mapped) noise.

Grading:

FeaturePoints
"noise"-y ellipse boundary perturbation40
"noise"-y height displacement-mapping40
Separate bump-mapping20
Potential Total100