Questions on LoDs

I understand how to create LoDs that change the models, but is there anyway to use the same LoD to disable parallax mapping and the like?

And do I need to use smaller res textures distant LoD models, or does Panda automatically change that?

Parallax mapping? What do you mean?

Panda doesn’t automatically put smaller res textures on your distant models (other than mipmapping, of course), but unless you are using a LOT of really BIG textures, I really doubt you’ll need to worry about that.

David

I believe you would apply a different shader (or however you are applying your material effects) on each LOD model. The LOD node is just switching between displaying different NodePaths so you can do whatever effects you like on each LOD.

Since its a space sim, I am using a lot of really big textures.

Here is my planet LoD code:

#LoD:
        self.lod = LODNode('Planet LoD')
        self.model = NodePath(self.lod)
        self.model.reparentTo(render)

        self.lod.addSwitch(100*self.scale, 0)
        main.loader.loadModel("models/sphere/sphere_lod0").reparentTo(self.model)

        self.lod.addSwitch(150*self.scale, 100*self.scale)
        main.loader.loadModel("models/sphere/sphere_lod1").reparentTo(self.model)

        self.lod.addSwitch(200*self.scale, 150*self.scale)
        main.loader.loadModel("models/sphere/sphere_lod2").reparentTo(self.model)

        self.lod.addSwitch(5000*self.scale, 200*self.scale)
        main.loader.loadModel("models/sphere/sphere_lod3").reparentTo(self.model)


        self.model.setX(math.cos(self.orbitPosition*math.pi/180)*self.solarDistance)
        self.model.setY(math.sin(self.orbitPosition*math.pi/180)*self.solarDistance)
        self.model.setP(tilt)
        self.model.setScale(self.scale)
        self.model.reparentTo(render)


        #Texturing:
        self.diffGlowStage = TextureStage('Diffuse Glow Stage')
        self.diffGlowStage.setMode(TextureStage.MModulateGlow)
        self.diffGlowTexture = loader.loadTexture("gfx/planets/"+planetType+"/diffuse.png","gfx/planets/"+planetType+"/glow.png")

        self.normHeightStage = TextureStage('Normal Height Stage')
        self.normHeightTexture = loader.loadTexture("gfx/planets/"+planetType+"/normal.png","gfx/planets/"+planetType+"/height.png")
        self.normHeightStage.setMode(TextureStage.MNormalHeight)

        self.model.setTexture(self.normHeightStage,self.normHeightTexture)

        self.model.setTexture(self.diffGlowStage,self.diffGlowTexture)

By parallax I meant normal + height mapping.

As you can see, all the materials are applied after the models are loaded.

You could do something like:

lod0 = main.loader.loadModel("models/sphere/sphere_lod0")
lod0.setTexture(whatever)
lod0.reparentTo(self.model)

For each of your LODs, applying a different texture to each one.