gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz/gfx demo/psyko2.py libpaper/papermill.py li...


From: Janne V. Kujala
Subject: [Gzz-commits] gzz/gfx demo/psyko2.py libpaper/papermill.py li...
Date: Wed, 16 Oct 2002 10:50:36 -0400

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

Modified files:
        gfx/demo       : psyko2.py 
        gfx/libpaper   : papermill.py texops_NV2X.py textures.py 

Log message:
        Adjust textures

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/demo/psyko2.py.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/papermill.py.diff?tr1=1.53&tr2=1.54&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/texops_NV2X.py.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libpaper/textures.py.diff?tr1=1.32&tr2=1.33&r1=text&r2=text

Patches:
Index: gzz/gfx/demo/psyko2.py
diff -c gzz/gfx/demo/psyko2.py:1.14 gzz/gfx/demo/psyko2.py:1.15
*** gzz/gfx/demo/psyko2.py:1.14 Tue Oct  8 11:12:29 2002
--- gzz/gfx/demo/psyko2.py      Wed Oct 16 10:50:11 2002
***************
*** 68,81 ****
  execfile("gfx/demo/zipf.py")
  
  
! probs = getZipfDistribution(numtex_old)
  
  learninglist = (
      reduce(lambda x,y: x+y,
             [ [ tex_old[i] for foo in range(0, int(round(probs[i] * 
numtex_new))) ]
               for i in range(0,numtex_old)] )
      )
