surface window param float height 0.35 param float width 0.15 param float fake 0.02 param float x_min 0.425 param float y_min 0.2 param float brightness 1 param string fname "door2.tif" param float Ks 0.9 param float Kd 0.8 param float Ka 0.2 param float roughness 0.3 param float scale 0.02 param float nshades 4 param float exponent 2 param color specularcolor 1 1 1 param color graincolor 0 0 0 local string $_str_0 "door2.tif" local string $_str_1 "shader" local float x 0 local float y 0 local float x_center 0 local float y_center 0 local float xx 0 local float yy 0 local float r 0 local point V 0 0 0 local point Nf 0 0 0 local float tone 0 local color grain 0 0 0 initcode 15 return code pushf x_min subF s popf x pushf y_min pushf t pushif 1 subff subff popf y pushif 2 divF width popf x_center cpFF height y_center pushf x_center subF x popf xx pushf y_center subF y popf yy pushf yy mulF yy pushf xx mulF xx addff sqrt popf r pushf fake pushif 2 divF width subff pushf r lt pushf fake pushf y gt pushf fake pushf x gt pushf height pushf y lt pushf fake subF width pushf x lt and and and or ifz 0 pushv I pushv N normalize faceforward popv Nf pushv Nf diffuse mulFv Kd ambient mulFv Ka addcc pushif 2 divF width addF height divF y pushif 1 subff pushf width divF x pushif -1 pushs fname pushif 2 pushif 2 ftexture pushc Os mulcf mulcc popc Ci cpCC Os Oi jump 1 label 0 pushv I pushv N normalize faceforward popv Nf pushv I normalize negv popv V pushf scale pushv P pushs $_str_1 transforms divvf noisev popf tone pushf nshades pushf exponent pushf tone pow mulF nshades round divff popf tone cpCC Os Oi pushf tone pushc Cs pushc graincolor cmix popc grain pushf roughness pushv V pushv Nf specular pushf Ks pushc specularcolor mulcf mulcc pushv Nf diffuse mulFv Kd ambient mulFv Ka addcc mulC grain addcc mulC Os popc Ci label 1 return