Loading...
Searching...
No Matches
HdxTaskControllerSceneIndex Class Referencefinal

Manages tasks necessary to render an image (or perform picking) as well as the related render buffers, lights and a free camera. More...

#include <taskControllerSceneIndex.h>

+ Inheritance diagram for HdxTaskControllerSceneIndex:

Classes

struct  Parameters
 All prims in this scene index are under prefix. More...
 

Public Types

using AovDescriptorCallback = std::function< HdAovDescriptor(const TfToken &name)>
 
- Public Types inherited from TfRefBase
typedef void(* UniqueChangedFuncPtr) (TfRefBase const *, bool)
 

Public Member Functions

HDX_API HdSceneIndexPrim GetPrim (const SdfPath &primPath) const override
 Returns a pair of (prim type, datasource).
 
HDX_API SdfPathVector GetChildPrimPaths (const SdfPath &primPath) const override
 Returns the paths of all scene index prims located immediately below primPath.
 
HDX_API SdfPathVector GetRenderingTaskPaths () const
 Obtain paths to the tasks managed by the task controller, for image generation.
 
HDX_API SdfPathVector GetPickingTaskPaths () const
 Obtain paths to tasks managed by the task controller, for picking.
 
HDX_API SdfPath GetRenderBufferPath (const TfToken &aovName) const
 Get the path to the buffer for a rendered output.
 
HDX_API void SetCollection (const HdRprimCollection &collection)
 Set the collection to be rendered.
 
HDX_API void SetRenderParams (const HdxRenderTaskParams &params)
 Set the render params.
 
HDX_API void SetRenderTags (const TfTokenVector &renderTags)
 Set the "view" opinion of the scenes render tags.
 
HDX_API void SetRenderOutputs (const TfTokenVector &aovNames)
 Set the list of outputs to be rendered.
 
HDX_API void SetViewportRenderOutput (TfToken const &aovName)
 Set which output should be rendered to the viewport.
 
HDX_API void SetRenderOutputSettings (TfToken const &aovName, const HdAovDescriptor &desc)
 Set custom parameters for an AOV.
 
HDX_API HdAovDescriptor GetRenderOutputSettings (const TfToken &aovName) const
 Get parameters for an AOV.
 
HDX_API void SetPresentationOutput (const TfToken &api, const VtValue &framebuffer)
 The destination API (e.g., OpenGL, see hgiInterop for details) and framebuffer that the AOVs are presented into.
 
HDX_API void SetLightingState (GlfSimpleLightingContextPtr const &src)
 Set the lighting state for the scene.
 
HDX_API void SetRenderBufferSize (const GfVec2i &size)
 Set the size of the render buffers backing the AOVs.
 
HDX_API void SetFraming (const CameraUtilFraming &framing)
 Determines how the filmback of the camera is mapped into the pixels of the render buffer and what pixels of the render buffer will be rendered into.
 
HDX_API void SetOverrideWindowPolicy (const std::optional< CameraUtilConformWindowPolicy > &policy)
 Specifies whether to force a window policy when conforming the frustum of the camera to match the display window of the camera framing.
 
HDX_API void SetCameraPath (const SdfPath &path)
 – Scene camera – Set the camera param on tasks to a USD camera path.
 
HDX_API void SetRenderViewport (const GfVec4d &viewport)
 Set the viewport param on tasks.
 
HDX_API void SetFreeCameraMatrices (const GfMatrix4d &viewMatrix, const GfMatrix4d &projectionMatrix)
 – Free camera – Set the view and projection matrices for the free camera.
 
HDX_API void SetFreeCameraClipPlanes (const std::vector< GfVec4d > &clipPlanes)
 Set the free camera clip planes.
 
HDX_API void SetEnableSelection (bool enable)
 Turns the selection task on or off.
 
HDX_API void SetSelectionColor (const GfVec4f &color)
 Set the selection color.
 
HDX_API void SetSelectionLocateColor (const GfVec4f &color)
 Set the selection locate (over) color.
 
HDX_API void SetSelectionEnableOutline (bool enableOutline)
 Set if the selection highlight should be rendered as an outline around the selected objects or as a solid color overlaid on top of them.
 
HDX_API void SetSelectionOutlineRadius (unsigned int radius)
 Set the selection outline radius (thickness) in pixels.
 
HDX_API void SetEnableShadows (bool enable)
 Turns the shadow task on or off.
 
HDX_API void SetShadowParams (const HdxShadowTaskParams &params)
 Set the shadow params.
 
