ShadowManager

from panda3d._rplight import ShadowManager
class ShadowManager

Bases: ReferenceCount

Inheritance diagram

Inheritance diagram of ShadowManager

__init__(*args, **kwargs)
atlas
atlas_size
getAtlas()

C++ Interface: get_atlas(ShadowManager self)

/**
  • @brief Returns a handle to the shadow atlas.

  • @details This returns a handle to the internal shadow atlas instance. This

  • is only valid after calling ShadowManager::init. Calling this earlier will

  • trigger an assertion and undefined behaviour.

  • @return The internal ShadowAtlas instance

*/

getAtlasSize()

C++ Interface: get_atlas_size(ShadowManager self)

/**
  • @brief Returns the shadow atlas size.

  • @details This returns the shadow atlas size previously set with

  • ShadowManager::set_atlas_size.

  • @return Shadow atlas size in pixels

*/

getNumUpdateSlotsLeft()

C++ Interface: get_num_update_slots_left(ShadowManager self)

/**
  • @brief Returns how many update slots are left.

  • @details This returns how many update slots are left. You can assume the

  • next n calls to add_update will succeed, whereas n is the value returned

  • by this function.

  • @return Number of update slots left.

*/

get_atlas()

C++ Interface: get_atlas(ShadowManager self)

/**
  • @brief Returns a handle to the shadow atlas.

  • @details This returns a handle to the internal shadow atlas instance. This

  • is only valid after calling ShadowManager::init. Calling this earlier will

  • trigger an assertion and undefined behaviour.

  • @return The internal ShadowAtlas instance

*/

get_atlas_size()

C++ Interface: get_atlas_size(ShadowManager self)

/**
  • @brief Returns the shadow atlas size.

  • @details This returns the shadow atlas size previously set with

  • ShadowManager::set_atlas_size.

  • @return Shadow atlas size in pixels

*/

get_num_update_slots_left()

C++ Interface: get_num_update_slots_left(ShadowManager self)

/**
  • @brief Returns how many update slots are left.

  • @details This returns how many update slots are left. You can assume the

  • next n calls to add_update will succeed, whereas n is the value returned

  • by this function.

  • @return Number of update slots left.

*/

init()

C++ Interface: init(const ShadowManager self)

/**
  • @brief Initializes the ShadowManager.

  • @details This initializes the ShadowManager. All properties should have

  • been set before calling this, otherwise assertions will get triggered.

  • This setups everything required for rendering shadows, including the

  • shadow atlas and the various shadow cameras. After calling this method,

  • no properties can be changed anymore.

*/

num_update_slots_left
setAtlasGraphicsOutput()

C++ Interface: set_atlas_graphics_output(const ShadowManager self, GraphicsOutput graphics_output)

/**
  • @brief Sets the handle to the Shadow targets output

  • @details This sets the handle to the GraphicsOutput of the shadow atlas.

  • Usually this is RenderTarget.get_internal_buffer(), whereas the RenderTarget

  • is the target of the ShadowStage.

  • This is used for creating display regions and attaching cameras to them,

  • for performing shadow updates.

  • This has to get called before ShadowManager::init, otherwise an assertion

  • will be triggered.

  • @param graphics_output [description]

*/

setAtlasSize()

C++ Interface: set_atlas_size(const ShadowManager self, int atlas_size)

/**
  • @brief Sets the shadow atlas size

  • @details This sets the desired shadow atlas size. It should be big enough

  • to store all important shadow sources, with some buffer, because the shadow

  • maps usually won’t be fitted perfectly, so gaps can occur.

  • This has to get called before calling ShadowManager::init. When calling this

  • method after initialization, an assertion will get triggered.

  • @param atlas_size Size of the shadow atlas in pixels

*/

setMaxUpdates()

C++ Interface: set_max_updates(const ShadowManager self, int max_updates)

/**
  • @brief Sets the maximum amount of updates per frame.

  • @details This controls the maximum amount of updated ShadowSources per frame.

  • The ShadowManager will take the first <max_updates> ShadowSources, and

  • generate shadow maps for them every frame. If there are more ShadowSources

  • waiting to get updated than available updates, the sources are sorted by

  • priority, and the update of the less important sources is delayed to the

  • next frame.

  • If the update count is set too low, and there are a lot of ShadowSources

  • waiting to get updated, artifacts will occur, and there might be ShadowSources

  • which never get updated, due to low priority.

  • If an update count of 0 is passed, no updates will happen. This also means

  • that there are no shadows. This is not recommended.

  • If an update count < 0 is passed, undefined behaviour occurs.

  • This method has to get called before ShadowManager::init, otherwise an

  • assertion will get triggered.

  • @param max_updates Maximum amoumt of updates

*/

