(thanks, steve spencer!!)

1.Shaders with basic fuctions


Ci=color"hsv" (
/*Hue*/ sin(2*PI*s*2)+sin(2*PI*t*2),
/*Sat*/ 0.7,
/*Val*/ pow(abs(sin(2*PI*s*2))*abs(sin(2*PI*t*2)),0.5));

Ci=color(
/*red*/ step(0.5,(distance(point(0.5,0.5,0),point(repeat(s,3),repeat(t,3))))), /*green*/distance(point(0.5,0.5,0),point(repeat(s,6),repeat(t,6),0)),
/*blue*/clamp(smoothstep(0.3,0.7,repeat((distance(point(0.5,0.5,0),point(s,t,0))),10)),0,0.5));

Ci=color"hsv"( /*red*/distance(point(0.5,0.5,0),point(repeat(s,3),repeat(t,3),0)), /*green*/distance(point(0.5,0.5,0),point(repeat(s,6),repeat(t,6),0)),
/*blue*/distance(point(0.5,0.5,0),point(repeat(s,12),repeat(t,12),0)));

Ci=color(
/*red*/ 1-step(0.5,distance(point(0.5,0.5,0),point(repeat(s,12),repeat(t,12),0))), /*green*/distance(point(0.5,0.5,0),point(repeat(s,6),repeat(t,6),0)),
/*blue*/ distance(point(0.5,0.5,0),point(repeat(s,24),repeat(t,24),0)));

Ci=color(
/*red*/ step(mod(s*10,1),mod(t*10,1)),
/*green*/ step(0.5,mod(s*5,1)),
/*blue*/ step(0.5,mod(t*5,1)));

Ci=color(
/*red*/ ptlined(point(0.3,0.3,0),point(0.7,0.7,0),point(repeat(s,4),repeat(t,4),0)), /*green*/ptlined(point(0.3,0.7,0),point(0.7,0.3,0),point(repeat(s,4),repeat(t,4),0)),
/*blue*/ pulse(0.48,0.52,0.1,repeat(s,4))+ pulse(0.48,0.52,0.1,repeat(t,4)));


2. Experimental Shaders I
.. faking diffuse illumination.

In this scase, I used two light sources. However, ambient part have some illumination with som global illumination.
To make this image, I added one more diffuse illumination, which have opposite direction of camera.
Also, I added color control to another diffuse illumination to make global illumination. just for fun!!

 

surface

WSedgeplastic2 (....color Refl_color = color(any color)) {
.
.

Nfre = faceforward (normalize(N),-I);
.
.
illuminance (P, Nfre, PI/2)
{ lightC = normalize(L).Nfre; }

.
.
Oi = Os;
Ci = surface_color*(Ka*ambient() + Kd*diffuse(Nf)+Kre*lightC*Refl_color)+ Ks*specularcolor*specular(Nf,normalize(-I),roughness); }


3. Experimental Shaders 2
... Solid Bomb Shader.

instead of UV, this is 3D-mentional shader. just for fun!!

 

here is basic idea..(you need "rmannotes.sl")

PP = transform("shader", P);

ss = repeat(xcomp(PP),freq);
tt = repeat(ycomp(PP),freq);
uu = repeat(zcomp(PP),freq);

xx = whichtile(ss,freq);
yy = whichtile(tt,freq);
zz = whichtile(uu,freq);

d = distance(point(0.5,0.5,0.5),point(ss,tt,uu));

Wooksang Chang 1999