Object feel small.
Object feel huge.
Final composition.
Light Shader:
/* From the RenderMan Companion p.339 */
light
pointlight (
float intensity = 25;
color lightcolor = 1;
point from = point "camera" (0,0,0) )
illuminate (from)
Cl = intensity * lightcolor / (L . L);
}
Displacement Shader:
/*bubbly.sl written a while ago by Ivan DeWolf*/
/*modified by ME 04/11/09*/
displacement
IDbubbly(
float mult = 4,/*multiple bubbles per unit*/
Nzscale = 0,/*scale of the noise ramndomize the location of bubbles*/
Kd = -.2,/*coefficient of displacement*/
bubsize = .25,/*radius of the bubbles*/
Km = 0.05,/*Mangnitude*/
sFreq = 25, /*Displace Freq in s*/
tFreq = 25 /*Displace Freq in t*/
)
{
normal Nn = normalize(N);
float myDisp = sin(s*sFreq*PI) * sin(t*tFreq*PI);
float a,b,c,bub;
float dist, shortest=10000;
point Po = transform("object",P)*mult;
/*true cell center, surrounding cell centers, noised cell center*/
point trucell, surrcell, nzcell;
vector offset;
setxcomp(trucell,floor(xcomp(Po))+.5);
setycomp(trucell,floor(ycomp(Po))+.5);
setzcomp(trucell,floor(zcomp(Po))+.5);
/*what is the shortest distance to a noised cell center*/
for(a = -1; a<= 1; a+=1){ for(b = -1; b<=1; b += 1){ for(c = -1; c<=1; c += 1){ offset = vector(a,b,c); surrcell = trucell+offset; nzcell = surrcell + ((vector cellnoise(surrcell)-.5)*Nzscale); dist = distance(Po,nzcell); if(dist
}
}
/*where it all happens*/
bub = clamp(shortest,0,bubsize)/bubsize;
P+= Nn*(pow(bub,2)-1) + (myDisp*Kd*Km);
N = calculatenormal(P);
}
Surface Shader 1:
surface
glow2(
float Ks = 1.0,
Ka = 0.8,
Kd = 0.8,
roughness = 0.1;
color myColor = 1;
color specularcolor = 1)
{
normal n = faceforward(normalize(N), I);
vector i = -normalize(I);
float d = n.i;
color y = myColor * 2;
color l = ambient() + diffuse(n);
Oi = 0.8*d;
Ci = Oi*mix(l, y, d);
}
Surface Shader 2:
/*AUTHOR: written by Larry Gritz*/
/*modified by ME 04/11/09*/
#define boxstep(a,b,x) (clamp(((x)-(a))/((b)-(a)),0,1))
#define MINFILTERWIDTH 1.0e-7
surface
LGWallpaper2Stripe (
float Ka = 0.5, /*ambient coefficient*/
Kd = 0.75, /*coefficient of diffuse reflection*/
Ks = 0.25; /*coefficient of specular reflection*/
float roughness = 0.1; /*size of specular highlite*/
color specularcolor = 1; /*specular*/
color stripecolor = color "rgb" (1,0.5,0.5);/*color of background and stripes*/
float stripewidth = 0.25; /*width of stripes, in s coordinates*/
float stripespacing = 0.5; /*dist between sets of stripes, in s coordinates*/
)
{
point Nf;
color Ct;
float stripe, ss;
float swidth;
float W = stripewidth/stripespacing;
/* For antialiasing */
swidth = max (abs(Du(s)*du) + abs(Dv(s)*dv), MINFILTERWIDTH) / stripespacing;
ss = mod (s, stripespacing) / stripespacing - 0.5;
if (swidth >= 1)
stripe = 1 - 20*W;
else stripe = clamp (boxstep(W-swidth,W,ss), max(1-W/swidth,0), 1)
- clamp (boxstep(W+stripewidth,W+stripewidth+swidth,ss), 0, 2*W/swidth)
+ clamp (boxstep(W-swidth+4*stripewidth,W+4*stripewidth,ss), max(1-W/swidth,0), 1)
- clamp (boxstep(W+5*stripewidth,W+5*stripewidth+swidth,ss), 0, 2*W/swidth);
Ct = mix (Cs, stripecolor, stripe);
/* compute shading normal */
Nf = faceforward (normalize(N),I);
/* diffuse reflection model */
Oi = Os;
Ci = Os * ( Ct * (Ka*ambient() + Kd*diffuse(Nf)) +
specularcolor * Ks*specular(Nf,-normalize(I),roughness));
}