setScene()

C++ Interface: set_scene(const ShadowManager self, NodePath scene_parent)

/**
  • @brief Sets the target scene

  • @details This sets the target scene for rendering shadows. All shadow cameras

  • will be parented to this scene to render shadows.

  • Usually the scene will be ShowBase.render. If the scene is an empty or

  • invalid NodePath, an assertion will be triggered.

  • This method has to get called before calling ShadowManager::init, or an

  • assertion will get triggered.

  • @param scene_parent The target scene

*/

setTagStateManager()

C++ Interface: set_tag_state_manager(const ShadowManager self, TagStateManager tag_mgr)

/**
  • @brief Sets the handle to the TagStageManager.

  • @details This sets the handle to the TagStateManager used by the pipeline.

  • Usually this is RenderPipeline.get_tag_mgr().

  • This has to get called before ShadowManager::init, otherwise an assertion

  • will get triggered.

  • @param tag_mgr [description]

*/

set_atlas_graphics_output()

C++ Interface: set_atlas_graphics_output(const ShadowManager self, GraphicsOutput graphics_output)

/**
  • @brief Sets the handle to the Shadow targets output

  • @details This sets the handle to the GraphicsOutput of the shadow atlas.

  • Usually this is RenderTarget.get_internal_buffer(), whereas the RenderTarget

  • is the target of the ShadowStage.

  • This is used for creating display regions and attaching cameras to them,

  • for performing shadow updates.

  • This has to get called before ShadowManager::init, otherwise an assertion

  • will be triggered.

  • @param graphics_output [description]

*/

set_atlas_size()

C++ Interface: set_atlas_size(const ShadowManager self, int atlas_size)

/**
  • @brief Sets the shadow atlas size

  • @details This sets the desired shadow atlas size. It should be big enough

  • to store all important shadow sources, with some buffer, because the shadow

  • maps usually won’t be fitted perfectly, so gaps can occur.

  • This has to get called before calling ShadowManager::init. When calling this

  • method after initialization, an assertion will get triggered.

  • @param atlas_size Size of the shadow atlas in pixels

*/

set_max_updates()

C++ Interface: set_max_updates(const ShadowManager self, int max_updates)

/**
  • @brief Sets the maximum amount of updates per frame.

  • @details This controls the maximum amount of updated ShadowSources per frame.

  • The ShadowManager will take the first <max_updates> ShadowSources, and

  • generate shadow maps for them every frame. If there are more ShadowSources

  • waiting to get updated than available updates, the sources are sorted by

  • priority, and the update of the less important sources is delayed to the

  • next frame.

  • If the update count is set too low, and there are a lot of ShadowSources

  • waiting to get updated, artifacts will occur, and there might be ShadowSources

  • which never get updated, due to low priority.

  • If an update count of 0 is passed, no updates will happen. This also means

  • that there are no shadows. This is not recommended.

  • If an update count < 0 is passed, undefined behaviour occurs.

  • This method has to get called before ShadowManager::init, otherwise an

  • assertion will get triggered.

  • @param max_updates Maximum amoumt of updates

*/

set_scene()

C++ Interface: set_scene(const ShadowManager self, NodePath scene_parent)

/**
  • @brief Sets the target scene

  • @details This sets the target scene for rendering shadows. All shadow cameras

  • will be parented to this scene to render shadows.

  • Usually the scene will be ShowBase.render. If the scene is an empty or

  • invalid NodePath, an assertion will be triggered.

  • This method has to get called before calling ShadowManager::init, or an

  • assertion will get triggered.

  • @param scene_parent The target scene

*/

set_tag_state_manager()

C++ Interface: set_tag_state_manager(const ShadowManager self, TagStateManager tag_mgr)

/**
  • @brief Sets the handle to the TagStageManager.

  • @details This sets the handle to the TagStateManager used by the pipeline.

  • Usually this is RenderPipeline.get_tag_mgr().

  • This has to get called before ShadowManager::init, otherwise an assertion

  • will get triggered.

  • @param tag_mgr [description]

*/

update()

C++ Interface: update(const ShadowManager self)

/**
  • @brief Updates the ShadowManager

  • @details This updates the ShadowManager, processing all shadow sources which

  • need to get updated.

  • This first collects all sources which require an update, sorts them by priority,

  • and then processes the first <max_updates> ShadowSources.

  • This may not get called before ShadowManager::init, or an assertion will be

  • thrown.

*/