can shader be set to node ,not nodepath

can shader be set to node ,not nodepath

like house model,I only want set shadow shader to floor node ,others like window node,use the default

To set a shader on a PandaNode object instead of a NodePath object, you can use:


This is essentially what NodePath.setShader does under the hood.

The rest of your question makes it sound like you want to apply a shader on a specific node whereas you want to use a different shader for other nodes. This is simply a matter of finding the NodePath of the subnode, then calling setShader on it. This will automatically override a shader applied to a higher node.