! learninglist = learninglist[0:showtex_old]
  
  onlinelist = (
      reduce(lambda x,y: x+y,
--- 68,85 ----
  execfile("gfx/demo/zipf.py")
  
  
! probs = getZipfDistribution(numtex_old+2)[2:]
! m = reduce(lambda x,y: x+y, probs)
! probs = [ p/m for p in probs ]
  
  learninglist = (
      reduce(lambda x,y: x+y,
             [ [ tex_old[i] for foo in range(0, int(round(probs[i] * 
numtex_new))) ]
               for i in range(0,numtex_old)] )
      )
! 
! #learninglist = learninglist[0:showtex_old]
! #print [ int(round(probs[i] * numtex_new)) for i in range(0,numtex_old)]
  
  onlinelist = (
      reduce(lambda x,y: x+y,
***************
*** 119,124 ****
--- 123,136 ----
      pap = ThePaperMill().getPaper(seed)
      return GLRen.createPaperQuad(pap, -1, -1, 1, 1, 0)
  
+     rnd = java.util.Random(seed)
+     #basis = "0123456789ABCDEF"
+     basis = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
+     n = int(32 / (Math.log(len(basis)) / Math.log(2)))+1
+     str = "".join([ basis[rnd.nextInt(len(basis))] for i in range(0,n) ])
+     return getText(str)
+     
+ 
  next_toid = 1
  
  # Request scene.timeout to be called after 'delay' ms
***************
*** 184,189 ****
--- 196,202 ----
      def scene(self, vs):
        putnoc(vs, background(self.bgcolor))
  
+         putnoc(vs, getDListNocoords("Color 0 0 0"))
        cs1 = vs.coords.affineCoordsys(0, 10, 800, 600, 800, 0, 0, 600)
          vs.matcher.add(cs1, "1")
        scale = zoom[0] / paperzoom[0]
***************
*** 298,303 ****
--- 311,317 ----
      def scene(self, vs):
        putnoc(vs, background(self.bgcolor))
  
+         putnoc(vs, getDListNocoords("Color 0 0 0"))
        cs1 = vs.coords.affineCoordsys(0, 10, 800, 600, 800, 0, 0, 600)
          vs.matcher.add(cs1, "1")
        scale = zoom[0] / paperzoom[0]
***************
*** 309,314 ****
--- 323,332 ----
        vs.map.put(self.pq, cs1, cs2)
  
          seen[self.seed] = "trial" + str(self.trial)
+ 
+         cs3 = vs.coords.affineCoordsys(0, 10, 0, 60, 60, 0, 0, 60)
+         vs.matcher.add(cs1, "3")
+         putText(vs, cs3, "%s / %s" % ( self.trial, len(self.list) ), 
color=(0,0,0))
  
          if self.state == 1:
              if self.answer == self.correct:
Index: gzz/gfx/libpaper/papermill.py
diff -c gzz/gfx/libpaper/papermill.py:1.53 gzz/gfx/libpaper/papermill.py:1.54
*** gzz/gfx/libpaper/papermill.py:1.53  Wed Oct 16 05:14:10 2002
--- gzz/gfx/libpaper/papermill.py       Wed Oct 16 10:50:11 2002
***************
*** 28,37 ****
      # 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.
  if GL.hasExtension("GL_NV_register_combiners"):
--- 28,38 ----
      # otherwise it'll be SLOW.
      if dbg: print "Using NV20 texture shaders"
      from gfx.libpaper.texops_NV2X import makeNormalShaderPass, scaleFactor
+     numpasses = 2
  else:
      if dbg: print "Using unextended OpenGL texture accesses"
      from gfx.libpaper.texops_STD import makeNormalShaderPass, scaleFactor
!     numpasses = 3
  
  # Check which combiners to use.
  if GL.hasExtension("GL_NV_register_combiners"):
***************
*** 103,109 ****
                     { "trans" : .5, "emboss" : 0 },
                     { "trans" : .9375, "emboss" : 0 },
                     #{ "trans" : 0, "emboss" : 1 },
!                    ]
  
          rng = java.util.Random(pap.reg.get(regseed, "seed", seed))
          for foo in range(0,20): # eat bad beginning (Java's bad PRNG)
--- 104,110 ----
                     { "trans" : .5, "emboss" : 0 },
                     { "trans" : .9375, "emboss" : 0 },
                     #{ "trans" : 0, "emboss" : 1 },
!                    ][0:numpasses]
  
          rng = java.util.Random(pap.reg.get(regseed, "seed", seed))
          for foo in range(0,20): # eat bad beginning (Java's bad PRNG)
Index: gzz/gfx/libpaper/texops_NV2X.py
diff -c gzz/gfx/libpaper/texops_NV2X.py:1.8 gzz/gfx/libpaper/texops_NV2X.py:1.9
*** gzz/gfx/libpaper/texops_NV2X.py:1.8 Wed Oct 16 05:14:10 2002
--- gzz/gfx/libpaper/texops_NV2X.py     Wed Oct 16 10:50:11 2002
***************
*** 171,174 ****
  def makeNormalShaderPass(maxaniso = None):
      return ShaderPass(shaderTypes[5], maxaniso)
  
! scaleFactor = 2.0
--- 171,174 ----
  def makeNormalShaderPass(maxaniso = None):
      return ShaderPass(shaderTypes[5], maxaniso)
  
! scaleFactor = 1.5
Index: gzz/gfx/libpaper/textures.py
diff -c gzz/gfx/libpaper/textures.py:1.32 gzz/gfx/libpaper/textures.py:1.33
*** gzz/gfx/libpaper/textures.py:1.32   Wed Oct 16 06:06:52 2002
--- gzz/gfx/libpaper/textures.py        Wed Oct 16 10:50:11 2002
***************
*** 61,72 ****
          "rgbw3",
          "turb",
          "pyramid",
!         "checkerboard",
          "cone",
!         #"checkerboard2",
          "saw",
          "triangle",
          "stripe",
          ], [
          {"name" : "rgbw1",
           "args" : [tres, tres, 0, 3, "RGB", "RGB", "fnoise",
--- 61,78 ----
          "rgbw3",
          "turb",
          "pyramid",
!         ##"checkerboard",
          "cone",
!         ##"checkerboard2",
          "saw",
          "triangle",
+         "rnd0",
+         "rnd1",
+         "rnd2",
          "stripe",
+         "rnd0n",
+         "rnd1n",
+         "rnd2n",
          ], [
          {"name" : "rgbw1",
           "args" : [tres, tres, 0, 3, "RGB", "RGB", "fnoise",
***************
*** 152,158 ****
           "minfilter" : "NEAREST",
           "magfilter" : "NEAREST",
           },
!         ]))
  
      ptextures["DOT2"] = map(NamedTexture, [ 
          { "name" : "dotprodn",
--- 158,212 ----
           "minfilter" : "NEAREST",
           "magfilter" : "NEAREST",
           },
! 
!         {"name" : "rnd0",
!          "args" : [2, 2, 0, 3, "RGB", "RGB", "geometric", ["type", "7", 
"seed", "10"]],
!          "continuous" : 0,
!          "scale" : 1./2,
!          "featurescale" : 1./2,
!          },
! 
!         {"name" : "rnd1",
!          "args" : [2, 4, 0, 3, "RGB", "RGB", "geometric", ["type", "7", 
"seed", "11"]],
!          "continuous" : 0,
!          "scale" : 1./4,
!          "featurescale" : 1./4,
!          },
! 
!         {"name" : "rnd2",
!          "args" : [4, 4, 0, 3, "RGB", "RGB", "geometric", ["type", "7", 
"seed", "12"]],
!          "continuous" : 0,
!          "scale" : 1./4,
!          "featurescale" : 1./4,
!          },
! 
!         {"name" : "rnd0n",
!          "args" : [2, 2, 0, 3, "RGB", "RGB", "geometric", ["type", "7", 
"seed", "10"]],
!          "continuous" : 0,
!          "scale" : 1./2,
!          "featurescale" : 1./2,
!          "minfilter" : "NEAREST",
!          "magfilter" : "NEAREST",
!          },
! 
!         {"name" : "rnd1n",
!          "args" : [2, 4, 0, 3, "RGB", "RGB", "geometric", ["type", "7", 
"seed", "11"]],
!          "continuous" : 0,
!          "scale" : 1./4,
!          "featurescale" : 1./4,
!          "minfilter" : "NEAREST",
!          "magfilter" : "NEAREST",
!          },
! 
!         {"name" : "rnd2n",
!          "args" : [4, 4, 0, 3, "RGB", "RGB", "geometric", ["type", "7", 
"seed", "12"]],
!          "continuous" : 0,
!          "scale" : 1./4,
!          "featurescale" : 1./4,
!          "minfilter" : "NEAREST",
!          "magfilter" : "NEAREST",
!          },
! ]))
  
      ptextures["DOT2"] = map(NamedTexture, [ 
          { "name" : "dotprodn",
***************
*** 213,219 ****
            },
          { "name" : "dsdt_checkerboard",
            "args" : [4, 4, 0, 2, "SIGNED_HILO_NV", "HILO_NV", "geometric",
!                     ["type", "1"]],
            "minfilter" : "NEAREST",
            "magfilter" : "NEAREST",
            },
--- 267,273 ----
            },
          { "name" : "dsdt_checkerboard",
            "args" : [4, 4, 0, 2, "SIGNED_HILO_NV", "HILO_NV", "geometric",
!                     ["type", "1", "scale", ".5"]],
            "minfilter" : "NEAREST",
            "magfilter" : "NEAREST",
            },
***************
*** 237,259 ****
            },
          { "name" : "dsdt_rnd0",
            "args" : [2, 2, 0, 2, "SIGNED_HILO_NV", "HILO_NV", "geometric",
!                     ["type", "7"]],
            },
          { "name" : "dsdt_rnd1",
            "args" : [4, 4, 0, 2, "SIGNED_HILO_NV", "HILO_NV", "geometric",
!                     ["type", "7"]],
            },
          { "name" : "dsdt_rnd2",
            "args" : [8, 8, 0, 2, "SIGNED_HILO_NV", "HILO_NV", "geometric",
!                     ["type", "7"]],
            },
          { "name" : "dsdt_rnd3",
            "args" : [16, 16, 0, 2, "SIGNED_HILO_NV", "HILO_NV", "geometric",
!                     ["type", "7"]],
            },
          { "name" : "dsdt_rnd4",
            "args" : [32, 32, 0, 2, "SIGNED_HILO_NV", "HILO_NV", "geometric",
!                     ["type", "7"]],
            },
          ]))
  
--- 291,313 ----
            },
          { "name" : "dsdt_rnd0",
            "args" : [2, 2, 0, 2, "SIGNED_HILO_NV", "HILO_NV", "geometric",
!                     ["type", "7", "scale", "1", "seed", "100"]],
            },
          { "name" : "dsdt_rnd1",
            "args" : [4, 4, 0, 2, "SIGNED_HILO_NV", "HILO_NV", "geometric",
!                     ["type", "7", "scale", ".5", "seed", "101"]],
            },
          { "name" : "dsdt_rnd2",
            "args" : [8, 8, 0, 2, "SIGNED_HILO_NV", "HILO_NV", "geometric",
!                     ["type", "7", "scale", ".3", "seed", "102"]],
            },
          { "name" : "dsdt_rnd3",
            "args" : [16, 16, 0, 2, "SIGNED_HILO_NV", "HILO_NV", "geometric",
!                     ["type", "7", "scale", ".2", "seed", "103"]],
            },
          { "name" : "dsdt_rnd4",
            "args" : [32, 32, 0, 2, "SIGNED_HILO_NV", "HILO_NV", "geometric",
!                     ["type", "7", "scale", ".1", "seed", "104"]],
            },
          ]))
  




reply via email to

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