/[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.11 by tjl, Thu Sep 5 11:54:50 2002 UTC revision 1.12 by tjl, Fri Sep 6 11:04:58 2002 UTC
# Line 14  lpars = [ Line 14  lpars = [
14      "shadowlen", "0.9",      "shadowlen", "0.9",
15      "lx", "-0.5",      "lx", "-0.5",
16      "ly", "0.4",      "ly", "0.4",
17      "npredger", "0.1",      "npredger", "0.06",
18      "noisefreqangle", "10",      "noisefreqangle", "10",
19      "noisefreqr", "20",      "noisefreqr", "20",
20      "noisescale", ".5",      "noisescale", ".4",
21      "xnoisescale", ".7",      "xnoisescale", ".3",
22  ]  ]
23    
24  AbstractUpdateManager.defaultAnimationTime = 10000  AbstractUpdateManager.defaultAnimationTime = 30000
25    
26  scal = 1024  scal = 1024
27  t = {  t = {
# Line 42  if not locals().has_key("shaded"): Line 42  if not locals().has_key("shaded"):
42      shaded = { }      shaded = { }
43    
44  def shadedquad(tex):  def shadedquad(tex):
45        t1 = "1.0"
46        t0 = "0"
47      return getDList("""      return getDList("""
48                  BindTexture TEXTURE_2D %(tex)s                  BindTexture TEXTURE_2D %(tex)s
49                  TexParameter TEXTURE_2D TEXTURE_MAG_FILTER LINEAR                  TexParameter TEXTURE_2D TEXTURE_MAG_FILTER LINEAR
50                  TexParameter TEXTURE_2D TEXTURE_MIN_FILTER LINEAR_MIPMAP_LINEAR                  TexParameter TEXTURE_2D TEXTURE_MIN_FILTER LINEAR_MIPMAP_LINEAR
51                  Enable TEXTURE_2D                  Enable TEXTURE_2D
52                  Begin QUAD_STRIP                  Begin QUAD_STRIP
53                      TexCoord 1.1 1.1 0                      TexCoord %(t1)s %(t1)s 0
54                      Vertex 1 -1 1                      Vertex 1 -1 1
55                      TexCoord 1.1 -0.1 0                      TexCoord %(t1)s %(t0)s 0
56                      Vertex 1 1 1                      Vertex 1 1 1
57                      TexCoord -0.1 1.1 5                      TexCoord %(t0)s %(t1)s 5
58                      Vertex -1 -1 1                      Vertex -1 -1 1
59                      TexCoord -0.1 -0.1 5                      TexCoord %(t0)s %(t0)s 5
60                      Vertex -1 1 1                      Vertex -1 1 1
61                  End                  End
62              """ % {              """ % {
63                  "tex" : tex.getTexId(),                  "tex" : tex.getTexId(),
64                    "t0": t0,
65                    "t1": t1
66                  })                  })
67    
68  class ShaderScene:  class ShaderScene:
# Line 84  class ShaderScene: Line 88  class ShaderScene:
88    
89      def scene(self, vs):      def scene(self, vs):
90    
91          putnoc(vs, background((0.5,0.5,0.5)))          putnoc(vs, background((0,0.5,0)))
92    
93          putnoc(vs, getDList("""          putnoc(vs, getDList("""
94              PushAttrib POLYGON_BIT ENABLE_BIT              PushAttrib POLYGON_BIT ENABLE_BIT
# Line 93  class ShaderScene: Line 97  class ShaderScene:
97              Enable BLEND              Enable BLEND
98              BlendFunc SRC_ALPHA ONE_MINUS_SRC_ALPHA              BlendFunc SRC_ALPHA ONE_MINUS_SRC_ALPHA
99              Disable TEXTURE_3D              Disable TEXTURE_3D
100              Color 0 1 0 1              Color 0.7 0 0.7 1
101          """))          """))
102          s0 = self.s0[0]          s0 = self.s0[0]
103          s1 = 1100 - s0          s1 = 1100 - s0
# Line 107  class ShaderScene: Line 111  class ShaderScene:
111    
112    
113          putnoc(vs, getDList("""          putnoc(vs, getDList("""
114              Color 0.6 0.0 0.05 1              Color 0.3 0.2 0.05 1
115          """))          """))
116          vs.put(samb, "3", 10, s0, s0, s1, s1);          vs.put(samb, "3", 10, s0, s0, s1, s1);
117    
118          putnoc(vs, getDList("""          putnoc(vs, getDList("""
119              Color 0.2 0.5 0.7 1              Color 0.1 0.8 0.1 1
120              BlendFunc ONE ONE_MINUS_SRC_ALPHA              BlendFunc ONE ONE_MINUS_SRC_ALPHA
121          """))          """))
122          vs.put(sdiff, "4", 10, s0, s0, s1,s1);          vs.put(sdiff, "4", 10, s0, s0, s1,s1);

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

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