BUG: nodePath.clearTexture() does not clear texture stages

The RenderState contains a TextureAttrib. The TextureAttrib defines a set of texture stages to be applied to the Geom.

The net RenderState (and hence the next TextureAttrib) to be applied to the Geom is accumulated by composing RenderStates from the root of the graph.

At any given node level, the RenderState might apply a new TextureAttrib. The new TextureAttrib is composed to the working TextureAttrib so far accumulated from the root. By the time you reach a Geom, the final TextureAttrib is the result of all of the accumulations of TextureAttribs at that node and above.

Each TextureAttrib can add a certain set of TextureStages and/or remove a certain set of TextureStages from those specified above. Also, a low-priority TextureStage will not affect a parent TextureStage with a higher priority.

So: at a particular node, you can turn off the TextureStage you don’t want and add the TextureStage you do want. Or, you can replace the texture associated with a particular TextureStage with a different texture.

If you also specify a priority on that node, then no lower TextureAttribs will further influence the resulting texture combination, by either adding or removing TextureStages. This is helpful when you want to shadow a TextureStage that is enabled at a lower level, but this trick cannot be used to shadow just one TextureStage while allowing other TextureStage changes to also be applied from a lower level.

So, if you want to remove just one particular TextureStage from the final state, but leave other TextureStages alone, it’s best to do it on the node that specifies this TextureStage, or somewhere below that node, and not specify a priority.

David