#!version 2.2.4 surface #!parameters: uniform float Ka = .6 uniform float Kd = .85 uniform float Ks = 0 uniform float roughness = 1 uniform float Km = 0.01 uniform float displace = 1 uniform float minfreq = 1 uniform float maxfreq = 4 uniform float tilefreq = 2 uniform float grungefreq = 30 uniform float grunge_Pow = 2 uniform float grunginess uniform color stonecolor = [ .4 .6 .4 ] uniform color groundcolor = [ .45 0.35 0.2 ] uniform float varyhue = .07 uniform float varysat = .2 uniform float varylum = .45 #!variables: varying vector surface_color varying vector layer_color varying float layer_opac varying float ss varying float tt varying float stile varying float ttile varying float freq varying float mag varying float r varying float theta varying float angle varying float d varying float d0 varying float d1 varying float cx varying float cy varying float noifreq varying float noiscale varying float bub varying vector V varying vector Nf varying float grunge varying float surface_mag varying float temporary_0 varying float temporary_1 varying float stoneindex varying vector p1 varying vector p2 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 vector temporary_10 varying vector Chsv varying float h varying float s_1 varying float v_1 varying vector temporary_11 varying vector temporary_12 uniform vector temporary_13 varying vector temporary_14 uniform float temporary_15 varying vector PP varying float width varying float cutoff varying float turb varying float f varying float fade varying vector temporary_16 varying vector temporary_17 varying vector temporary_18 #!Init: negf grunginess 0.2 return #!Code: vufloat noifreq 10 vufloat noiscale 0.3 vuvector surface_color groundcolor vufloat surface_mag 0 vufloat freq maxfreq forbegin #!Label13 #!Label14 #!Label15 #!Label13: vufloat temporary_1 minfreq fgt temporary_0 freq temporary_1 for temporary_0 vufloat temporary_0 3.141592654 vufloat temporary_5 16.31456 mulff temporary_4 freq temporary_5 noise ("f=f") temporary_3 temporary_4 vufloat temporary_4 2 mulff temporary_2 temporary_3 temporary_4 vufloat temporary_3 1 subff temporary_1 temporary_2 temporary_3 mulff angle temporary_0 temporary_1 vufloat temporary_3 0.5 subff temporary_2 s temporary_3 cos ("f=f") temporary_3 angle mulff temporary_1 temporary_2 temporary_3 vufloat temporary_4 0.5 subff temporary_3 t temporary_4 sin ("f=f") temporary_4 angle mulff temporary_2 temporary_3 temporary_4 subff temporary_0 temporary_1 temporary_2 vufloat temporary_1 0.5 addff cx temporary_0 temporary_1 vufloat temporary_3 0.5 subff temporary_2 s temporary_3 sin ("f=f") temporary_3 angle mulff temporary_1 temporary_2 temporary_3 vufloat temporary_4 0.5 subff temporary_3 t temporary_4 cos ("f=f") temporary_4 angle mulff temporary_2 temporary_3 temporary_4 addff temporary_0 temporary_1 temporary_2 vufloat temporary_1 0.5 addff cy temporary_0 temporary_1 vufloat temporary_2 tilefreq mulff temporary_1 freq temporary_2 mulff temporary_0 cx temporary_1 vufloat temporary_1 1.0 mod ("f=ff") ss temporary_0 temporary_1 vufloat temporary_2 tilefreq mulff temporary_1 freq temporary_2 mulff temporary_0 cy temporary_1 vufloat temporary_1 1.0 mod ("f=ff") tt temporary_0 temporary_1 vufloat temporary_2 tilefreq mulff temporary_1 freq temporary_2 mulff temporary_0 cx temporary_1 floor ("f=f") stile temporary_0 vufloat temporary_2 tilefreq mulff temporary_1 freq temporary_2 mulff temporary_0 cy temporary_1 floor ("f=f") ttile temporary_0 vufloat temporary_1 13 mulff temporary_0 temporary_1 ttile addff stoneindex stile temporary_0 vufloat temporary_0 0.5 vufloat temporary_5 10 mulff temporary_4 temporary_5 freq vufloat temporary_6 10 mulff temporary_5 temporary_6 freq noise ("f=ff") temporary_3 temporary_4 temporary_5 vufloat temporary_4 2 mulff temporary_2 temporary_3 temporary_4 vufloat temporary_3 1 subff temporary_1 temporary_2 temporary_3 addff bub temporary_0 temporary_1 mulff temporary_8 s noifreq mulff temporary_9 t noifreq noise ("f=ff") temporary_7 temporary_8 temporary_9 vufloat temporary_8 2 mulff temporary_6 temporary_7 temporary_8 vufloat temporary_7 1 subff temporary_5 temporary_6 temporary_7 vufloat temporary_6 912 addff temporary_4 temporary_5 temporary_6 noise ("f=f") temporary_3 temporary_4 vufloat temporary_4 2 mulff temporary_2 temporary_3 temporary_4 vufloat temporary_3 1 subff temporary_1 temporary_2 temporary_3 mulff temporary_0 noiscale temporary_1 addff ss ss temporary_0 mulff temporary_8 s noifreq mulff temporary_9 t noifreq noise ("f=ff") temporary_7 temporary_8 temporary_9 vufloat temporary_8 2 mulff temporary_6 temporary_7 temporary_8 vufloat temporary_7 1 subff temporary_5 temporary_6 temporary_7 vufloat temporary_6 333 addff temporary_4 temporary_5 temporary_6 noise ("f=f") temporary_3 temporary_4 vufloat temporary_4 2 mulff temporary_2 temporary_3 temporary_4 vufloat temporary_3 1 subff temporary_1 temporary_2 temporary_3 mulff temporary_0 noiscale temporary_1 addff tt tt temporary_0 vufloat temporary_0 0.5 vufloat temporary_2 0.1 vufloat temporary_7 8.456 mulff temporary_6 freq temporary_7 vufloat temporary_8 18.773 mulff temporary_7 freq temporary_8 noise ("f=ff") temporary_5 temporary_6 temporary_7 vufloat temporary_6 2 mulff temporary_4 temporary_5 temporary_6 vufloat temporary_5 1 subff temporary_3 temporary_4 temporary_5 mulff temporary_1 temporary_2 temporary_3 addff cx temporary_0 temporary_1 vufloat temporary_0 0.5 vufloat temporary_2 0.1 vufloat temporary_7 28.398 mulff temporary_6 freq temporary_7 vufloat temporary_8 42.112 mulff temporary_7 freq temporary_8 noise ("f=ff") temporary_5 temporary_6 temporary_7 vufloat temporary_6 2 mulff temporary_4 temporary_5 temporary_6 vufloat temporary_5 1 subff temporary_3 temporary_4 temporary_5 mulff temporary_1 temporary_2 temporary_3 addff cy temporary_0 temporary_1 vufloat temporary_0 0 vfromf p1 cx cy temporary_0 vufloat temporary_0 0 vfromf p2 ss tt temporary_0 distance ("f=pp") d p1 p2 vufloat temporary_3 0.5 vufloat temporary_6 0.5 subff temporary_5 bub temporary_6 abs ("f=f") temporary_4 temporary_5 subff temporary_2 temporary_3 temporary_4 vufloat temporary_3 90 mulff temporary_1 temporary_2 temporary_3 vufloat temporary_3 .09 mulff temporary_4 d d subff temporary_2 temporary_3 temporary_4 mulff temporary_0 temporary_1 temporary_2 vufloat temporary_3 maxfreq subff temporary_2 temporary_3 freq vufloat temporary_3 maxfreq divff temporary_1 temporary_2 temporary_3 mulff mag temporary_0 temporary_1 vufloat temporary_0 0 vufloat temporary_1 1 clamp ("f=fff") layer_opac mag temporary_0 temporary_1 vuvector temporary_10 stonecolor vufloat temporary_0 varyhue vufloat temporary_1 varysat vufloat temporary_2 varylum ctransform ("c=Sc") Chsv "hsv" temporary_10 vufloat temporary_3 0 comp ("f=cf") h Chsv temporary_3 vufloat temporary_3 1 comp ("f=cf") s_1 Chsv temporary_3 vufloat temporary_3 2 comp ("f=cf") v_1 Chsv temporary_3 vufloat temporary_7 3 addff temporary_6 stoneindex temporary_7 cellnoise ("f=f") temporary_5 temporary_6 vufloat temporary_6 0.5 subff temporary_4 temporary_5 temporary_6 mulff temporary_3 temporary_0 temporary_4 addff h h temporary_3 vufloat temporary_4 1 vufloat temporary_9 14 subff temporary_8 stoneindex temporary_9 cellnoise ("f=f") temporary_7 temporary_8 vufloat temporary_8 0.5 subff temporary_6 temporary_7 temporary_8 mulff temporary_5 temporary_1 temporary_6 subff temporary_3 temporary_4 temporary_5 mulff s_1 s_1 temporary_3 vufloat temporary_4 1 vufloat temporary_9 37 addff temporary_8 stoneindex temporary_9 cellnoise ("f=f") temporary_7 temporary_8 vufloat temporary_8 0.5 subff temporary_6 temporary_7 temporary_8 mulff temporary_5 temporary_2 temporary_6 subff temporary_3 temporary_4 temporary_5 mulff v_1 v_1 temporary_3 vufloat temporary_4 1 mod ("f=ff") temporary_3 h temporary_4 vufloat temporary_5 0 vufloat temporary_6 1 clamp ("f=fff") temporary_4 s_1 temporary_5 temporary_6 vufloat temporary_6 0 vufloat temporary_7 1 clamp ("f=fff") temporary_5 v_1 temporary_6 temporary_7 vfromf Chsv temporary_3 temporary_4 temporary_5 vfromf temporary_13 0 vuvector temporary_12 temporary_13 vfromf temporary_13 1 vuvector temporary_14 temporary_13 clamp ("v=vvv") temporary_11 Chsv temporary_12 temporary_14 ctransform ("c=SSc") layer_color "hsv" "rgb" temporary_11 mix ("v=vvf") surface_color surface_color layer_color layer_opac fneql temporary_15 Km 0 vufloat temporary_0 temporary_15 if temporary_0 #!Label16 max ("f=ff") surface_mag surface_mag mag #!Label16: endif #!Label14: vufloat temporary_0 0.5 subff freq freq temporary_0 #!Label15: forend fneql temporary_15 grunginess 0 vufloat temporary_0 temporary_15 if temporary_0 #!Label18 transform ("p=Sp") temporary_10 "shader" P vfromf temporary_13 grungefreq vuvector temporary_11 temporary_13 mulvv PP temporary_10 temporary_11 area ("f=p") temporary_2 PP sqrt ("f=f") temporary_1 temporary_2 vufloat temporary_2 1e-7 max ("f=ff") width temporary_1 temporary_2 vufloat temporary_2 0.5 divff temporary_1 temporary_2 width vufloat temporary_2 0 vufloat temporary_3 maxfreq clamp ("f=fff") cutoff temporary_1 temporary_2 temporary_3 vufloat turb 0 vufloat f 1 forbegin #!Label20 #!Label21 #!Label22 #!Label20: vufloat temporary_3 0.5 mulff temporary_2 temporary_3 cutoff flt temporary_1 f temporary_2 for temporary_1 vfromf temporary_11 f mulvv temporary_10 PP temporary_11 noise ("f=p") temporary_5 temporary_10 vufloat temporary_6 2 mulff temporary_4 temporary_5 temporary_6 vufloat temporary_5 1 subff temporary_3 temporary_4 temporary_5 abs ("f=f") temporary_2 temporary_3 divff temporary_1 temporary_2 f addff turb turb temporary_1 #!Label21: vufloat temporary_1 2 mulff f f temporary_1 #!Label22: forend vufloat temporary_3 2 subff temporary_4 cutoff f mulff temporary_2 temporary_3 temporary_4 divff temporary_1 temporary_2 cutoff vufloat temporary_2 0 vufloat temporary_3 1 clamp ("f=fff") fade temporary_1 temporary_2 temporary_3 vfromf temporary_11 f mulvv temporary_10 PP temporary_11 noise ("f=p") temporary_6 temporary_10 vufloat temporary_7 2 mulff temporary_5 temporary_6 temporary_7 vufloat temporary_6 1 subff temporary_4 temporary_5 temporary_6 abs ("f=f") temporary_3 temporary_4 mulff temporary_2 fade temporary_3 divff temporary_1 temporary_2 f addff turb turb temporary_1 vufloat temporary_1 grunge_Pow pow ("f=ff") grunge turb temporary_1 vufloat temporary_2 grunginess mulff temporary_1 grunge temporary_2 addff surface_mag surface_mag temporary_1 #!Label18: endif feql temporary_15 displace 1 vufloat temporary_0 temporary_15 if temporary_0 #!Label24 vufloat temporary_2 Km mulff temporary_1 temporary_2 surface_mag vfromf temporary_11 temporary_1 normalize ("v=v") temporary_12 N mulvv temporary_10 temporary_11 temporary_12 addvv P P temporary_10 calculatenormal ("p=p") temporary_10 P normalize ("v=v") N temporary_10 #!Label24: else #!Label23 vufloat temporary_2 Km mulff temporary_1 temporary_2 surface_mag vfromf temporary_14 temporary_1 normalize ("v=v") temporary_16 N mulvv temporary_12 temporary_14 temporary_16 addvv temporary_11 P temporary_12 calculatenormal ("p=p") temporary_10 temporary_11 normalize ("v=v") N temporary_10 #!Label23: endif normalize ("v=v") temporary_10 N faceforward ("v=vv") Nf temporary_10 I normalize ("v=v") temporary_10 I negv V temporary_10 movevv Oi Os mulvv temporary_11 surface_color Oi vfromf temporary_13 Ka vuvector temporary_16 temporary_13 ambient ("c=") temporary_17 mulvv temporary_14 temporary_16 temporary_17 vfromf temporary_13 Kd vuvector temporary_17 temporary_13 diffuse ("c=n") temporary_18 Nf mulvv temporary_16 temporary_17 temporary_18 addvv temporary_12 temporary_14 temporary_16 mulvv temporary_10 temporary_11 temporary_12 vfromf temporary_13 Ks vuvector temporary_12 temporary_13 vufloat temporary_0 roughness specular ("c=nvf") temporary_14 Nf V temporary_0 mulvv temporary_11 temporary_12 temporary_14 addvv Ci temporary_10 temporary_11 return