当前位置: 首页>>代码示例>>Python>>正文


Python TextureStage.setTexcoordName方法代码示例

本文整理汇总了Python中pandac.PandaModules.TextureStage.setTexcoordName方法的典型用法代码示例。如果您正苦于以下问题:Python TextureStage.setTexcoordName方法的具体用法?Python TextureStage.setTexcoordName怎么用?Python TextureStage.setTexcoordName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pandac.PandaModules.TextureStage的用法示例。


在下文中一共展示了TextureStage.setTexcoordName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: loadAndSetCubeTexture2

# 需要导入模块: from pandac.PandaModules import TextureStage [as 别名]
# 或者: from pandac.PandaModules.TextureStage import setTexcoordName [as 别名]
 def loadAndSetCubeTexture2( self, nodePath1, nodePath2, fileName, textureStageName, texCoordName, sort ):
     #load texture from file
     texture = loader.loadCubeMap(fileName)
     
     #set texture stage
     textureStage=TextureStage(textureStageName)
     textureStage.setTexcoordName(texCoordName)
     textureStage.setSort(sort)
     
     #set texture and texture stage
     nodePath1.setTexture(textureStage,texture)
     nodePath2.setTexture(textureStage,texture)    
开发者ID:alexisheloir,项目名称:embr-character-animation-engine,代码行数:14,代码来源:shaders.py

示例2: loadAndSetTexture

# 需要导入模块: from pandac.PandaModules import TextureStage [as 别名]
# 或者: from pandac.PandaModules.TextureStage import setTexcoordName [as 别名]
 def loadAndSetTexture(self,nodePath,fileName,textureStageName,texCoordName,sort):
     #load texture from file
     texture=loader.loadTexture(fileName)
     texture.setWrapU(Texture.WMClamp)
     texture.setWrapV(Texture.WMClamp)
     
     #set texture stage
     textureStage=TextureStage(textureStageName)
     textureStage.setTexcoordName(texCoordName)
     textureStage.setSort(sort)
     
     #set texture and texture stage
     nodePath.setTexture(textureStage,texture)
开发者ID:alexisheloir,项目名称:embr-character-animation-engine,代码行数:15,代码来源:shaders.py

示例3: SetGeomTexture

# 需要导入模块: from pandac.PandaModules import TextureStage [as 别名]
# 或者: from pandac.PandaModules.TextureStage import setTexcoordName [as 别名]
    def SetGeomTexture(geom, geomId, node, blockTexture):
        """ Applies the texture to the visible geometry of the Chunk."""
        ts = TextureStage('ts')
        ts.setMode(TextureStage.MDecal)
        ts.setTexcoordName('light')

        # Setup the block texture
        attrib = TextureAttrib.make(blockTexture)
        
        # Add the light overlay
        #attrib = attrib.addOnStage(ts, geom['lighttexture'])
        
        # Apply the texture to the node
        node.setGeomState(geomId, 
                               node.getGeomState(geomId).addAttrib(attrib))
开发者ID:czorn,项目名称:Modifire,代码行数:17,代码来源:ChunkOfBlocksNew.py

示例4: __init__