HDX_API void SetColorCorrectionParams (const HdxColorCorrectionTaskParams &params)
 Configure color correction by settings params.
 
HDX_API void SetBBoxParams (const HdxBoundingBoxTaskParams &params)
 Set the bounding box params.
 
HDX_API void SetEnablePresentation (bool enabled)
 Enable / disable presenting the render to bound framebuffer.
 
- Public Member Functions inherited from HdSceneIndexBase
HD_API void AddObserver (const HdSceneIndexObserverPtr &observer)
 Adds an observer to this scene index.
 
HD_API void RemoveObserver (const HdSceneIndexObserverPtr &observer)
 Removes an observer from this scene index; the given observer will no longer be forwarded notices.
 
virtual HdSceneIndexPrim GetPrim (const SdfPath &primPath) const =0
 Returns a pair of (prim type, datasource).
 
virtual SdfPathVector GetChildPrimPaths (const SdfPath &primPath) const =0
 Returns the paths of all scene index prims located immediately below primPath.
 
HdDataSourceBaseHandle GetDataSource (const SdfPath &primPath, const HdDataSourceLocator &locator) const
 A convenience function: look up the object at primPath, and if successful return the datasource at locator within that prim.
 
HD_API void SystemMessage (const TfToken &messageType, const HdDataSourceBaseHandle &args)
 Sends a message with optional arguments to this and any upstream input scene indices.
 
HD_API std::string GetDisplayName () const
 Returns a value previously set by SetDisplayName.
 
HD_API void SetDisplayName (const std::string &n)
 Allows for scene index instances to be identified in a more contextually relevant way.
 
HD_API void AddTag (const TfToken &tag)
 Adds a specified tag token to a scene index instance.
 
HD_API void RemoveTag (const TfToken &tag)
 Removes a specified tag token to a scene index instance.
 
HD_API bool HasTag (const TfToken &tag) const
 Returns true if a specified tag token has been added to a scene index instance.
 
HD_API TfTokenVector GetTags () const
 Returns all tag tokens currently added to a scene index instance.
 
- Public Member Functions inherited from TfRefBase
 TfRefBase (TfRefBase const &)
 
TfRefBaseoperator= (TfRefBase const &)
 
size_t GetCurrentCount () const
 Return the current reference count of this object.
 
bool IsUnique () const
 Return true if only one TfRefPtr points to this object.
 
void SetShouldInvokeUniqueChangedListener (bool shouldCall)
 
- Public Member Functions inherited from TfWeakBase
 TfWeakBase (const TfWeakBase &)
 
const TfWeakBase__GetTfWeakBase__ () const
 
const TfWeakBaseoperator= (const TfWeakBase &)
 
void EnableNotification2 () const
 
TF_API void const * GetUniqueIdentifier () const
 

Static Public Member Functions

static HDX_API HdxTaskControllerSceneIndexRefPtr New (const Parameters &params)
 C'tor.
 
- Static Public Member Functions inherited from TfRefBase
static TF_API void SetUniqueChangedListener (UniqueChangedListener listener)
 

Friends

class _Observer
 

Additional Inherited Members

- Protected Member Functions inherited from HdSceneIndexBase
HD_API void _SendPrimsAdded (const HdSceneIndexObserver::AddedPrimEntries &entries)
 Notify attached observers of prims added to the scene.
 
HD_API void _SendPrimsRemoved (const HdSceneIndexObserver::RemovedPrimEntries &entries)
 Notify attached observers of prims removed from the scene.
 
HD_API void _SendPrimsDirtied (const HdSceneIndexObserver::DirtiedPrimEntries &entries)
 Notify attached observers of datasource invalidations from the scene.
 
HD_API void _SendPrimsRenamed (const HdSceneIndexObserver::RenamedPrimEntries &entries)
 Notify attached observers of prims (and their descendents) which have been renamed or reparented.
 
HD_API bool _IsObserved () const
 Returns whether the scene index has any registered observers; this information can be used to skip work preparing notices when there are no observers.
 
virtual HD_API void _SystemMessage (const TfToken &messageType, const HdDataSourceBaseHandle &args)
 Implement in order to react directly to system messages sent from downstream.
 
- Protected Member Functions inherited from TfWeakBase
TfRefPtr< Tf_Remnant > _Register () const
 
template<class T >
TfRefPtr< Tf_Remnant > _Register (T *tempRmnt) const
 
bool _HasRemnant () const
 

Detailed Description

Manages tasks necessary to render an image (or perform picking) as well as the related render buffers, lights and a free camera.

