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:
The expression to create this shape was p1 and p2 or point 1 and point 2. Using the variables of s_center and t_center along with the radius I was able to create the circle.
The expression to create this shape was p1 and p2 or point 1 and point 2. Using the variables of s_center and t_center along with the radius I was able to create the circle.
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;
}
To create a cross, I used a flip coordinate to create the shape. The color is determined by the relationship of the pat and bg variables.
To create a cross, I used a flip coordinate to create the shape. The color is determined by the relationship of the pat and bg variables.
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;
}
The expression to create this was similar to that of the circle pattern. For this pattern however you, created two full circles and changed the front circle to the same color as the background color.
The expression to create this was similar to that of the circle pattern. For this pattern however you, created two full circles and changed the front circle to the same color as the background color.
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;
}