Panda3D Manual: Render Attributes
  <<prev top next>>     

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-
ClipPlaneAttribnodePath.setClipPlane(planeNode)
ColorAttribnodePath.setColor(r, g, b, a)
ColorBlendAttrib-
ColorScaleAttribnodePath.setColorScale(r, g, b, a)
ColorWriteAttrib-
CullBinAttribnodePath.setBin('binName', order)
CullFaceAttribnodePath.setTwoSided(flag)
DepthOffsetAttrib-
DepthTestAttribnodePath.setDepthTest(flag)
DepthWriteAttribnodePath.setDepthWrite(flag)
FogAttribnodePath.setFog(fog); See Also: Fog
LightAttribnodePath.setLight(light); See Also: Lighting
MaterialAttribnodePath.setMaterial(material)
RenderModeAttribnodePath.setRenderMode(RenderModeAttrib.Mode)
ShaderAttribnodePath.setShader(shader); See Also: Using Cg Shaders
TexGenAttribnodePath.setTexGen(stage, TexGenAttrib.Mode); See Also: Automatic Texture Coordinates
TexMatrixAttribnodePath.setTexTransform(TransformState.make(mat)); See Also: Texture Transforms
TextureAttribnodePath.setTexture(tex); See Also: Simple Texturing and Multitexture Introduction
TransparencyAttribnodePath.setTransparency(TransparencyAttrib.Mode)
  <<prev top next>>