TagStateManager

from panda3d._rplight import TagStateManager
class TagStateManager

Bases: DTOOL_SUPER_BASE

The TagStateManager stores a list of RenderStates assigned to different steps in the pipeline. For example, there are a list of shadow states, which are applied whenever objects are rendered from a shadow camera.

The Manager also stores a list of all cameras used in the different stages, to keep track of the states used and to be able to attach new states.

Inheritance diagram

Inheritance diagram of TagStateManager

__init__(*args, **kwargs)
applyState()

C++ Interface: apply_state(const TagStateManager self, str state, NodePath np, Shader shader, str name, int sort)

/**
  • @brief Applies a given state for a pass to a NodePath

  • @details This applies a shader to the given NodePath which is used when the

  • NodePath is rendered by any registered camera for that pass.

  • It also disables color write depending on the pass.

  • @param np The nodepath to apply the shader to

  • @param shader A handle to the shader to apply

  • @param name Name of the state, should be a unique identifier

  • @param sort Determines the sort with which the shader will be applied.

*/

/**
  • @brief Applies a given state to a NodePath

  • @details This applies a shader to the given NodePath which is used when the

  • NodePath is rendered by any registered camera of the container.

  • @param container The container which is used to store the state

  • @param np The nodepath to apply the shader to

  • @param shader A handle to the shader to apply

  • @param name Name of the state, should be a unique identifier

  • @param sort Changes the sort with which the shader will be applied.

*/

apply_state()

C++ Interface: apply_state(const TagStateManager self, str state, NodePath np, Shader shader, str name, int sort)

/**
  • @brief Applies a given state for a pass to a NodePath

  • @details This applies a shader to the given NodePath which is used when the

  • NodePath is rendered by any registered camera for that pass.

  • It also disables color write depending on the pass.

  • @param np The nodepath to apply the shader to

  • @param shader A handle to the shader to apply

  • @param name Name of the state, should be a unique identifier

  • @param sort Determines the sort with which the shader will be applied.

*/

/**
  • @brief Applies a given state to a NodePath

  • @details This applies a shader to the given NodePath which is used when the

  • NodePath is rendered by any registered camera of the container.

  • @param container The container which is used to store the state

  • @param np The nodepath to apply the shader to

  • @param shader A handle to the shader to apply

  • @param name Name of the state, should be a unique identifier

  • @param sort Changes the sort with which the shader will be applied.

*/

cleanupStates()

C++ Interface: cleanup_states(const TagStateManager self)

/**
  • @brief Cleans up all registered states.

  • @details This cleans up all states which were registered to the TagStateManager.

  • It also calls Camera::clear_tag_states() on the main_cam_node and all attached

  • cameras.

*/

cleanup_states()

C++ Interface: cleanup_states(const TagStateManager self)

/**
  • @brief Cleans up all registered states.

  • @details This cleans up all states which were registered to the TagStateManager.

  • It also calls Camera::clear_tag_states() on the main_cam_node and all attached

  • cameras.

*/

getMask()

C++ Interface: get_mask(TagStateManager self, str container_name)

/**
  • @brief Returns the render mask for the given state

  • @details This returns the mask of a given render pass, which can be used

  • to either show or hide objects from this pass.

  • @param container_name Name of the render-pass

  • @return Bit mask of the render pass

*/

get_mask()

C++ Interface: get_mask(TagStateManager self, str container_name)

/**
  • @brief Returns the render mask for the given state

  • @details This returns the mask of a given render pass, which can be used

  • to either show or hide objects from this pass.

  • @param container_name Name of the render-pass

  • @return Bit mask of the render pass

*/

registerCamera()

C++ Interface: register_camera(const TagStateManager self, str state, Camera source)

/**
  • @brief Registers a new camera which renders a certain pass

  • @details This registers a new camera which will be used to render the given

  • pass. The TagStateManager will keep track of the camera and

  • applies all registered states onto the camera with Camera::set_tag_state.

  • It also applies the appropriate camera mask to the camera,

  • and sets an initial state to disable color write depending on the pass.

  • @param source Camera which will be used to render shadows

*/

/**
  • @brief Registers a new camera to a given container

  • @details This registers a new camera to a container, and sets its initial

  • state as well as the camera mask.

  • @param container The container to add the camera to

  • @param source The camera to add

*/

register_camera()

C++ Interface: register_camera(const TagStateManager self, str state, Camera source)

/**
  • @brief Registers a new camera which renders a certain pass

  • @details This registers a new camera which will be used to render the given

  • pass. The TagStateManager will keep track of the camera and

  • applies all registered states onto the camera with Camera::set_tag_state.

  • It also applies the appropriate camera mask to the camera,

  • and sets an initial state to disable color write depending on the pass.

  • @param source Camera which will be used to render shadows

*/

/**
  • @brief Registers a new camera to a given container

  • @details This registers a new camera to a container, and sets its initial

  • state as well as the camera mask.

  • @param container The container to add the camera to

  • @param source The camera to add

*/

unregisterCamera()

C++ Interface: unregister_camera(const TagStateManager self, str state, Camera source)

/**
  • @brief Unregisters a camera from the list of shadow cameras

  • @details This unregisters a camera from the list of shadows cameras. It also

  • resets all tag states of the camera, and also its initial state.

  • @param source Camera to unregister

*/

/**
  • @brief Unregisters a camera from a container

  • @details This unregisters a camera from the list of cameras of a given

  • container. It also resets all tag states of the camera, and also its initial

  • state.

  • @param source Camera to unregister

*/

unregister_camera()

C++ Interface: unregister_camera(const TagStateManager self, str state, Camera source)

/**
  • @brief Unregisters a camera from the list of shadow cameras

  • @details This unregisters a camera from the list of shadows cameras. It also

  • resets all tag states of the camera, and also its initial state.

  • @param source Camera to unregister

*/

/**
  • @brief Unregisters a camera from a container

  • @details This unregisters a camera from the list of cameras of a given

  • container. It also resets all tag states of the camera, and also its initial

  • state.

  • @param source Camera to unregister

*/