/[gzz]/gzz/gfx/demo/irregu3.py
ViewVC logotype

Diff of /gzz/gfx/demo/irregu3.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.45 by jvk, Tue Nov 5 13:23:40 2002 UTC revision 1.46 by jvk, Tue Nov 5 14:04:29 2002 UTC
# Line 150  def init(): Line 150  def init():
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)
# Line 160  def init(): Line 160  def init():
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)
# Line 170  def init(): Line 170  def init():
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)

Legend:
Removed from v.1.45  
changed lines
  Added in v.1.46

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26