surface test_surf(float Kd = 1, linepoint = 0.5, lineramp = 0.5; color basecol = (1,1,1), topcol = (1,0,0)) { color surfcolor = 1; normal n = normalize(N); normal nf = faceforward(n, I); float humpdis = 0; if(displacement("hump", humpdis) == 1) { float ramp = smoothstep(linepoint - lineramp, linepoint + lineramp, humpdis); surfcolor = mix(basecol, topcol, ramp); } Oi = Os; color diffusecolor = Kd * diffuse(nf); Ci = Oi * Cs * surfcolor * diffusecolor; }