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

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

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

revision 1.10 by jvk, Wed Oct 16 15:23:50 2002 UTC revision 1.11 by jvk, Fri Jan 31 12:09:49 2003 UTC
# Line 94  class NoTextureSetForStage: Line 94  class NoTextureSetForStage:
94      pass      pass
95    
96  class ShaderPass:  class ShaderPass:
97      def __init__(self, shaderType, maxaniso):      def __init__(self, shaderType):
98          self.st = shaderType          self.st = shaderType
99          self.tex = [None for texunit in shaderType]          self.tex = [None for texunit in shaderType]
         self.maxaniso = maxaniso  
100      def getTextureTypes(self):      def getTextureTypes(self):
101          "Get the texture type names (D2, R2 ...) for the texture units."          "Get the texture type names (D2, R2 ...) for the texture units."
102          return [texunit[1] for texunit in self.st]          return [texunit[1] for texunit in self.st]
# Line 123  class ShaderPass: Line 122  class ShaderPass:
122    
123              if target != None:              if target != None:
124                  texid = self.tex[t].getTexId()                  texid = self.tex[t].getTexId()
                 minfilter = self.tex[t].minfilter  
                 magfilter = self.tex[t].magfilter  
125                  if texid == None: raise NoTextureSetForStage()                  if texid == None: raise NoTextureSetForStage()
126                  c += """                  c += """
127                      Enable %(target)s                      Enable %(target)s
128                      BindTexture %(target)s %(texid)s                      BindTexture %(target)s %(texid)s
   
                     TexParameter %(target)s TEXTURE_WRAP_S REPEAT  
                     TexParameter %(target)s TEXTURE_WRAP_T REPEAT  
                     TexParameter %(target)s TEXTURE_MIN_FILTER %(minfilter)s  
                     TexParameter %(target)s TEXTURE_MAG_FILTER %(magfilter)s  
129                  """ % locals()                  """ % locals()
130              if len(self.st[t]) > 2: # Previous texture input              if len(self.st[t]) > 2: # Previous texture input
131                  c += """                  c += """
# Line 150  class ShaderPass: Line 142  class ShaderPass:
142                      TexEnv TEXTURE_SHADER_NV OFFSET_TEXTURE_MATRIX_NV %s %s %s %s                      TexEnv TEXTURE_SHADER_NV OFFSET_TEXTURE_MATRIX_NV %s %s %s %s
143                  """ % mat                  """ % mat
144                            
   
         if self.maxaniso != None:  
             maxaniso = self.maxaniso  
             c += """  
                 TexParameter %(target)s TEXTURE_MAX_ANISOTROPY_EXT %(maxaniso)s  
             """ % locals()  
   
145          return c          return c
146      def getRGBoutputs(self):      def getRGBoutputs(self):
147          """A list of the texture units whose outputs are useful in          """A list of the texture units whose outputs are useful in
# Line 168  class ShaderPass: Line 153  class ShaderPass:
153      def getRGBoutputscales(self):      def getRGBoutputscales(self):
154          return [self.tex[i].scale for i in self.getRGBoutputs()]          return [self.tex[i].scale for i in self.getRGBoutputs()]
155    
156  def makeNormalShaderPass(maxaniso = None):  def makeNormalShaderPass():
157      return ShaderPass(shaderTypes[5], maxaniso)      return ShaderPass(shaderTypes[5])
158    
159  scaleFactor = 1.5  scaleFactor = 1.5

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

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