gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz/gfx/libpaper papermill.py texcoords.py texo...


From: Janne V. Kujala
Subject: [Gzz-commits] gzz/gfx/libpaper papermill.py texcoords.py texo...
Date: Wed, 16 Oct 2002 05:14:36 -0400

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

Modified files:
        gfx/libpaper   : papermill.py texcoords.py texops_NV2X.py 
                         texops_STD.py 

Log message:
        Better repeat unit size scaling

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/papermill.py.diff?tr1=1.52&tr2=1.53&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/texcoords.py.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/texops_NV2X.py.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/texops_STD.py.diff?tr1=1.6&tr2=1.7&r1=text&r2=text

Patches:
Index: gzz/gfx/libpaper/papermill.py
diff -c gzz/gfx/libpaper/papermill.py:1.52 gzz/gfx/libpaper/papermill.py:1.53
*** gzz/gfx/libpaper/papermill.py:1.52  Tue Oct 15 10:37:30 2002
--- gzz/gfx/libpaper/papermill.py       Wed Oct 16 05:14:10 2002
***************
*** 27,36 ****
      # XXX Should check separately for texture_shader2,
      # otherwise it'll be SLOW.
      if dbg: print "Using NV20 texture shaders"
!     from gfx.libpaper.texops_NV2X import makeNormalShaderPass
  else:
      if dbg: print "Using unextended OpenGL texture accesses"
!     from gfx.libpaper.texops_STD import makeNormalShaderPass
  
  
  # Check which combiners to use.
--- 27,36 ----
      # XXX Should check separately for texture_shader2,
      # otherwise it'll be SLOW.
      if dbg: print "Using NV20 texture shaders"
!     from gfx.libpaper.texops_NV2X import makeNormalShaderPass, scaleFactor
  else:
      if dbg: print "Using unextended OpenGL texture accesses"
!     from gfx.libpaper.texops_STD import makeNormalShaderPass, scaleFactor
  
  
  # Check which combiners to use.
***************
*** 114,120 ****
          # (and then the textures, too, would be protected from gc)
          colors = Colors(rng.nextInt())
          textures = Textures(rng.nextInt())
!         rootrep = TexGenXYRepeatUnit(rng)
  
          pap.setNPasses(len(passes))
          
--- 114,120 ----
          # (and then the textures, too, would be protected from gc)
          colors = Colors(rng.nextInt())
          textures = Textures(rng.nextInt())
!         rootrep = TexGenXYRepeatUnit(rng, scale = 0.3 * scaleFactor)
  
          pap.setNPasses(len(passes))
          
Index: gzz/gfx/libpaper/texcoords.py
diff -c gzz/gfx/libpaper/texcoords.py:1.14 gzz/gfx/libpaper/texcoords.py:1.15
*** gzz/gfx/libpaper/texcoords.py:1.14  Thu Oct 10 09:36:45 2002
--- gzz/gfx/libpaper/texcoords.py       Wed Oct 16 05:14:10 2002
***************
*** 62,70 ****
      """
      def __init__(self, rnd=None, 
            vecs = None,
            angle_stddev = .065,
-           avg_length_mean = .3,
-           avg_length_stddev = .06,
            lendiff_mean = 0,
            lendiff_stddev = .1):
  
--- 62,70 ----
      """
      def __init__(self, rnd=None, 
            vecs = None,
+           scale = .3,
+           scale_log_stddev = 0.4,
            angle_stddev = .065,
            lendiff_mean = 0,
            lendiff_stddev = .1):
  
***************
*** 76,97 ****
        angle = (.25 + angle_stddev*rnd.nextGaussian()) * 2 * math.pi
        angle *= 1 - 2 * rnd.nextBoolean()
  
- 
        # The angle of the first basis vector
        as = rnd.nextDouble() * 2 * math.pi
        # And the angle of the second basis vector
        at = as + angle
  
! 
!       # The (geometric) average of the basis vector lengths
!       r = avg_length_mean + avg_length_stddev*rnd.nextGaussian()
  
        # The difference between basis vector lengths
        m = lendiff_mean + lendiff_stddev * rnd.nextGaussian()
  
        # The basis vector lengths
!       rs = r * math.exp(m)
!       rt = r * math.exp(-m)
  
        # The vectors that give x and y when dotted with (s, t, 0, 1)
        self.vecs = [[ rs * math.cos(as), rt * math.cos(at)],
--- 76,95 ----
        angle = (.25 + angle_stddev*rnd.nextGaussian()) * 2 * math.pi
        angle *= 1 - 2 * rnd.nextBoolean()
  
        # The angle of the first basis vector
        as = rnd.nextDouble() * 2 * math.pi
        # And the angle of the second basis vector
        at = as + angle
  
!       # Logarightm of the random scale factor
!         m0 = scale_log_stddev * rnd.nextGaussian()
  
        # The difference between basis vector lengths
        m = lendiff_mean + lendiff_stddev * rnd.nextGaussian()
  
        # The basis vector lengths
!       rs = scale * math.exp(m0 + m)
!       rt = scale * math.exp(m0 - m)
  
        # The vectors that give x and y when dotted with (s, t, 0, 1)
        self.vecs = [[ rs * math.cos(as), rt * math.cos(at)],
Index: gzz/gfx/libpaper/texops_NV2X.py
diff -c gzz/gfx/libpaper/texops_NV2X.py:1.7 gzz/gfx/libpaper/texops_NV2X.py:1.8
*** gzz/gfx/libpaper/texops_NV2X.py:1.7 Wed Oct 16 04:41:27 2002
--- gzz/gfx/libpaper/texops_NV2X.py     Wed Oct 16 05:14:10 2002
***************
*** 170,172 ****
--- 170,174 ----
  
  def makeNormalShaderPass(maxaniso = None):
      return ShaderPass(shaderTypes[5], maxaniso)
+ 
+ scaleFactor = 2.0
Index: gzz/gfx/libpaper/texops_STD.py
diff -c gzz/gfx/libpaper/texops_STD.py:1.6 gzz/gfx/libpaper/texops_STD.py:1.7
*** gzz/gfx/libpaper/texops_STD.py:1.6  Tue Oct 15 09:52:04 2002
--- gzz/gfx/libpaper/texops_STD.py      Wed Oct 16 05:14:10 2002
***************
*** 57,59 ****
--- 57,61 ----
  
  def makeNormalShaderPass(maxaniso = None):
      return ShaderPass(shaderTypes[0], maxaniso)
+ 
+ scaleFactor = 1.0




reply via email to

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