# 需要导入模块: from pandac.PandaModules import TextureStage [as 别名]
# 或者: from pandac.PandaModules.TextureStage import setTexcoordName [as 别名]
class ShipFactory:
    notify = DirectNotifyGlobal.directNotify.newCategory("ShipFactory")

    def __init__(self, phasedLoading=False):
        self.wantProws = config.GetBool("want-sprits", 0)
        self.hulls = {}
        self.texInfo = ({}, {}, {})
        self.models = {}
        self.mastSets = {}
        ShipBlueprints.setupWheel()
        ShipBlueprints.setupShipTextures()
        self.preprocessMast(ShipGlobals.Masts.Main_Tri)
        self.preprocessMast(ShipGlobals.Masts.Fore_Tri)
        self.preprocessHull(ShipGlobals.INTERCEPTORL1)
        self.preprocessMast(ShipGlobals.Masts.Skel_Main_A)
        self.preprocessMast(ShipGlobals.Masts.Skel_Main_B)
        self.preprocessMast(ShipGlobals.Masts.Skel_Tri)
        self.preprocessMast(ShipGlobals.Masts.Skel_Fore)
        self.preprocessMast(ShipGlobals.Masts.Skel_Aft)
        self.preprocessHull(ShipGlobals.SKEL_INTERCEPTORL3)
        self.preprocessHull(ShipGlobals.SKEL_WARSHIPL3)
        if not phasedLoading:
            self.handlePhase4()
            self.handlePhase5()

        self.baseLayer = TextureStage("base")
        self.colorLayer = TextureStage("color")
        self.logoLayer = TextureStage("logo")
        self.logoLayerNoColor = TextureStage("logoNoColor")
        self.vertLayer = TextureStage("vertex")
        self.colorLayer.setSort(1)
        self.colorLayer.setCombineRgb(TextureStage.CMReplace, TextureStage.CSTexture, TextureStage.COSrcColor)
        self.colorLayer.setCombineAlpha(TextureStage.CMReplace, TextureStage.CSTexture, TextureStage.COSrcAlpha)
        self.colorLayer.setTexcoordName("uvColor")
        self.logoLayer.setSort(2)
        self.logoLayer.setCombineRgb(
            TextureStage.CMInterpolate,
            TextureStage.CSTexture,
            TextureStage.COSrcColor,
            TextureStage.CSPrevious,
            TextureStage.COSrcColor,
            TextureStage.CSTexture,
            TextureStage.COSrcAlpha,
        )
        self.logoLayer.setCombineAlpha(TextureStage.CMReplace, TextureStage.CSPrevious, TextureStage.COSrcAlpha)
        self.logoLayer.setTexcoordName("uvLogo")
        self.logoLayerNoColor.setSort(2)
        self.logoLayerNoColor.setCombineRgb(
            TextureStage.CMInterpolate,
            TextureStage.CSTexture,
            TextureStage.COSrcColor,
            TextureStage.CSConstant,
            TextureStage.COSrcColor,
            TextureStage.CSTexture,
            TextureStage.COSrcAlpha,
        )
        self.logoLayerNoColor.setCombineAlpha(TextureStage.CMReplace, TextureStage.CSPrevious, TextureStage.COSrcAlpha)
        self.logoLayerNoColor.setTexcoordName("uvLogo")
        self.logoLayerNoColor.setColor((1, 1, 1, 1))
        self.vertLayer.setSort(3)
        self.vertLayer.setCombineRgb(
            TextureStage.CMModulate,
            TextureStage.CSPrevious,
            TextureStage.COSrcColor,
            TextureStage.CSPrimaryColor,
            TextureStage.COSrcColor,
        )
        self.vertLayer.setCombineAlpha(TextureStage.CMReplace, TextureStage.CSPrimaryColor, TextureStage.COSrcAlpha)
        self.baseLayer.setSort(4)
        self.baseLayer.setCombineRgb(
            TextureStage.CMModulate,
            TextureStage.CSTexture,
            TextureStage.COSrcColor,
            TextureStage.CSPrevious,
            TextureStage.COSrcColor,
        )
        self.baseLayer.setCombineAlpha(
            TextureStage.CMModulate,
            TextureStage.CSTexture,
            TextureStage.COSrcAlpha,
            TextureStage.CSPrevious,
            TextureStage.COSrcAlpha,
        )

    def handlePhase4(self):
        self.preprocessHull(ShipGlobals.INTERCEPTORL2)
        self.preprocessHull(ShipGlobals.INTERCEPTORL3)
        self.preprocessMast(ShipGlobals.Masts.Main_Square)
        self.preprocessMast(ShipGlobals.Masts.Aft_Tri)
        self.preprocessMast(ShipGlobals.Masts.Fore_Multi)
        self.preprocessHull(ShipGlobals.WARSHIPL1)
        self.preprocessHull(ShipGlobals.WARSHIPL2)
        self.preprocessHull(ShipGlobals.WARSHIPL3)
        self.preprocessHull(ShipGlobals.MERCHANTL1)
        self.preprocessHull(ShipGlobals.MERCHANTL2)
        self.preprocessHull(ShipGlobals.MERCHANTL3)
        self.preprocessHull(ShipGlobals.QUEEN_ANNES_REVENGE)
        self.sprits = ShipBlueprints.preprocessSprits()

    def handlePhase5(self):
#.........这里部分代码省略.........
开发者ID:PiratesOnline,项目名称:PiratesOfTheCarribeanOnline,代码行数:103,代码来源:ShipFactory.py


注:本文中的pandac.PandaModules.TextureStage.setTexcoordName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。