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

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

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

revision 1.3 by tjl, Tue Mar 4 09:29:31 2003 UTC revision 1.4 by tjl, Tue Mar 4 09:49:22 2003 UTC
# Line 44  PageSpanPaper.setupOnlyPass = parseCombi Line 44  PageSpanPaper.setupOnlyPass = parseCombi
44      Enable REGISTER_COMBINERS_NV      Enable REGISTER_COMBINERS_NV
45    
46      SPARE0 = (1-TEX0)      SPARE0 = (1-TEX0)
47        SPARE1 = (TEX0) * (TEX0)
48    
49      color = COL0 * SPARE0      SPARE1 = (1-SPARE1)
50      alpha = SPARE0.blue  
51        color = COL0
52        alpha = SPARE1.blue
53  """)  """)
54    
55  print PageSpanPaper.setupOnlyPass  print PageSpanPaper.setupOnlyPass
# Line 65  def textPaperScene(vs, layout, layoutBg, Line 68  def textPaperScene(vs, layout, layoutBg,
68          paperOnce(vs, 0, layoutBg, scale)          paperOnce(vs, 0, layoutBg, scale)
69    
70      if currentScene.halo:      if currentScene.halo:
71          sz = 10          sz = 6
72            mul = math.sqrt(scale / 2.0)
73            mul = 1.4 * (scale / 2.0)
74          for x in range(-sz,sz+1):          for x in range(-sz,sz+1):
75              for y in range(-sz,sz+1):              for y in range(-sz,sz+1):
76                  if x==0 and y==0: continue                  if x==0 and y==0: continue
77                  into = vs.translateCS(0, str((x,y)), x, y)                  into = vs.translateCS(0, str((x,y)), mul * x, mul * y)
78    
79                  dist = math.hypot(x, y)                  dist = math.hypot(x, y)
80                  if dist > sz: continue                  if dist > sz: continue
81    
82                  # f = .15*(1 - dist / sz)                  # f = .15*(1 - dist / sz)
83                  f = .02                  f = .01
84    
85                  vs.put(getDListNocoords("""                  vs.put(getDListNocoords("""
86                      Enable BLEND                      Enable BLEND
87                      Disable DEPTH_TEST                      Disable DEPTH_TEST
88                      Disable ALPHA_TEST                      Enable ALPHA_TEST
89                        AlphaFunc GREATER .02
90                      BlendFunc ONE ONE_MINUS_SRC_COLOR                      BlendFunc ONE ONE_MINUS_SRC_COLOR
91                      TexParameter TEXTURE_2D TEXTURE_MIN_FILTER LINEAR_MIPMAP_LINEAR                      TexParameter TEXTURE_2D TEXTURE_MIN_FILTER LINEAR_MIPMAP_LINEAR
92                      Color %(f)s %(f)s %(f)s                      Color %(f)s %(f)s %(f)s
# Line 90  def textPaperScene(vs, layout, layoutBg, Line 96  def textPaperScene(vs, layout, layoutBg,
96      vs.put(getDListNocoords("""      vs.put(getDListNocoords("""
97          Enable BLEND          Enable BLEND
98          Disable DEPTH_TEST          Disable DEPTH_TEST
99          BlendFunc ONE ONE          BlendFunc SRC_ALPHA ONE
100          BlendFunc ONE ONE_MINUS_SRC_ALPHA          BlendFunc SRC_ALPHA ONE_MINUS_SRC_ALPHA
101          TexParameter TEXTURE_2D TEXTURE_MIN_FILTER LINEAR_MIPMAP_LINEAR          TexParameter TEXTURE_2D TEXTURE_MIN_FILTER LINEAR_MIPMAP_LINEAR
102          Color 0 0 0          Color 0 0 0
103      """ % locals()))      """ % locals()))

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