This page was last updated: January 23, 2017
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.
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); } }
float disp = ?????; if( disp != 0. ) { normal n = normalize(N); N = calculatenormal( P + disp * n ); }
You can tell the difference by inspecting the silhouettes:
Displacement-mapped | Bump-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?)
Your electronic turnin will be done at http://engr.oregonstate.edu/teach and will consist of:
Submissions are due at 23:59:59 on the listed due date.
Your PDF turnin will consist of:
Feature | Points |
---|---|
"noise"-y ellipse boundary perturbation | 40 |
"noise"-y height displacement-mapping | 40 |
Separate bump-mapping | 20 |
Potential Total | 100 |