本文整理汇总了Python中Code.RenderingPipeline.RenderingPipeline.fillTextureStages方法的典型用法代码示例。如果您正苦于以下问题:Python RenderingPipeline.fillTextureStages方法的具体用法?Python RenderingPipeline.fillTextureStages怎么用?Python RenderingPipeline.fillTextureStages使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Code.RenderingPipeline.RenderingPipeline
的用法示例。
在下文中一共展示了RenderingPipeline.fillTextureStages方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Main
# 需要导入模块: from Code.RenderingPipeline import RenderingPipeline [as 别名]
# 或者: from Code.RenderingPipeline.RenderingPipeline import fillTextureStages [as 别名]
#.........这里部分代码省略.........
# match.hide()
# continue
self.transparentObjects.append(match)
self.renderPipeline.setEffect(match, "Effects/Default/Default.effect", {
"transparent": True
})
match.setAttrib(CullFaceAttrib.make(CullFaceAttrib.M_none))
for i in ["53", "54", "55", "56", "57"]:
matches = self.scene.findAllMatches("**/" + i)
for match in matches:
match.remove()
# Wheter to use a ground plane
self.usePlane = True
self.sceneWireframe = False
# Flatten scene?
self.loadingScreen.setStatus("Optimizing Scene", 90)
# self.scene.clearModelNodes()
# loader.asyncFlattenStrong(self.scene, inPlace=False, callback=self.onScenePrepared)
self.onScenePrepared()
def onScenePrepared(self, cb=None):
""" Callback which gets called after the scene got prepared """
self.scene.reparentTo(self.render)
# Prepare textures with SRGB format
self.prepareSRGB(self.scene)
# Prepare Materials
self.renderPipeline.fillTextureStages(render)
# Load ground plane if configured
if self.usePlane:
self.groundPlane = self.loader.loadModel(
"Models/Plane/Model.bam")
# self.groundPlane.setPos(0, 0, -5.0)
self.groundPlane.setTwoSided(True)
self.groundPlane.flattenStrong()
self.groundPlane.reparentTo(render)
# lerpTop = self.scene.posInterval(0.8, Vec3(0, 0, 7), startPos=Vec3(0,0,2))
# lerpBot = self.scene.posInterval(0.8, Vec3(0, 0, 2), startPos=Vec3(0,0,7))
# sequence = Sequence(lerpTop, lerpBot)
# sequence.loop()
# self.renderPipeline.setEffect(self.scene, "Effects/Default/Default.effect", {
# "dynamic": True,
# })
# Some artists really don't know about backface culling
# self.scene.setTwoSided(True)
# Create some ocean
# self.water = ProjectedWaterGrid(self.renderPipeline)
# self.water.setWaterLevel(-100)
# Required for tesselation
# self.convertToPatches(self.scene)
示例2: Main
# 需要导入模块: from Code.RenderingPipeline import RenderingPipeline [as 别名]
# 或者: from Code.RenderingPipeline.RenderingPipeline import fillTextureStages [as 别名]
#.........这里部分代码省略.........
dPos = Vec3(60, 30, 100)
dirLight = DirectionalLight()
dirLight.setShadowMapResolution(1024)
dirLight.setPos(dPos)
dirLight.setColor(Vec3(1))
dirLight.setPssmTarget(base.cam, base.camLens)
dirLight.setPssmDistance(180.0)
dirLight.setCastsShadows(True)
self.renderPipeline.addLight(dirLight)
self.dirLight = dirLight
sunPos = Vec3(56.7587, -31.3601, 189.196)
self.dirLight.setPos(sunPos)
self.renderPipeline.setScatteringSource(dirLight)
# Slider to move the sun
if self.renderPipeline.settings.displayOnscreenDebugger:
self.renderPipeline.guiManager.demoSlider.node[
"command"] = self.setSunPos
self.renderPipeline.guiManager.demoSlider.node[
"value"] = 20
self.lastSliderValue = 0.0
# Load skyboxn
self.skybox = self.renderPipeline.getDefaultSkybox()
self.skybox.reparentTo(render)
self.renderPipeline.setEffect(self.model, "DynamicMaterial.effect")
self.renderPipeline.onSceneInitialized()
self.renderPipeline.fillTextureStages(render)
self.createGUI()
def createGUI(self):
self.slider_opts = {
# "roughness": {
# "name": "Roughness",
# "min": 0.0001,
# "max": 1.0,
# "default": 0.4,
# },
# "metallic": {
# "name": "Metallic",
# "min": 0.0001,
# "max": 1.0,
# "default": 0.0,
# },
# "specular": {
# "name": "Specular",
# "min": 0.0001,
# "max": 1.0,
# "default": 0.5,
# },
"bump_factor": {
"name": "Bump Factor",
"min": 0.0001,
"max": 1.0,
"default": 0.5,
},
"basecolor_r": {
"name": "Base Color [Red]",