Renderman Shaders

Non-Photorealistic Rendering

Independent Research by Mayilan Krishnamoorthy

(VSFX 785-02 Prof.Malcolm Kesson)


Stained Glass

The starting point of the stained glass texture was from the ak_stainedtexture shader from the renderman.org site and the original can be accessed here.

 

The basic modified code from which further shaders were developed

surface npr_stainedTexture01 
           (	        float Ka = 0.2;
           float Kd = 0.8;
           float Ks = 0.5;
           float roughness = 0.2;
           string Texture = "";
           float screenWidth = 640;
           float screenHeight = 480;
           color Specular = 1.0;
           float Opacity = 1.0;
           uniform float Rows = 10;
           uniform float Cols = 10;
           float Jitter = 0.75;
           float GapWidth = 0.2;
           )
           {
           Ci = Cs;
           Oi = Os * Opacity;
           if (Texture != "") {
           normal Nf;
           vector V;
           color GlassColor;
           color GlassOpac;
           float Border = 0;
           point objP = transform ("raster", P);
           float ss = xcomp(objP)/screenWidth;
           float tt = ycomp(objP)/screenHeight;
           voronoi_extra (Rows, Cols, Jitter, ss, tt, Border);
             
           ss = clamp(abs(ss),0,1);
           tt = clamp(abs(tt),0,1);
           float Gap = smoothstep (0,GapWidth,Border);
           GlassColor = color texture(Texture, ss, tt);
           Oi = Os;
           Ci = Oi * (GlassColor);
           } 
           }

 

Four different outputs for increasing number of columns and rows

 

 
 

 

 

mayilan krishnamoorthy mayilan@gmail.com