/[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.6 by tjl, Tue Sep 3 21:15:32 2002 UTC revision 1.7 by jvk, Thu Sep 5 12:34:25 2002 UTC
# Line 83  class TransparentCombinerPass: Line 83  class TransparentCombinerPass:
83                  FCI G SPARE0_NV UNSIGNED_INVERT_NV ALPHA                  FCI G SPARE0_NV UNSIGNED_INVERT_NV ALPHA
84    
85              """)              """)
86          else:          elif 1:
87              # Band-like texture.              # Band-like texture.
88              #              #
89              # A little different from what Tjl and Jvk originally              # A little different from what Tjl and Jvk originally
90              # planned, where the EF product would have been used;              # planned, where the EF product would have been used;
91              # Sadly, we forgot that E and F are not signed(!).              # Sadly, we forgot that E and F are not signed(!).
92    
93                # Make outside of the bands transparent if trans > 0
94                if trans > 0:
95                    finalG = "SPARE1_NV"
96                else:
97                    finalG = "ZERO"
98    
99              # Stage 0: multiply the two textures              # Stage 0: multiply the two textures
100              c = ("""              c = ("""
101                  CI0 RGB A TEXTURE%(t0)s EXPAND_NORMAL_NV RGB                  CI0 RGB A TEXTURE%(t0)s EXPAND_NORMAL_NV RGB
# Line 100  class TransparentCombinerPass: Line 106  class TransparentCombinerPass:
106                  CI1 RGB B SPARE0_NV SIGNED_IDENTITY_NV RGB                  CI1 RGB B SPARE0_NV SIGNED_IDENTITY_NV RGB
107                  CI1 RGB C TEXTURE%(t0)s EXPAND_NORMAL_NV RGB                  CI1 RGB C TEXTURE%(t0)s EXPAND_NORMAL_NV RGB
108                  CI1 RGB D CONSTANT_COLOR0_NV EXPAND_NORMAL_NV RGB                  CI1 RGB D CONSTANT_COLOR0_NV EXPAND_NORMAL_NV RGB
109                  CO1 RGB SPARE1_NV SPARE0_NV DISCARD_NV SCALE_BY_FOUR_NV NONE FALSE TRUE FALSE                  CO1 RGB SPARE1_NV SPARE0_NV DISCARD_NV SCALE_BY_TWO_NV NONE FALSE TRUE FALSE
110    
111                  FCI E SPARE1_NV UNSIGNED_INVERT_NV RGB                  FCI E SPARE1_NV UNSIGNED_INVERT_NV RGB
112                  FCI F SPARE0_NV UNSIGNED_IDENTITY_NV RGB                  FCI F SPARE0_NV UNSIGNED_IDENTITY_NV RGB
# Line 110  class TransparentCombinerPass: Line 116  class TransparentCombinerPass:
116                  FCI C SECONDARY_COLOR_NV UNSIGNED_IDENTITY_NV RGB                  FCI C SECONDARY_COLOR_NV UNSIGNED_IDENTITY_NV RGB
117                  FCI D ZERO UNSIGNED_IDENTITY_NV RGB                  FCI D ZERO UNSIGNED_IDENTITY_NV RGB
118    
119                  FCI G ZERO UNSIGNED_INVERT_NV ALPHA                  FCI G %(finalG)s UNSIGNED_INVERT_NV BLUE
120              """)              """)
121              foo = ("""          else:
122                # Interpolate between three colors:
123                # d0 = t0 . r0
124                # d1 = r1 . r1
125                # lerp(d1, lerp(d0, c0, c1), c2)
126                c = ("""
127                    CI0 RGB A TEXTURE%(t0)s EXPAND_NORMAL_NV RGB
128                    CI0 RGB B CONSTANT_COLOR0_NV EXPAND_NORMAL_NV RGB
129                    CI0 RGB C TEXTURE%(t1)s EXPAND_NORMAL_NV RGB
130                    CI0 RGB D CONSTANT_COLOR1_NV EXPAND_NORMAL_NV RGB
131                    CO0 RGB SPARE0_NV SPARE1_NV DISCARD_NV NONE NONE TRUE TRUE FALSE
132    
133                    CI1 RGB A PRIMARY_COLOR_NV UNSIGNED_IDENTITY_NV RGB
134                    CI1 RGB B SPARE0_NV UNSIGNED_IDENTITY_NV RGB
135                    CI1 RGB C SECONDARY_COLOR_NV UNSIGNED_IDENTITY_NV RGB
136                    CI1 RGB D SPARE0_NV UNSIGNED_INVERT_NV RGB
137                    CO1 RGB DISCARD_NV DISCARD_NV PRIMARY_COLOR_NV NONE NONE FALSE FALSE FALSE
138    
139                    FCI A SPARE1_NV UNSIGNED_IDENTITY_NV RGB
140                    FCI B PRIMARY_COLOR_NV UNSIGNED_IDENTITY_NV RGB
141                    FCI C FOG UNSIGNED_IDENTITY_NV RGB
142                    FCI D ZERO UNSIGNED_IDENTITY_NV RGB
143    
144                    FCI G ZERO UNSIGNED_INVERT_NV ALPHA
145              """)              """)
146                
147                
148          c = (constantcode + c) % locals()          c = (constantcode + c) % locals()
149          c = (c.replace("CI0", "CombinerInputNV COMBINER0_NV").          c = (c.replace("CI0", "CombinerInputNV COMBINER0_NV").
150                  replace("CI1", "CombinerInputNV COMBINER1_NV").                  replace("CI1", "CombinerInputNV COMBINER1_NV").

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

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