52 |
|
|
53 |
type = rnd.nextInt(3) |
type = rnd.nextInt(3) |
54 |
# types: 0=BAND-LIKE, 1=3-COL-LERP, 2=FRACTION-LINE |
# types: 0=BAND-LIKE, 1=3-COL-LERP, 2=FRACTION-LINE |
55 |
|
|
56 |
# Random scaling of (dot) products |
# Random scaling of (dot) products |
57 |
if trans > 0: |
if trans > 0: |
58 |
# Try to keep the textures non-fuzzy |
# Try to keep the textures non-fuzzy |
59 |
rndscale1 = exp(.3*abs(rnd.nextGaussian())) |
rndscale = exp(.3*abs(rnd.nextGaussian())) |
60 |
else: |
else: |
61 |
rndscale1 = exp(.5*rnd.nextGaussian()) |
rndscale = exp(.5*rnd.nextGaussian()) |
|
|
|
|
rndscale2 = exp(.3*abs(rnd.nextGaussian())) |
|
62 |
|
|
63 |
def avg(*args): |
def avg(*args): |
64 |
sum = 0 |
sum = 0 |
67 |
|
|
68 |
# Then, select the combiner path type. |
# Then, select the combiner path type. |
69 |
if type == 0: |
if type == 0: |
70 |
scale = nvcode.combinerscale(avg(*texscales) * 8.0 * rndscale1) |
scale = nvcode.combinerscale(avg(*texscales) * 8.0 * rndscale) |
71 |
|
bandscale = nvcode.combinerscale(2.0 * exp(.5 * rnd.nextGaussian())) |
72 |
|
|
73 |
# Band-like texture. |
# Band-like texture. |
74 |
# |
# |
88 |
# SPARE0 <- (TEX0 . TEX1) |
# SPARE0 <- (TEX0 . TEX1) |
89 |
CI0 RGB A TEXTURE%(t0)s EXPAND_NORMAL_NV RGB |
CI0 RGB A TEXTURE%(t0)s EXPAND_NORMAL_NV RGB |
90 |
CI0 RGB B TEXTURE%(t1)s EXPAND_NORMAL_NV RGB |
CI0 RGB B TEXTURE%(t1)s EXPAND_NORMAL_NV RGB |
91 |
CO0 RGB SPARE0_NV DISCARD_NV DISCARD_NV NONE NONE TRUE FALSE FALSE |
CO0 RGB SPARE0_NV DISCARD_NV DISCARD_NV %(bandscale)s NONE TRUE FALSE FALSE |
92 |
|
|
93 |
# SPARE1 <- SPARE0 * SPARE0 * 2 |
# SPARE1 <- SPARE0 * SPARE0 |
94 |
# SPARE0 <- (TEX0 . CONST0) * 2 |
# SPARE0 <- (TEX0 . CONST0) |
95 |
CI1 RGB A SPARE0_NV SIGNED_IDENTITY_NV RGB |
CI1 RGB A SPARE0_NV SIGNED_IDENTITY_NV RGB |
96 |
CI1 RGB B SPARE0_NV SIGNED_IDENTITY_NV RGB |
CI1 RGB B SPARE0_NV SIGNED_IDENTITY_NV RGB |
97 |
CI1 RGB C TEXTURE%(t0)s EXPAND_NORMAL_NV RGB |
CI1 RGB C TEXTURE%(t0)s EXPAND_NORMAL_NV RGB |
111 |
FCI G %(finalG)s UNSIGNED_INVERT_NV BLUE |
FCI G %(finalG)s UNSIGNED_INVERT_NV BLUE |
112 |
""") |
""") |
113 |
elif type == 1: |
elif type == 1: |
114 |
scale = nvcode.combinerscale(avg(*texscales) * 8.0 * rndscale1) |
scale = nvcode.combinerscale(avg(*texscales) * 8.0 * rndscale) |
115 |
alphascale = nvcode.combinerscale(1.0) |
alphascale = nvcode.combinerscale(exp(.3 * abs(rnd.nextGaussian()))) |
116 |
|
|
117 |
# Interpolate between three colors: |
# Interpolate between three colors: |
118 |
# d0 = t0 . r0 |
# d0 = t0 . r0 |
159 |
FCI G %(finalG)s ALPHA |
FCI G %(finalG)s ALPHA |
160 |
""") |
""") |
161 |
else: |
else: |
162 |
scale = nvcode.combinerscale(avg(*texscales) * 4.0 * rndscale1) |
scale = nvcode.combinerscale(avg(*texscales) * 4.0 * rndscale) |
163 |
|
|
164 |
# Interpolate on the fraction line c0,c1,c2: |
# Interpolate on the fraction line c0,c1,c2: |
165 |
# d0 = t0 . t1 |
# d0 = t0 . t1 |