RSL TILE SHADER:
surface myfirstshader()
{
color blue = (0.1, 0.1, 0.3);
color bloo = (0.4, 0.8, 0.8);
float smult = s * 6;
float tmult = t * 6;
float mask12 = noise (smult, tmult);
float sRepeat = mod(smult, 1);
float ssup = smoothstep (0.01, 0.1, sRepeat);
float ssdown = 1 - smoothstep (0.9, 0.99, sRepeat);
float vert = ssup * ssdown;
float tRepeat = mod(tmult, 1);
float tUp = smoothstep (0.01, 0.1, tRepeat);
float tDown = 1 - smoothstep (0.9, 0.99, tRepeat);
float horiz = tUp * tDown;
float squares = vert * horiz;
color black = (.0, .0, .0);
color white = (1, 1, 1);
color yellow = (.9, .9, .8);
float grout = 1 - squares;
color floorSquares = mix (black, white, squares);
//Color Squares
float sFloor = floor (smult);
float tFloor = floor (tmult);
float cellColor = cellnoise (sFloor + 8, tFloor +.1);
float noiseParty = noise ((s*10),t*20);
cellColor = clamp (cellColor, .22, 1);
color blueTiles = cellColor * bloo;
color blooNoise = noiseParty * bloo;
color groutColor = grout * yellow;
color finalTiles = mix (groutColor, blueTiles, squares);
color noisyTiles = mix (finalTiles, blooNoise, squares);
//Displacement
float displace = squares;
P += normalize(N) * squares *.03;
N = calculatenormal (P);
//specular
color spec = specular(N, I, .2);
color MaterialPlastic (normal Nf; color basecolor;
float Kd, Ks, roughness;)
{
extern vector I;
return basecolor * ( Kd*diffuse(Nf))
+ Ks*specular (Nf, -normalize(I), roughness);
}
color shine = MaterialPlastic (normalize(N), finalTiles, 3, 1, .05);
Ci = shine;
}