O'Reilly logo

Panda3D 1.6 Game Engine by Dave Mathews

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - using TextureStages

That's enough talk about TextureStages. It's about time we saw them at work. Let's start putting our cycle together with all the right textures so we can make use of these things.

  1. Open the file BamWriter_01.py.
  2. We'll start by applying a gloss map to self.moulding. Add this code to the very beginning of the setupModels method:
    self.glossTS = TextureStage("glossTS")
    self.glossTS.setMode(TextureStage.MModulateGloss)
    
  3. We have our new TextureStage set to use ModulateGloss mode, which requires an image with an alpha channel. However, the texture we're using is in the PNG format, which doesn't support alpha channels. We can fix that by changing the line where we load RedTeamTex.png to the following:
    self.teamTex = loader.loadTexture("../Images/RedTeamTex.png", ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required