gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz/gfx/libpaper texcomb_NV1X.py


From: Janne V. Kujala
Subject: [Gzz-commits] gzz/gfx/libpaper texcomb_NV1X.py
Date: Thu, 10 Oct 2002 10:14:38 -0400

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Janne V. Kujala <address@hidden>        02/10/10 10:14:37

Modified files:
        gfx/libpaper   : texcomb_NV1X.py 

Log message:
        Add random factor to nv combiner scales

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/texcomb_NV1X.py.diff?tr1=1.17&tr2=1.18&r1=text&r2=text

Patches:
Index: gzz/gfx/libpaper/texcomb_NV1X.py
diff -c gzz/gfx/libpaper/texcomb_NV1X.py:1.17 
gzz/gfx/libpaper/texcomb_NV1X.py:1.18
*** gzz/gfx/libpaper/texcomb_NV1X.py:1.17       Wed Oct  9 10:07:27 2002
--- gzz/gfx/libpaper/texcomb_NV1X.py    Thu Oct 10 10:14:37 2002
***************
*** 4,9 ****
--- 4,11 ----
  from gfx.libutil import nvcode
  
  from gfx.libcolor.spaces import RGBtoLAB
+ 
+ from math import exp
      
  class TransparentCombinerPass:
      def setupCode(self, texinputs, texscales, colors, rnd, trans = 0):
***************
*** 51,56 ****
--- 53,62 ----
          type = rnd.nextInt(3)
          # types: 0=BAND-LIKE, 1=3-COL-LERP, 2=FRACTION-LINE
  
+         # Random scaling of (dot) products
+         rndscale1 = exp(.3*rnd.nextGaussian())
+         rndscale2 = exp(.3*rnd.nextGaussian())
+ 
          def avg(*args):
              sum = 0
              for arg in args: sum += arg
***************
*** 58,64 ****
          
        # Then, select the combiner path type.
        if type == 0:
!             scale = nvcode.combinerscale(avg(*texscales) * 8.0)
  
            # Band-like texture.
            #
--- 64,70 ----
          
        # Then, select the combiner path type.
        if type == 0:
!             scale = nvcode.combinerscale(avg(*texscales) * 8.0 * rndscale1)
  
            # Band-like texture.
            #
***************
*** 101,107 ****
                FCI G %(finalG)s UNSIGNED_INVERT_NV BLUE
            """)
          elif type == 1:
!             scale = nvcode.combinerscale(avg(*texscales) * 8.0)
              alphascale = nvcode.combinerscale(1.0)
              
              # Interpolate between three colors:
--- 107,113 ----
                FCI G %(finalG)s UNSIGNED_INVERT_NV BLUE
            """)
          elif type == 1:
!             scale = nvcode.combinerscale(avg(*texscales) * 8.0 * rndscale1)
              alphascale = nvcode.combinerscale(1.0)
              
              # Interpolate between three colors:
***************
*** 149,155 ****
                FCI G %(finalG)s ALPHA
            """)
          else:
!             scale = nvcode.combinerscale(avg(*texscales) * 4.0)
  
              # Interpolate on the fraction line c0,c1,c2:
              # d0 = t0 . t1
--- 155,161 ----
                FCI G %(finalG)s ALPHA
            """)
          else:
!             scale = nvcode.combinerscale(avg(*texscales) * 4.0 * rndscale1)
  
              # Interpolate on the fraction line c0,c1,c2:
              # d0 = t0 . t1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]