/[fenfire]/fenfire/org/fenfire/spanimages/gl/papermakers.py
ViewVC logotype

Diff of /fenfire/org/fenfire/spanimages/gl/papermakers.py

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

revision 1.16 by tjl, Wed Nov 5 10:25:52 2003 UTC revision 1.17 by tjl, Sat Nov 8 19:45:09 2003 UTC
# Line 31  from org.fenfire.spanimages.gl import Pl Line 31  from org.fenfire.spanimages.gl import Pl
31  # A list of paper makers, as tuples:  # A list of paper makers, as tuples:
32  # (function, description)  # (function, description)
33  #  #
34    # The function returns the suitable parameters for
35    # Functional.createFunctionInstance, i.e.
36    # type and list of parameters.
37    #
38  # Separated by whether the fancy bg is shown or not.  # Separated by whether the fancy bg is shown or not.
39  #  #
40  # The function is set to None for those that are  # The function is set to None for those that are
# Line 62  def getPaperMill(paperMill, paperOffset) Line 66  def getPaperMill(paperMill, paperOffset)
66    
67  def white(w = None, paperMill = None, paperOffset = 0,  def white(w = None, paperMill = None, paperOffset = 0,
68              filter = ""):              filter = ""):
69      return PlainPaperMaker(1, """      return (PlainPaperMaker, [1, """
70          TexEnv TEXTURE_ENV TEXTURE_ENV_MODE REPLACE          TexEnv TEXTURE_ENV TEXTURE_ENV_MODE REPLACE
71         Enable TEXTURE_2D         Enable TEXTURE_2D
72          Disable BLEND          Disable BLEND
73      """ + filter, """      """ + filter, """
74      """, None)      """, None])
75    
76  whitePaperMakers.append( (white, "White background") )  whitePaperMakers.append( (white, "White background") )
77    
# Line 127  def nvFancyBlur(paperMill = None, paperO Line 131  def nvFancyBlur(paperMill = None, paperO
131      if paperMill == None:      if paperMill == None:
132          paperMill = PaperMill.getInstance()          paperMill = PaperMill.getInstance()
133    
134      return PlainPaperMaker(2, """      return (PlainPaperMaker, [2, """
135          BindProgram FRAGMENT_PROGRAM_NV %s          BindProgram FRAGMENT_PROGRAM_NV %s
136          ActiveTexture TEXTURE2          ActiveTexture TEXTURE2
137          TexEnv TEXTURE_FILTER_CONTROL TEXTURE_LOD_BIAS 3.8          TexEnv TEXTURE_FILTER_CONTROL TEXTURE_LOD_BIAS 3.8
# Line 140  def nvFancyBlur(paperMill = None, paperO Line 144  def nvFancyBlur(paperMill = None, paperO
144          ActiveTexture TEXTURE2          ActiveTexture TEXTURE2
145          TexEnv TEXTURE_FILTER_CONTROL TEXTURE_LOD_BIAS 0          TexEnv TEXTURE_FILTER_CONTROL TEXTURE_LOD_BIAS 0
146          ActiveTexture TEXTURE0          ActiveTexture TEXTURE0
147      """, [nvBlurProgram], paperMill)      """, [nvBlurProgram], paperMill])
148    
149  if nvBlurProgram:  if nvBlurProgram:
150      b = nvFancyBlur      b = nvFancyBlur
# Line 193  def fancyBlur(paperMill = None, paperOff Line 197  def fancyBlur(paperMill = None, paperOff
197      if paperMill == None:      if paperMill == None:
198          paperMill = PaperMill.getInstance()          paperMill = PaperMill.getInstance()
199    
200      return PlainPaperMaker(1, """      return (PlainPaperMaker, [1, """
201          BindProgram FRAGMENT_PROGRAM_ARB %s          BindProgram FRAGMENT_PROGRAM_ARB %s
202          Enable FRAGMENT_PROGRAM_ARB          Enable FRAGMENT_PROGRAM_ARB
203          Disable REGISTER_COMBINERS_NV          Disable REGISTER_COMBINERS_NV
204          Disable BLEND          Disable BLEND
205      """ % blurProgram.getProgId(),      """ % blurProgram.getProgId(),
206      """      """
207      """, [blurProgram], paperMill)      """, [blurProgram], paperMill])
208    
209  if blurProgram:  if blurProgram:
210      b = fancyBlur      b = fancyBlur
# Line 277  def fancyHalo(paperMill = None, paperOff Line 281  def fancyHalo(paperMill = None, paperOff
281          return fancyBlend(paperMill)          return fancyBlend(paperMill)
282      if paperMill == None:      if paperMill == None:
283          paperMill = PaperMill.getInstance()          paperMill = PaperMill.getInstance()
284      return HaloPaperMaker_2tex(paperMill)      return (HaloPaperMaker_2tex, [paperMill])
285    
286  if GL.hasExtension("GL_NV_register_combiners"):  if GL.hasExtension("GL_NV_register_combiners"):
287      b = fancyHalo      b = fancyHalo
# Line 289  fancyPaperMakers.append( (b, "Brightenin Line 293  fancyPaperMakers.append( (b, "Brightenin
293  def fancyBlend(paperMill = None, paperOffset = 0,  def fancyBlend(paperMill = None, paperOffset = 0,
294              filter = ""):              filter = ""):
295      paperMill = getPaperMill(paperMill, paperOffset)      paperMill = getPaperMill(paperMill, paperOffset)
296      return PlainPaperMaker(1,      return (PlainPaperMaker, [1,
297          """          """
298              ActiveTexture TEXTURE0              ActiveTexture TEXTURE0
299              TexEnv TEXTURE_ENV TEXTURE_ENV_MODE REPLACE              TexEnv TEXTURE_ENV TEXTURE_ENV_MODE REPLACE
# Line 300  def fancyBlend(paperMill = None, paperOf Line 304  def fancyBlend(paperMill = None, paperOf
304              %s              %s
305              Disable BLEND              Disable BLEND
306              ActiveTexture TEXTURE0              ActiveTexture TEXTURE0
307          """ % filter, "", None, paperMill)          """ % filter, "", None, paperMill])
308    
309  fancyPaperMakers.append( (fancyBlend, "No enhancement, Just rendering text on top of Bg (Not recommended)") )  fancyPaperMakers.append( (fancyBlend, "No enhancement, Just rendering text on top of Bg (Not recommended)") )
310    

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

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