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.
Open the file
BamWriter_01.py
.We'll start by applying a gloss map to
self.moulding
. Add this code to the very beginning of thesetupModels
method:self.glossTS = TextureStage("glossTS") self.glossTS.setMode(TextureStage.MModulateGloss)
We have our new
TextureStage
set to useModulateGloss
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 loadRedTeamTex.png
to the following:self.teamTex = loader.loadTexture("../Images/RedTeamTex.png", "../Images/HighGloss.png")
By telling the loader to load two images at once, we're actually combining them into a single texture object. The first image becomes the RGB section of the texture...