You can use the LODNode like this:
#1. make a LODNode and a NodePath wrapper for that LODNode
model_lod = LODNode('model_lod')
model = NodePath(model_lod)
#2. empty node, we won't show a model far far away
lod2 = NodePath('far_far_away')
#3. load a low poly model for medium distance
lod1 = loader.loadModel("low_poly_model")
#4. high poly model for close up
lod0 = loader.loadModel("hi_poly_model")
So you make the LODNode and add NodePath, put the LODNode in the NodePath, then reparent models (nodes) to that NodePath walking from the furthest to the closest adding the lod switch distances as you go along.
But I think that using LODs for lower resolution textures is counter productive, you have mip maps for that, your gpu (or driver, or panda3d, that may depend?) will auto-magically generate smaller versions of your texture and use that texture size that fits closest to the on screen size of the textured object (+ some filtering), all you got to do is set the filter to anything with ‘mipmap’ in its name (like ‘FT_nearest_mipmap_nearest’) - and I think that’s also the default filter type in Panda3D.
You can manually set a different (smaller) texture for a model in a LODNode, but you’re not saving memory this way - you’ll have both the smaller and bigger texture loaded.
If you want to resize a texture buffer, then you can do that… but I think you need to use the makeOutput interface to set the right flags -GraphicsPipe.BF_resizeable - (and get a FBO not the… em… other thing pbuffer? IDK), then you can change the size just using buffer.setSize(X,Y). I have no idea how changing the size of a buffer affects performance, but I don’t think that’s something you would want to do every frame.
#altBuffer = self.win.makeTextureBuffer("hello", 256, 256) #no
winprops = WindowProperties()
props = FrameBufferProperties()
props.setRgbaBits(8, 8, 8, 8)
altBuffer = base.graphicsEngine.makeOutput(
base.pipe, 'hello', sort,