Panda uses a set of attributes to define the way geometry is rendered. The complete set of attributes in effect on a given node is called the RenderState; this state determines all the render properties such as color, texture, lighting, and so on.
These individual attributes can be stored on any node of the scene graph; setting an attribute on a node automatically applies it to that node as well as to all of the children of the node (unless an override is in effect, but that's a more advanced topic).
It is possible to create these attributes and assign them to a node directly:
nodePath.node().setAttrib(attributeObject)
|
But in many cases, especially with the most commonly-modified attributes, you don't need to create the attributes directly as there is a convenience function on NodePath (e.g. nodePath.setFog() ) that manages the creation of the attributes for you; there will also be a corresponding clear function on NodePath to remove the attribute (nodePath.clearFog() ).
The following is a list of the attributes available in Panda3D as of the time of this writing, along with the primary NodePath method to set them, and/or a reference to the manual page that describes the attribute in more detail:
AlphaTestAttrib | - |
ClipPlaneAttrib | nodePath.setClipPlane(planeNode) |
ColorAttrib | nodePath.setColor(r, g, b, a) |
ColorBlendAttrib | - |
ColorScaleAttrib | nodePath.setColorScale(r, g, b, a) |
ColorWriteAttrib | - |
CullBinAttrib | nodePath.setBin('binName', order) |
CullFaceAttrib | nodePath.setTwoSided(flag) |
DepthOffsetAttrib | - |
DepthTestAttrib | nodePath.setDepthTest(flag) |
DepthWriteAttrib | nodePath.setDepthWrite(flag) |
FogAttrib | nodePath.setFog(fog); See Also: Fog |
LightAttrib | nodePath.setLight(light); See Also: Lighting |
MaterialAttrib | nodePath.setMaterial(material) |
RenderModeAttrib | nodePath.setRenderMode(RenderModeAttrib.Mode) |
ShaderAttrib | nodePath.setShader(shader); See Also: Using Cg Shaders |
TexGenAttrib | nodePath.setTexGen(stage, TexGenAttrib.Mode); See Also: Automatic Texture Coordinates |
TexMatrixAttrib | nodePath.setTexTransform(TransformState.make(mat)); See Also: Texture Transforms |
TextureAttrib | nodePath.setTexture(tex); See Also: Simple Texturing and Multitexture Introduction |
TransparencyAttrib | nodePath.setTransparency(TransparencyAttrib.Mode) |
|