/* 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 concrete (float Ka = .8, Kd = 0.75, Ks = 0.2, roughness = 0.2; color concretecolor = color(0.682353, 0.643137, 0.643137); color specularcolor = 0; color Kc = .05 ) { normal Nf = faceforward(normalize(N),I); vector IN = normalize(I);; float delta = .01 * snoise(P); concretecolor = (Kc * delta) + concretecolor ; Ci = concretecolor * (Ka*ambient() + Kd*diffuse(Nf)) + specularcolor * (Ks*specular(Nf,-IN,roughness)); Oi = Os; Ci *= Oi; }