/[gzz]/gzz/gfx/demo/texturelab.py
ViewVC logotype

Diff of /gzz/gfx/demo/texturelab.py

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

revision 1.3 by tjl, Fri Aug 30 10:33:30 2002 UTC revision 1.4 by jvk, Fri Aug 30 11:14:28 2002 UTC
# Line 13  def js(list): Line 13  def js(list):
13    
14  class ShaderScene:  class ShaderScene:
15      def __init__(self):      def __init__(self):
16          self.resolution = [32, 64]          self.resolution = [64, 64]
17          self.shadername = "noise"          self.shadername = "filereader"
18          self.shaderparams = {          self.shaderparams = {
19              "bulgemagz": 0.5,              "bulgemagz": 0.5,
20              "bulgemagx": 0,              "bulgemagx": 0,
21              "lfreq": 2,              "lfreq": 2,
22              "hfreq": 10,              "hfreq": 10,
23              "bias": 0.1,              "bias": -3,
24                "scale": 10,
25                "file": "lava/gfx/map3d.dat"
26          }          }
27          self.colors = [ (1, 1, 1), (1, 0, 0), (0, 1, 0), (0, 0, 1)]          self.colors = [ (1, 1, 1), (1, 0, 0), (0, 1, 0), (0, 0, 1)]
28          self.shadercomps = 3          self.shadercomps = 3
# Line 31  class ShaderScene: Line 33  class ShaderScene:
33          self.shade()          self.shade()
34      def key(self, k):      def key(self, k):
35          if k == "s":          if k == "s":
36              self.shade()              retexture()
37                self.shade()
38              AbstractUpdateManager.setNoAnimation()              AbstractUpdateManager.setNoAnimation()
39          if k == "c":          if k == "c":
40              rotate(self.colors)              rotate(self.colors)
# Line 82  class ShaderScene: Line 85  class ShaderScene:
85              getDList("""              getDList("""
86                  Color %(color)s                  Color %(color)s
87                  BindTexture TEXTURE_3D %(tex)s                  BindTexture TEXTURE_3D %(tex)s
88                    TexParameter TEXTURE_3D TEXTURE_MAG_FILTER LINEAR
89                  Enable TEXTURE_3D                  Enable TEXTURE_3D
90                  Begin QUAD_STRIP                  Begin QUAD_STRIP
91                      TexCoord 1.1 1.1 0                      TexCoord 1.1 1.1 0
# Line 97  class ShaderScene: Line 101  class ShaderScene:
101                  "tex" : self.texture.getTexId(),                  "tex" : self.texture.getTexId(),
102                  "color" : js(self.colors[0]),                  "color" : js(self.colors[0]),
103                  }),                  }),
104              "v", 10, 0, 0, 200, 200)              "v", 10, 0, 0, 900, 900)
105    
106          putnoc(vs, getDList("""          putnoc(vs, getDList("""
107              PopAttrib              PopAttrib

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

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