#!version 2.2.4 surface #!parameters: uniform float Ka = 1 uniform float Kd = 1 uniform color brickcolor = "rgb" [ .5 .3 .1 ] uniform color mortarcolor = "rgb" [ .4 .4 .4 ] uniform float raggedamp = 0.04 uniform float raggedfreq = 12 uniform float jagged = 0.04 uniform float brickvary = 0.7 uniform float brickwidth = .28 uniform float brickheight = .07 uniform float mortarthickness = .014 uniform float rowvary = .5 uniform float pitting = 0.01 uniform float pockfrequency = 10 uniform float groovedepth = 0.01 #!variables: uniform vector temporary_0 varying vector bcolor varying vector Ct varying vector Nf varying float sbrick varying float tbrick varying float w varying float h varying float ss varying float tt varying float swidth varying float twidth uniform float BMWIDTH uniform float BMHEIGHT uniform float MWF uniform float MHF varying float whichbrick varying float fact varying float disp uniform float temporary_1 varying float temporary_2 varying float temporary_3 varying float temporary_4 varying float temporary_5 varying float temporary_6 varying float temporary_7 varying float temporary_8 varying float temporary_9 varying float temporary_10 varying vector PP varying float scoord varying float tcoord varying float temporary_11 varying float temporary_12 varying float temporary_13 uniform float temporary_14 varying float x0 varying float x1 varying vector temporary_15 varying vector temporary_16 varying vector temporary_17 varying vector temporary_18 varying vector temporary_19 varying vector temporary_20 #!Init: vfromf temporary_0 .5 .3 .1 cfrom brickcolor "rgb" temporary_0 vfromf temporary_0 .4 .4 .4 cfrom mortarcolor "rgb" temporary_0 return #!Code: addff BMWIDTH brickwidth mortarthickness addff BMHEIGHT brickheight mortarthickness mulff temporary_1 mortarthickness 0.5 divff MWF temporary_1 BMWIDTH mulff temporary_1 mortarthickness 0.5 divff MHF temporary_1 BMHEIGHT vufloat temporary_3 1.5 Du ("f=f") temporary_9 s mulff temporary_8 temporary_9 du abs ("f=f") temporary_7 temporary_8 Dv ("f=f") temporary_10 s mulff temporary_9 temporary_10 dv abs ("f=f") temporary_8 temporary_9 addff temporary_6 temporary_7 temporary_8 vufloat temporary_7 1.0e-6 max ("f=ff") temporary_5 temporary_6 temporary_7 vufloat temporary_6 1.0e-6 max ("f=ff") temporary_4 temporary_5 temporary_6 mulff temporary_2 temporary_3 temporary_4 vufloat temporary_3 BMWIDTH divff swidth temporary_2 temporary_3 vufloat temporary_3 1.5 Du ("f=f") temporary_9 t mulff temporary_8 temporary_9 du abs ("f=f") temporary_7 temporary_8 Dv ("f=f") temporary_10 t mulff temporary_9 temporary_10 dv abs ("f=f") temporary_8 temporary_9 addff temporary_6 temporary_7 temporary_8 vufloat temporary_7 1.0e-6 max ("f=ff") temporary_5 temporary_6 temporary_7 vufloat temporary_6 1.0e-6 max ("f=ff") temporary_4 temporary_5 temporary_6 mulff temporary_2 temporary_3 temporary_4 vufloat temporary_3 BMHEIGHT divff twidth temporary_2 temporary_3 moveff scoord s moveff tcoord t fneql temporary_1 jagged 0.0 vufloat temporary_2 temporary_1 if temporary_2 #!Label15 vufloat temporary_5 1 mulff temporary_4 s temporary_5 vufloat temporary_5 BMWIDTH divff temporary_3 temporary_4 temporary_5 vufloat temporary_6 1 mulff temporary_5 t temporary_6 vufloat temporary_6 BMHEIGHT divff temporary_4 temporary_5 temporary_6 noise ("c=ff") PP temporary_3 temporary_4 vufloat temporary_4 jagged xcomp ("f=p") temporary_5 PP mulff temporary_3 temporary_4 temporary_5 addff scoord scoord temporary_3 vufloat temporary_4 jagged ycomp ("f=p") temporary_5 PP mulff temporary_3 temporary_4 temporary_5 addff tcoord tcoord temporary_3 #!Label15: endif vufloat temporary_2 BMWIDTH divff ss scoord temporary_2 vufloat temporary_2 BMHEIGHT divff tt tcoord temporary_2 floor ("f=f") tbrick tt vufloat temporary_4 0.5 mulff temporary_3 temporary_4 tbrick vufloat temporary_4 1 mod ("f=ff") temporary_2 temporary_3 temporary_4 addff ss ss temporary_2 vufloat temporary_3 0.2 vufloat temporary_7 0.5 addff temporary_6 tbrick temporary_7 noise ("f=f") temporary_5 temporary_6 vufloat temporary_6 0.5 subff temporary_4 temporary_5 temporary_6 mulff temporary_2 temporary_3 temporary_4 addff ss ss temporary_2 floor ("f=f") sbrick ss subff ss ss sbrick subff tt tt tbrick vufloat temporary_3 103 mulff temporary_2 temporary_3 sbrick addff whichbrick temporary_2 tbrick vufloat temporary_3 raggedamp vufloat temporary_6 2 vufloat temporary_11 5.15 mulff temporary_10 tbrick temporary_11 addff temporary_9 s temporary_10 vufloat temporary_10 raggedfreq mulff temporary_8 temporary_9 temporary_10 vufloat temporary_12 23.8 mulff temporary_11 sbrick temporary_12 addff temporary_10 t temporary_11 vufloat temporary_11 raggedfreq mulff temporary_9 temporary_10 temporary_11 noise ("f=ff") temporary_7 temporary_8 temporary_9 mulff temporary_5 temporary_6 temporary_7 vufloat temporary_6 1 subff temporary_4 temporary_5 temporary_6 mulff temporary_2 temporary_3 temporary_4 addff ss ss temporary_2 vufloat temporary_3 raggedamp vufloat temporary_6 2 vufloat temporary_11 11.4 mulff temporary_10 tbrick temporary_11 addff temporary_9 s temporary_10 vufloat temporary_10 raggedfreq mulff temporary_8 temporary_9 temporary_10 vufloat temporary_12 7.2 mulff temporary_11 sbrick temporary_12 addff temporary_10 t temporary_11 vufloat temporary_11 raggedfreq mulff temporary_9 temporary_10 temporary_11 noise ("f=ff") temporary_7 temporary_8 temporary_9 mulff temporary_5 temporary_6 temporary_7 vufloat temporary_6 1 subff temporary_4 temporary_5 temporary_6 mulff temporary_2 temporary_3 temporary_4 addff tt tt temporary_2 divff temporary_1 raggedamp 2 vufloat temporary_3 temporary_1 vufloat temporary_6 2 vufloat temporary_12 5.15 mulff temporary_11 tbrick temporary_12 addff temporary_10 s temporary_11 vufloat temporary_11 raggedfreq mulff temporary_9 temporary_10 temporary_11 vufloat temporary_10 2 mulff temporary_8 temporary_9 temporary_10 vufloat temporary_13 23.8 mulff temporary_12 sbrick temporary_13 addff temporary_11 t temporary_12 vufloat temporary_12 raggedfreq mulff temporary_10 temporary_11 temporary_12 vufloat temporary_11 2 mulff temporary_9 temporary_10 temporary_11 noise ("f=ff") temporary_7 temporary_8 temporary_9 mulff temporary_5 temporary_6 temporary_7 vufloat temporary_6 1 subff temporary_4 temporary_5 temporary_6 mulff temporary_2 temporary_3 temporary_4 addff ss ss temporary_2 divff temporary_1 raggedamp 2 vufloat temporary_3 temporary_1 vufloat temporary_6 2 vufloat temporary_12 11.4 mulff temporary_11 tbrick temporary_12 addff temporary_10 s temporary_11 vufloat temporary_11 raggedfreq mulff temporary_9 temporary_10 temporary_11 vufloat temporary_10 2 mulff temporary_8 temporary_9 temporary_10 vufloat temporary_13 7.2 mulff temporary_12 sbrick temporary_13 addff temporary_11 t temporary_12 vufloat temporary_12 raggedfreq mulff temporary_10 temporary_11 temporary_12 vufloat temporary_11 2 mulff temporary_9 temporary_10 temporary_11 noise ("f=ff") temporary_7 temporary_8 temporary_9 mulff temporary_5 temporary_6 temporary_7 vufloat temporary_6 1 subff temporary_4 temporary_5 temporary_6 mulff temporary_2 temporary_3 temporary_4 addff tt tt temporary_2 vufloat temporary_3 1 fegt temporary_2 swidth temporary_3 if temporary_2 #!Label18 mulff temporary_14 2 MWF subff temporary_1 1 temporary_14 vufloat w temporary_1 #!Label18: else #!Label17 vufloat temporary_4 MWF subff temporary_1 1 MWF vufloat temporary_5 temporary_1 vufloat temporary_7 2 divff temporary_6 swidth temporary_7 subff x0 ss temporary_6 addff x1 x0 swidth vufloat temporary_6 0 min ("f=ff") temporary_9 x1 temporary_5 max ("f=ff") temporary_10 x0 temporary_4 subff temporary_8 temporary_9 temporary_10 divff temporary_7 temporary_8 swidth max ("f=ff") temporary_3 temporary_6 temporary_7 vufloat temporary_6 1 vufloat temporary_8 MWF divff temporary_7 temporary_8 swidth subff temporary_5 temporary_6 temporary_7 vufloat temporary_6 0 max ("f=ff") temporary_4 temporary_5 temporary_6 vufloat temporary_5 1 clamp ("f=fff") w temporary_3 temporary_4 temporary_5 #!Label17: endif vufloat temporary_3 1 fegt temporary_2 twidth temporary_3 if temporary_2 #!Label20 mulff temporary_14 2 MHF subff temporary_1 1 temporary_14 vufloat h temporary_1 #!Label20: else #!Label19 vufloat temporary_4 MHF subff temporary_1 1 MHF vufloat temporary_5 temporary_1 vufloat temporary_7 2 divff temporary_6 twidth temporary_7 subff x0 tt temporary_6 addff x1 x0 twidth vufloat temporary_6 0 min ("f=ff") temporary_9 x1 temporary_5 max ("f=ff") temporary_10 x0 temporary_4 subff temporary_8 temporary_9 temporary_10 divff temporary_7 temporary_8 twidth max ("f=ff") temporary_3 temporary_6 temporary_7 vufloat temporary_6 1 vufloat temporary_8 MHF divff temporary_7 temporary_8 twidth subff temporary_5 temporary_6 temporary_7 vufloat temporary_6 0 max ("f=ff") temporary_4 temporary_5 temporary_6 vufloat temporary_5 1 clamp ("f=fff") h temporary_3 temporary_4 temporary_5 #!Label19: endif vufloat fact 1 vufloat disp 0 vufloat temporary_3 MHF flt temporary_2 tt temporary_3 if temporary_2 #!Label22 vufloat temporary_3 groovedepth vufloat temporary_7 MHF divff temporary_6 tt temporary_7 vufloat temporary_8 MHF divff temporary_7 tt temporary_8 mulff temporary_5 temporary_6 temporary_7 vufloat temporary_6 1 subff temporary_4 temporary_5 temporary_6 mulff disp temporary_3 temporary_4 #!Label22: else #!Label21 subff temporary_1 1.0 MHF vufloat temporary_4 temporary_1 fgt temporary_3 tt temporary_4 if temporary_3 #!Label23 vufloat temporary_4 groovedepth vufloat temporary_9 1 subff temporary_8 temporary_9 tt vufloat temporary_9 MHF divff temporary_7 temporary_8 temporary_9 vufloat temporary_10 1 subff temporary_9 temporary_10 tt vufloat temporary_10 MHF divff temporary_8 temporary_9 temporary_10 mulff temporary_6 temporary_7 temporary_8 vufloat temporary_7 1 subff temporary_5 temporary_6 temporary_7 mulff disp temporary_4 temporary_5 #!Label23: endif #!Label21: endif vufloat temporary_3 MWF flt temporary_2 ss temporary_3 if temporary_2 #!Label26 mulff temporary_1 0.85 groovedepth vufloat temporary_4 temporary_1 vufloat temporary_8 MWF divff temporary_7 ss temporary_8 vufloat temporary_9 MWF divff temporary_8 ss temporary_9 mulff temporary_6 temporary_7 temporary_8 vufloat temporary_7 1 subff temporary_5 temporary_6 temporary_7 mulff temporary_3 temporary_4 temporary_5 min ("f=ff") disp disp temporary_3 #!Label26: else #!Label25 subff temporary_1 1.0 MWF vufloat temporary_4 temporary_1 fgt temporary_3 ss temporary_4 if temporary_3 #!Label27 mulff temporary_1 0.85 groovedepth vufloat temporary_5 temporary_1 vufloat temporary_10 1 subff temporary_9 temporary_10 ss vufloat temporary_10 MWF divff temporary_8 temporary_9 temporary_10 vufloat temporary_11 1 subff temporary_10 temporary_11 ss vufloat temporary_11 MWF divff temporary_9 temporary_10 temporary_11 mulff temporary_7 temporary_8 temporary_9 vufloat temporary_8 1 subff temporary_6 temporary_7 temporary_8 mulff temporary_4 temporary_5 temporary_6 min ("f=ff") disp disp temporary_4 #!Label27: endif #!Label25: endif vufloat temporary_3 0 mulff temporary_1 1.3 MHF vufloat temporary_4 temporary_1 smoothstep ("f=fff") temporary_2 temporary_3 temporary_4 tt mulff temporary_14 1.3 MHF subff temporary_1 1.0 temporary_14 vufloat temporary_4 temporary_1 vufloat temporary_5 1 smoothstep ("f=fff") temporary_3 temporary_4 temporary_5 tt subff fact temporary_2 temporary_3 vufloat temporary_4 0 mulff temporary_1 1.3 MWF vufloat temporary_5 temporary_1 smoothstep ("f=fff") temporary_3 temporary_4 temporary_5 ss mulff temporary_14 1.3 MWF subff temporary_1 1.0 temporary_14 vufloat temporary_5 temporary_1 vufloat temporary_6 1 smoothstep ("f=fff") temporary_4 temporary_5 temporary_6 ss subff temporary_2 temporary_3 temporary_4 mulff fact fact temporary_2 vufloat temporary_2 pitting vufloat temporary_5 0.5 mulff temporary_4 temporary_5 fact vufloat temporary_5 0.5 addff temporary_3 temporary_4 temporary_5 mulff fact temporary_2 temporary_3 addff temporary_7 ss sbrick vufloat temporary_8 pockfrequency mulff temporary_6 temporary_7 temporary_8 vufloat temporary_7 BMHEIGHT divff temporary_5 temporary_6 temporary_7 addff temporary_8 tt tbrick vufloat temporary_9 pockfrequency mulff temporary_7 temporary_8 temporary_9 vufloat temporary_8 BMWIDTH divff temporary_6 temporary_7 temporary_8 noise ("f=ff") temporary_4 temporary_5 temporary_6 vufloat temporary_5 0.25 pow ("f=ff") temporary_3 temporary_4 temporary_5 mulff temporary_2 fact temporary_3 subff disp disp temporary_2 vfromf temporary_16 disp normalize ("v=v") temporary_17 N mulvv temporary_15 temporary_16 temporary_17 addvv P P temporary_15 calculatenormal ("p=p") N P normalize ("v=v") temporary_15 N faceforward ("v=vv") Nf temporary_15 I vuvector temporary_15 brickcolor vufloat temporary_3 1 vufloat temporary_5 brickvary vufloat temporary_8 2 vufloat temporary_11 0.5 addff temporary_10 whichbrick temporary_11 noise ("f=f") temporary_9 temporary_10 mulff temporary_7 temporary_8 temporary_9 vufloat temporary_8 1 subff temporary_6 temporary_7 temporary_8 mulff temporary_4 temporary_5 temporary_6 addff temporary_2 temporary_3 temporary_4 vfromf temporary_16 temporary_2 mulvv bcolor temporary_15 temporary_16 vuvector temporary_15 mortarcolor mulff temporary_2 w h mix ("v=vvf") Ct temporary_15 bcolor temporary_2 movevv Oi Os mulvv temporary_15 Os Ct vfromf temporary_0 Ka vuvector temporary_18 temporary_0 ambient ("c=") temporary_19 mulvv temporary_17 temporary_18 temporary_19 vfromf temporary_0 Kd vuvector temporary_19 temporary_0 diffuse ("c=n") temporary_20 Nf mulvv temporary_18 temporary_19 temporary_20 addvv temporary_16 temporary_17 temporary_18 mulvv Ci temporary_15 temporary_16 return