/* surface shader: brick_shiny_building creator: Nick Meshes, DePaul University description: Based on loosely screen.sl and shiny.sl Makes a surface that looks like an office building with reflective windows. Walls look plastic-like though. parameters: Ka, Kd, Ks, roughness, specularcolor - work just like the plastic shader concretecolor = average color of concrete Kc = coefficient of change of color in concrete */ #include "noises.h" #include "patterns.h" surface concrete2 (float Ka = .8, Kd = 0.75, Ks = 0.2, roughness = 0.2; color basecolor = color(0.682353, 0.643137, 0.643137); color darkcolor = color(0, 0, 0); color lightcolor = color(1, 1, 1); color specularcolor = 0; ) { color concretecolor = basecolor; normal Nf = faceforward(normalize(N),I); vector IN = normalize(I);; float delta = snoise(P); if (delta > .5) concretecolor = lightcolor; if (delta < -.5) concretecolor = darkcolor; Ci = concretecolor * (Ka*ambient() + Kd*diffuse(Nf)) + specularcolor * (Ks*specular(Nf,-IN,roughness)); Oi = Os; Ci *= Oi; }