150 |
""" |
""" |
151 |
|
|
152 |
if profile == "NV_PROG2": |
if profile == "NV_PROG2": |
153 |
# "Flood fill" implementation; NOT TESTED |
# "Flood fill" implementation |
154 |
|
|
155 |
code = """ |
code = """!!FP1.0 |
156 |
# f[TEX0].xyw texture coordinates |
# f[TEX0].xyw texture coordinates |
157 |
# f[TEX2].xy texture HI and LO component weights |
# f[TEX2].xy texture HI and LO component weights |
158 |
# f[TEX2].w displacement (added to the weighted texture value) |
# f[TEX2].w displacement (added to the weighted texture value) |
160 |
# Read texture |
# Read texture |
161 |
TXP R0, f[TEX0], TEX0, 2D; |
TXP R0, f[TEX0], TEX0, 2D; |
162 |
|
|
163 |
# Weight, add displacement, and use as output color |
# Weight and add displacement |
164 |
DP4 R0, R0, f[TEX2]; |
DP4 R0, R0, f[TEX2]; |
165 |
|
|
166 |
# R0 <- (R0 >= 1.0) |
# R0 <- (R0 >= 1.0) |
170 |
DDX R1.x, R0; |
DDX R1.x, R0; |
171 |
DDY R1.y, R0; |
DDY R1.y, R0; |
172 |
DP4 R1, R1.xyxy, R1.xyxy; |
DP4 R1, R1.xyxy, R1.xyxy; |
173 |
|
|
174 |
# R2 <- 2 grad(R1) . grad(R1) |
# R2 <- 2 grad(R1) . grad(R1) |
175 |
DDX R2.x, R1; |
DDX R2.x, R1; |
176 |
DDY R2.x, R1; |
DDY R2.y, R1; |
177 |
DP4 R2, R2.xyxy, R2.xyxy; |
DP4 R2, R2.xyxy, R2.xyxy; |
178 |
|
|
|
# Use R1 + R2 > 0 as the output color |
|
179 |
ADD R1, R1, R2; |
ADD R1, R1, R2; |
180 |
SGE o[COLR], R1, 0.0; |
|
181 |
|
# Use (R1 > 0) as the output color |
182 |
|
SGT o[COLR], R1, 0.0; |
183 |
|
|
184 |
|
END |
185 |
""" |
""" |
186 |
|
|
187 |
prog_outer = GL.createProgram(code) |
prog_outer = GL.createProgram(code) |