/* FHKalotte - surface shader to map a polar map to a rectangle in shading coordinates (s,t) Based on the painted plastic shader. Written by Florian Hars, 1996 (GPL Version 2 applies) */ surface FHKalotte ( float Ks =.5, Kd =.5, Ka = 1, roughness = .1; color specularcolor = 1; string mapname = "kalotte.tiff") { point Nf = faceforward(N,I); Ci = color texture(mapname, .5 +.5*(1-t)*sin(6.28318 * s), .5 -.5*(1-t)*cos(6.28318 * s)); Oi=Os; Ci=Os*(Ci * (ambient() + Kd*diffuse(Nf)) + specularcolor * Ks *specular(Nf, -I,roughness)); }