Note that the set of necessary tasks is different for Storm and other renderers. Thus, the c'tor needs to be given the renderer plugin name.

It is a Hydra 2.0 implementation replacing the HdxTaskController. For now, the API and behavior is the same as that of the HdxTaskController.

Definition at line 51 of file taskControllerSceneIndex.h.


Class Documentation

◆ HdxTaskControllerSceneIndex::Parameters

struct HdxTaskControllerSceneIndex::Parameters

All prims in this scene index are under prefix.

The client needs to wrap HdRenderDelegate::GetDefaultAovDescriptor in aovDescriptorCallback (the API on HdRenderDelegate might change). gpuEnabled decides whether the present task is run for non-Storm renderers.

Definition at line 63 of file taskControllerSceneIndex.h.

Class Members
const AovDescriptorCallback aovDescriptorCallback
bool gpuEnabled
bool isForStorm
const SdfPath prefix

Member Typedef Documentation

◆ AovDescriptorCallback

using AovDescriptorCallback = std::function<HdAovDescriptor(const TfToken &name)>

Definition at line 54 of file taskControllerSceneIndex.h.

Member Function Documentation

◆ GetChildPrimPaths()

HDX_API SdfPathVector GetChildPrimPaths ( const SdfPath primPath) const
overridevirtual

Returns the paths of all scene index prims located immediately below primPath.

This function can be used to traverse the scene by recursing from SdfPath::AbsoluteRootPath. The traveral is expected to give exactly the set of paths where prim exists as defined in GetPrim. The traversal is also expected to give the same set of prims as the flattening of the scene index's PrimsAdded and PrimsRemoved messages.

This function is expected to be threadsafe.

Implements HdSceneIndexBase.

◆ GetPickingTaskPaths()

HDX_API SdfPathVector GetPickingTaskPaths ( ) const

Obtain paths to tasks managed by the task controller, for picking.

◆ GetPrim()

HDX_API HdSceneIndexPrim GetPrim ( const SdfPath primPath) const
overridevirtual

Returns a pair of (prim type, datasource).

A prim exists at primPath if and only if datasource is a non-null pointer. In particular, we consider the prim to exist even if the prim type or the container that datasource points to is empty.

Note that we require GetChildPrimPaths to be consistent with this notion of prim existence. That is, unless primPath is the absolute root path, the prim at primPath exists if and only if primPath is contained in GetChildPrimPaths of the parent path.

This function is expected to be threadsafe.

Implements HdSceneIndexBase.

◆ GetRenderBufferPath()

HDX_API SdfPath GetRenderBufferPath ( const TfToken aovName) const

Get the path to the buffer for a rendered output.

Note: the caller should call Resolve(), as HdxTaskController doesn't guarantee the buffer will be resolved.

◆ GetRenderingTaskPaths()

HDX_API SdfPathVector GetRenderingTaskPaths ( ) const

Obtain paths to the tasks managed by the task controller, for image generation.


Execution API The tasks returned will be different based on current renderer state.

◆ GetRenderOutputSettings()

HDX_API HdAovDescriptor GetRenderOutputSettings ( const TfToken aovName) const

Get parameters for an AOV.

◆ New()

static HDX_API HdxTaskControllerSceneIndexRefPtr New ( const Parameters params)
static

C'tor.

◆ SetBBoxParams()

HDX_API void SetBBoxParams ( const HdxBoundingBoxTaskParams params)

Set the bounding box params.


Bounding Box API

◆ SetCameraPath()

HDX_API void SetCameraPath ( const SdfPath path)

– Scene camera – Set the camera param on tasks to a USD camera path.

◆ SetCollection()

HDX_API void SetCollection ( const HdRprimCollection collection)

Set the collection to be rendered.


Rendering API

◆ SetColorCorrectionParams()

HDX_API void SetColorCorrectionParams ( const HdxColorCorrectionTaskParams params)

Configure color correction by settings params.


Color Correction API

◆ SetEnablePresentation()

HDX_API void SetEnablePresentation ( bool  enabled)

Enable / disable presenting the render to bound framebuffer.


Present API An application may choose to manage the AOVs that are rendered into itself and skip the task controller's presentation.

◆ SetEnableSelection()

HDX_API void SetEnableSelection ( bool  enable)

Turns the selection task on or off.


Selection API

◆ SetEnableShadows()

HDX_API void SetEnableShadows ( bool  enable)

Turns the shadow task on or off.


Shadow API

◆ SetFraming()

HDX_API void SetFraming ( const CameraUtilFraming framing)

