These images show the results of using the RenderMan Shading Language (RSL) to write a variety of special effects surface shaders. The notes and RSL code accompanying each image explain how each effect was achieved.




1) Square

if(t >= 0.2 && t <= .8 && s >= 0.2 && s <= .8 ) surfcolor = color(1,0,0);

 

The picture above shows the thoughts behind the image. I drew the coordinates, and figured out the math.

I used a similar method to figure out the cross below. Instead of using AND (&&) to OR ( ||).

 

			
			
 

2) Cross

if(t >= 0.3 && t <= .7 || s >= 0.3 && s <= .7 ) surfcolor = color(0,sin(s),1);

 

   
 

3) Quadrant

if((t*t)<s ) surfcolor = color(0,sin(s),1);

 

I searched the equation to create a parabola: y = x^2

 

   
 

4) Circle

 

if(((s-.5)*(s-.5))+((t-.5)*(t-.5))<.2)

 

In this equation, I used the equation: x^2 + y^2 = z^2

Instead of x and y, I used s and t.

 

   
 

5) Curve 1

if(t >= sin(s*6) ) surfcolor = color(0,sin(s),1);

 

Since I've been using sin for color, when you plug it into the equation, this is the results!

 

   
 

6) Curve 2

if(t >= tan(s*12) )

 

And finally, for my personal curiosity, I placed a Tangent in the equation and I received this neat patter.

   

 

 

7) CUSTOMIZED

 

I wanted to recreate a plaid pattern, which you can see here.

I also wanted to create a pattern with monotone colors.

THE CODE