s t c o l o r a t i o nThese 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. |
Cross |
if(s > .25 && s < .75 || t > .25 && t < .75) surfcolor = color(0.2,0.4,1.0); |
Center Square |
if(s > .25 && s < .75 && t > .25 && t < .75) surfcolor = color(0.2,0.4,1.0); |
Diagonal |
if(s+t>1) surfcolor = color(0.2,0.4,1.0); |
Circle |
if((s-.5)*(s-.5)+(t-.5)*(t-.5)<.10) surfcolor = color(0.2,0.4,1.0); |
Quadrant Arc |
if((s*s)+(t*t)>1) surfcolor = color(0.2,0.4,1.0); |
Crescent |
if((s-.5)*(s-.5)+(t-.5)*(t-.5)<.2 && (s-.45)*(s-.45)+(t-.45)*(t-.45)>.19) surfcolor = color(0.2,0.4,1.0); |
Bull's Eye |
if((s-.5)*(s-.5)+(t-.5)*(t-.5)<.3) surfcolor = color(0.2,0.4,1.0); if((s-.5)*(s-.5)+(t-.5)*(t-.5)<.25) surfcolor = color(1,.6,0); if((s-.5)*(s-.5)+(t-.5)*(t-.5)<.2) surfcolor = color(0.2,0.4,1.0); if((s-.5)*(s-.5)+(t-.5)*(t-.5)<.15) surfcolor = color(1,.6,0); if((s-.5)*(s-.5)+(t-.5)*(t-.5)<.1) surfcolor = color(0.2,0.4,1.0); if((s-.5)*(s-.5)+(t-.5)*(t-.5)<.05) surfcolor = color(1,.6,0); if((s-.5)*(s-.5)+(t-.5)*(t-.5)<.01) surfcolor = color(0.2,0.4,1.0); |
Partially Shaded Mighty Eightball |
if((s-.5)*(s-.5)+(t-.5)*(t-.5)<.26 && (s-.45)*(s-.45)+(t-.45)*(t-.45)>.16) surfcolor = color(0); if((s-.5)*(s-.5)+(t-.5)*(t-.5)<.24 && (s-.45)*(s-.45)+(t-.45)*(t-.45)>.16) surfcolor = color(0.05); if((s-.5)*(s-.5)+(t-.5)*(t-.5)<.22 && (s-.45)*(s-.45)+(t-.45)*(t-.45)>.16) surfcolor = color(0.1); if((s-.5)*(s-.5)+(t-.5)*(t-.5)<.2 && (s-.45)*(s-.45)+(t-.45)*(t-.45)>.16) surfcolor = color(0.15); if((s-.5)*(s-.5)+(t-.5)*(t-.5)<.18 && (s-.45)*(s-.45)+(t-.45)*(t-.45)>.16) surfcolor = color(0.2); if((s-.5)*(s-.5)+(t-.5)*(t-.5)<.16 && (s-.45)*(s-.45)+(t-.45)*(t-.45)>.16) surfcolor = color(0.25); if((s-.4)*(s-.4)+(t-.3)*(t-.3)<.015) surfcolor = color(.175); if((s-.4)*(s-.4)+(t-.3)*(t-.3)<.0075) surfcolor = color(1); if((s-.4)*(s-.4)+(t-.55)*(t-.55)<.025) surfcolor = color(.175); if((s-.4)*(s-.4)+(t-.55)*(t-.55)<.015) surfcolor = color(1); |
|
|
The equation below can be implemented to add noise to st patterns. float value = (noise( (s- sfocus) * sfreq, (t- tfocus) * tfreq) - 0.5) * amp; float ss = s + value; float tt = t + value; |