Determines how the filmback of the camera is mapped into the pixels of the render buffer and what pixels of the render buffer will be rendered into.

◆ SetFreeCameraClipPlanes()

HDX_API void SetFreeCameraClipPlanes ( const std::vector< GfVec4d > &  clipPlanes)

Set the free camera clip planes.

(Note: Scene cameras use clipping planes authored on the camera prim)

◆ SetFreeCameraMatrices()

HDX_API void SetFreeCameraMatrices ( const GfMatrix4d viewMatrix,
const GfMatrix4d projectionMatrix 
)

– Free camera – Set the view and projection matrices for the free camera.

Note: The projection matrix must be pre-adjusted for the window policy.

◆ SetLightingState()

HDX_API void SetLightingState ( GlfSimpleLightingContextPtr const &  src)

Set the lighting state for the scene.


Lighting API HdxTaskControllerSceneIndex maintains a set of light sprims with data set from the lights in "src".

Parameters
srcLighting state to implement.

◆ SetOverrideWindowPolicy()

HDX_API void SetOverrideWindowPolicy ( const std::optional< CameraUtilConformWindowPolicy > &  policy)

Specifies whether to force a window policy when conforming the frustum of the camera to match the display window of the camera framing.

◆ SetPresentationOutput()

HDX_API void SetPresentationOutput ( const TfToken api,
const VtValue framebuffer 
)

The destination API (e.g., OpenGL, see hgiInterop for details) and framebuffer that the AOVs are presented into.

The framebuffer is a VtValue that encoding a framebuffer in a destination API specific way. E.g., a uint32_t (aka GLuint) for framebuffer object for OpenGL.

◆ SetRenderBufferSize()

HDX_API void SetRenderBufferSize ( const GfVec2i size)

Set the size of the render buffers backing the AOVs.


Camera and Framing API GUI applications should set this to the size of the window.

◆ SetRenderOutputs()

HDX_API void SetRenderOutputs ( const TfTokenVector aovNames)

Set the list of outputs to be rendered.


AOV API If outputs.size() == 1, this will send that output to the viewport via a colorizer task. Note: names should come from HdAovTokens.

◆ SetRenderOutputSettings()

HDX_API void SetRenderOutputSettings ( TfToken const &  aovName,
const HdAovDescriptor desc 
)

Set custom parameters for an AOV.

◆ SetRenderParams()

HDX_API void SetRenderParams ( const HdxRenderTaskParams params)

Set the render params.

Note: params.viewport will be overwritten, since it comes from SetRenderViewport. XXX: For GL renders, HdxTaskControllerSceneIndex relies on the caller to correctly set GL_SAMPLE_ALPHA_TO_COVERAGE.

◆ SetRenderTags()

HDX_API void SetRenderTags ( const TfTokenVector renderTags)

Set the "view" opinion of the scenes render tags.

The opinion is the base opinion for the entire scene. Individual tasks (such as the shadow task) may have a stronger opinion and override this opinion

◆ SetRenderViewport()

HDX_API void SetRenderViewport ( const GfVec4d viewport)

Set the viewport param on tasks.

Deprecated:
Use SetFraming and SetRenderBufferSize instead.

◆ SetSelectionColor()

HDX_API void SetSelectionColor ( const GfVec4f color)

Set the selection color.

◆ SetSelectionEnableOutline()

HDX_API void SetSelectionEnableOutline ( bool  enableOutline)

Set if the selection highlight should be rendered as an outline around the selected objects or as a solid color overlaid on top of them.

◆ SetSelectionLocateColor()

HDX_API void SetSelectionLocateColor ( const GfVec4f color)

Set the selection locate (over) color.

◆ SetSelectionOutlineRadius()

HDX_API void SetSelectionOutlineRadius ( unsigned int  radius)

Set the selection outline radius (thickness) in pixels.

This is only relevant if the highlight is meant to be rendered as an outline (if SetSelectionRenderOutline(true) is called).

◆ SetShadowParams()

HDX_API void SetShadowParams ( const HdxShadowTaskParams &  params)

Set the shadow params.

Note: params.camera will be overwritten, since it comes from SetCameraPath/SetCameraState.

◆ SetViewportRenderOutput()

HDX_API void SetViewportRenderOutput ( TfToken const &  aovName)

Set which output should be rendered to the viewport.

The empty token disables viewport rendering.

Friends And Related Function Documentation

◆ _Observer

friend class _Observer
friend

Definition at line 310 of file taskControllerSceneIndex.h.


The documentation for this class was generated from the following file: