top of page

St Coloration

These images show the results of using the RenderMan Shading Language (RSL) to write a variety of special effects surface shaders. The objective was to create shaders that would create a variety of shapes using RSL code and having the horizontal/vertical values of the shaders effected.
 

Shapes and RSL Code:
Examples of patterned squares created with RSL code.

 

surface
constant_test(float    Kfb = 1.0;
              float    right = 0.4;
              float    top = 0.50;
              float    side = 0.2;
              color    pat = color(1.0,1.0,1.0);
              color    bg = color(0.0,0.8,0.8);
              float    flip = 1)
{
color    surfcolor = bg;
float tt =t
if(flip == 1)
    tt = 1 -t;

if (t <= topmax && (t >= topmin)
    surfcolor = pat; 

if (t <= sidemax && (t >= sidemin)
    surfcolor = pat;


 

/* STEP 1 - set the apparent surface opacity */
Oi = Os;

/* STEP 2 - calculate the apparent surface color */
Ci = Oi * Cs * surfcolor * Kfb;

}

surface
constant_test2(float    Kfb = 1;
              
float    radius = 0.4;
              
float    s_center = 0.5;
              
float    t_center = 0.5;
            
   color    pat = color(0.6,0.4,1.0))
{

color    surfcolor = bg;

point p1 = point(s_center,t_center,0);
point p2 = point(s,t,0);

float d = distance (p1,p2);  

if (d <= radius)
    surfcolor = pat;

/* STEP 1 - set the apparent surface opacity */
Oi = Os;

 

/* STEP 2 - calculate the apparent surface color */
Ci = Oi * Cs * surfcolor * Kfb;

}

 

surface
constant_test3(float    Kfb = 1;
               
float outer_c = 0.50;
               
color pat = color(1.0,0.6,0.6);
               
color pat2 = color(1.0,1.0,0.6);
               
color bg = color(1,1,1);
                )
{

color    surfcolor = bg;
float outer_a = sqrt(  (t -.5)*(t-.5)*((s -.6)*(s-.6)  );  

if (outer_a <= .3 )
    surfcolor = pat;

float outer_c = sqrt(  (t -.6)*(t-.6)*((s -.6)*(s-.6)  );   
if(outer_c >= .3 )
    surfcolor = pat2;
 
 

/* STEP 1 - set the apparent surface opacity */
Oi = Os;
 

/* STEP 2 - calculate the apparent surface color */
Ci = Oi * Cs * surfcolor * Kfb;
}

 

bottom of page