/[gzz]/gzz/gfx/libpaper/papermill.py
ViewVC logotype

Diff of /gzz/gfx/libpaper/papermill.py

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

revision 1.55 by tjl, Wed Oct 23 13:45:37 2002 UTC revision 1.56 by tjl, Wed Oct 23 14:55:40 2002 UTC
# Line 146  class ThePaperMill(PaperMill): Line 146  class ThePaperMill(PaperMill):
146    
147          s = 256          s = 256
148          vs = w.createVobScene()          vs = w.createVobScene()
149          vs.map.put(SolidBgVob(java.awt.Color.black))          vs.map.put(SolidBgVob(java.awt.Color.red))
150    
151          cs1 = vs.coords.ortho(0, 0, 0, 0, s, s)          cs1 = vs.coords.ortho(0, 0, 0, 0, s, s)
152          cs2 = vs.coords.affineCoordsys(          cs2 = vs.coords.affineCoordsys(
153              0, 0, 0, 0,              0, 0, 0, 0,
154               v[0][0], v[0][1], v[1][0], v[1][1]               v[0][0], v[0][1], v[1][0], v[1][1]
155          )          )
156          vs.map.put(GLRen.createPaperQuad(pap, 0, 0, 1, 1, 1))          vs.map.put(GLRen.createPaperQuad(pap, 0, 0, 1, 1, 1),
157                cs1, cs2)
158          w.renderStill(vs, 1)          w.renderStill(vs, 1)
159    
160          tex = GL.createTexture()          tex = GL.createTexture()
161          tex.copyTexImage2D("FRONT", "TEXTURE_2D", 0,          texid = tex.getTexId()
162            GL.call("""
163                BindTexture TEXTURE_2D %(texid)s
164                TexParameter TEXTURE_2D TEXTURE_MAX_ANISOTROPY_EXT 2
165                TexParameter TEXTURE_2D  GENERATE_MIPMAP_SGIS TRUE
166                TexParameter TEXTURE_2D  TEXTURE_MIN_FILTER LINEAR_MIPMAP_LINEAR
167                TexParameter TEXTURE_2D  TEXTURE_MAG_FILTER LINEAR
168                BindTexture TEXTURE_2D 0
169            """ % locals())
170            print "READ: ", 0, vs.getSize().height-1-s, s, s
171            tex.copyTexImage2D(w.window, "FRONT", "TEXTURE_2D", 0,
172                          "RGB", 0, vs.getSize().height-1-s,                          "RGB", 0, vs.getSize().height-1-s,
173                              s, s, 0)                              s, s, 0)
174            
175          npap = PaperHanger()          npap = PaperHanger()
176          npap.setNPasses(1)          npap.setNPasses(1)
177          npap.cachedTexture = tex          npap.cachedTexture = tex
178    
179          ppass = npap.getPass(0)          ppass = npap.getPass(0)
180    
         texid = tex.getTexId()  
181    
182          ppass.setSetupcode("""          ppass.setSetupcode("""
183              PushAttrib ENABLE_BIT TEXTURE_BIT DEPTH_BUFFER_BIT              PushAttrib ENABLE_BIT TEXTURE_BIT DEPTH_BUFFER_BIT COLOR_BUFFER_BIT CURRENT_BIT
184              Disable BLEND              Disable BLEND
185                ActiveTexture TEXTURE1
186                Disable TEXTURE_2D
187                ActiveTexture TEXTURE0
188              Enable DEPTH_TEST              Enable DEPTH_TEST
189              DepthFunc LESS              DepthFunc LESS
190              BindTexture TEXTURE_2D %(texid)s              BindTexture TEXTURE_2D %(texid)s
191              TexEnv TEXTURE_ENV TEXTURE_ENV_MODE REPLACE              TexEnv TEXTURE_ENV TEXTURE_ENV_MODE REPLACE
192                Color 0 1 0
193                Enable TEXTURE_2D
194                SecondaryColorEXT 0 0 0
195          """ % locals())          """ % locals())
196    
197          ppass.setNTexGens(1)          ppass.setNTexGens(1)
198            t = pap.repeat.vecs
199            print "T ",t
200          ppass.putNormalTexGen(0,          ppass.putNormalTexGen(0,
201              [ v[0][0], v[0][1], 0, 0,              [ t[0][0], t[0][1], 0, 0,
202                v[1][0], v[1][1], 0, 0,                t[1][0], t[1][1], 0, 0,
203                0,        0,      0, 0,                0,        0,      0, 0,
204                0,        0,      0, 0,])                0,        0,      0, 0,])
205    
# Line 222  class ThePaperMill(PaperMill): Line 240  class ThePaperMill(PaperMill):
240              comb = TransparentCombinerPass()              comb = TransparentCombinerPass()
241    
242          code = """          code = """
243              PushAttrib ENABLE_BIT TEXTURE_BIT DEPTH_BUFFER_BIT              PushAttrib ENABLE_BIT TEXTURE_BIT DEPTH_BUFFER_BIT COLOR_BUFFER_BIT CURRENT_BIT
244              Disable BLEND              Disable BLEND
245          """          """
246    

Legend:
Removed from v.1.55  
changed lines
  Added in v.1.56

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