/[gzz]/gzz/gfx/libpaper/texcomb_NV1X.py
ViewVC logotype

Diff of /gzz/gfx/libpaper/texcomb_NV1X.py

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

revision 1.19 by jvk, Thu Oct 10 14:35:26 2002 UTC revision 1.20 by jvk, Thu Oct 10 15:07:14 2002 UTC
# Line 52  class TransparentCombinerPass: Line 52  class TransparentCombinerPass:
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
# Line 69  class TransparentCombinerPass: Line 67  class TransparentCombinerPass:
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              #              #
# Line 89  class TransparentCombinerPass: Line 88  class TransparentCombinerPass:
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
# Line 112  class TransparentCombinerPass: Line 111  class TransparentCombinerPass:
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
# Line 160  class TransparentCombinerPass: Line 159  class TransparentCombinerPass:
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

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

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