Loading...
Searching...
No Matches
UsdImagingGLEngine Class Reference

The UsdImagingGLEngine is the main entry point API for rendering USD scenes. More...

#include <engine.h>

Classes

struct  Parameters
 Parameters to construct UsdImagingGLEngine. More...
 

Public Member Functions

Construction
USDIMAGINGGL_API UsdImagingGLEngine (const Parameters &params)
 
USDIMAGINGGL_API UsdImagingGLEngine (const HdDriver &driver=HdDriver(), const TfToken &rendererPluginId=TfToken(), bool gpuEnabled=true)
 An HdDriver, containing the Hgi of your choice, can be optionally passed in during construction.
 
USDIMAGINGGL_API UsdImagingGLEngine (const SdfPath &rootPath, const SdfPathVector &excludedPaths, const SdfPathVector &invisedPaths=SdfPathVector(), const SdfPath &sceneDelegateID=SdfPath::AbsoluteRootPath(), const HdDriver &driver=HdDriver(), const TfToken &rendererPluginId=TfToken(), bool gpuEnabled=true, bool displayUnloadedPrimsWithBounds=false, bool allowAsynchronousSceneProcessing=false)
 
 UsdImagingGLEngine (const UsdImagingGLEngine &)=delete
 
UsdImagingGLEngineoperator= (const UsdImagingGLEngine &)=delete
 
USDIMAGINGGL_API ~UsdImagingGLEngine ()
 
Rendering
USDIMAGINGGL_API void PrepareBatch (const UsdPrim &root, const UsdImagingGLRenderParams &params)
 Support for batched drawing.
 
USDIMAGINGGL_API void RenderBatch (const SdfPathVector &paths, const UsdImagingGLRenderParams &params)
 
USDIMAGINGGL_API void Render (const UsdPrim &root, const UsdImagingGLRenderParams &params)
 Entry point for kicking off a render.
 
USDIMAGINGGL_API bool IsConverged () const
 Returns true if the resulting image is fully converged.
 
Root Transform and Visibility
USDIMAGINGGL_API void SetRootTransform (GfMatrix4d const &xf)
 Sets the root transform.
 
USDIMAGINGGL_API void SetRootVisibility (bool isVisible)
 Sets the root visibility.
 
Camera State
USDIMAGINGGL_API void SetCameraPath (SdfPath const &id)
 Scene camera API Set the scene camera path to use for rendering.
 
USDIMAGINGGL_API void SetFraming (CameraUtilFraming const &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.
 
USDIMAGINGGL_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.
 
USDIMAGINGGL_API void SetRenderBufferSize (GfVec2i const &size)
 Set the size of the render buffers baking the AOVs.
 
USDIMAGINGGL_API void SetRenderViewport (GfVec4d const &viewport)
 Set the viewport to use for rendering as (x,y,w,h), where (x,y) represents the lower left corner of the viewport rectangle, and (w,h) is the width and height of the viewport in pixels.
 
USDIMAGINGGL_API void SetWindowPolicy (CameraUtilConformWindowPolicy policy)
 Set the window policy to use.
 
USDIMAGINGGL_API void SetCameraState (const GfMatrix4d &viewMatrix, const GfMatrix4d &projectionMatrix)
 Free camera API Set camera framing state directly (without pointing to a camera on the USD stage).
 
Light State
USDIMAGINGGL_API void SetLightingState (GlfSimpleLightingContextPtr const &src)
 Copy lighting state from another lighting context.
 
USDIMAGINGGL_API void SetLightingState (GlfSimpleLightVector const &lights, GlfSimpleMaterial const &material, GfVec4f const &sceneAmbient)
 Set lighting state Derived classes should ensure that passing an empty lights vector disables lighting.
 
Selection Highlighting
USDIMAGINGGL_API void SetSelected (SdfPathVector const &paths)
 Sets (replaces) the list of prim paths that should be included in selection highlighting.
 
USDIMAGINGGL_API void ClearSelected ()
 Clear the list of prim paths that should be included in selection highlighting.
 
USDIMAGINGGL_API void AddSelected (SdfPath const &path, int instanceIndex)
 Add a path with instanceIndex to the list of prim paths that should be included in selection highlighting.
 
USDIMAGINGGL_API void SetSelectionColor (GfVec4f const &color)
 Sets the selection highlighting color.
 
Picking
USDIMAGINGGL_API bool TestIntersection (const GfMatrix4d &viewMatrix, const GfMatrix4d &projectionMatrix, const UsdPrim &root, const UsdImagingGLRenderParams &params, GfVec3d *outHitPoint, GfVec3d *outHitNormal, SdfPath *outHitPrimPath=NULL, SdfPath *outHitInstancerPath=NULL, int *outHitInstanceIndex=NULL, HdInstancerContext *outInstancerContext=NULL)
 Finds closest point of intersection with a frustum by rendering.
 
USDIMAGINGGL_API bool DecodeIntersection (unsigned char const primIdColor[4], unsigned char const instanceIdColor[4], SdfPath *outHitPrimPath=NULL, SdfPath *outHitInstancerPath=NULL, int *outHitInstanceIndex=NULL, HdInstancerContext *outInstancerContext=NULL)
 Decodes a pick result given hydra prim ID/instance ID (like you'd get from an ID render).
 
AOVs
USDIMAGINGGL_API TfTokenVector GetRendererAovs () const
 Return the vector of available renderer AOV settings.
 
USDIMAGINGGL_API bool SetRendererAov (TfToken const &id)
 Set the current renderer AOV to id.
 
USDIMAGINGGL_API HgiTextureHandle GetAovTexture (TfToken const &name) const
 Returns an AOV texture handle for the given token.
 
USDIMAGINGGL_API HdRenderBufferGetAovRenderBuffer (TfToken const &name) const
 Returns the AOV render buffer for the given token.
 
Render Settings (Legacy)
USDIMAGINGGL_API UsdImagingGLRendererSettingsList GetRendererSettingsList () const
 Returns the list of renderer settings.
 
USDIMAGINGGL_API VtValue GetRendererSetting (TfToken const &id) const
 Gets a renderer setting's current value.
 
USDIMAGINGGL_API void SetRendererSetting (TfToken const &id, VtValue const &value)
 Sets a renderer setting's value.
 
Presentation
USDIMAGINGGL_API void SetEnablePresentation (bool enabled)
 Enable / disable presenting the render to bound framebuffer.
 
USDIMAGINGGL_API void SetPresentationOutput (TfToken const &api, VtValue const &framebuffer)
 The destination API (e.g., OpenGL, see hgiInterop for details) and framebuffer that the AOVs are presented into.
 
Renderer Command API
USDIMAGINGGL_API HdCommandDescriptors GetRendererCommandDescriptors () const
 Return command deescriptors for commands supported by the active render delegate.
 
USDIMAGINGGL_API bool InvokeRendererCommand (const TfToken &command, const HdCommandArgs &args=HdCommandArgs()) const
 Invokes command on the active render delegate.
 
Control of background rendering threads.
USDIMAGINGGL_API bool IsPauseRendererSupported () const
 Query the renderer as to whether it supports pausing and resuming.
 
USDIMAGINGGL_API bool PauseRenderer ()
 Pause the renderer.
 
USDIMAGINGGL_API bool ResumeRenderer ()
 Resume the renderer.
 
USDIMAGINGGL_API bool IsStopRendererSupported () const
 Query the renderer as to whether it supports stopping and restarting.
 
USDIMAGINGGL_API bool StopRenderer ()
 Stop the renderer.
 
USDIMAGINGGL_API bool RestartRenderer ()
 Restart the renderer.
 
Color Correction
USDIMAGINGGL_API void SetColorCorrectionSettings (TfToken const &ccType, TfToken const &ocioDisplay={}, TfToken const &ocioView={}, TfToken const &ocioColorSpace={}, TfToken const &ocioLook={})
 Set ccType to one of the HdxColorCorrectionTokens: {disabled, sRGB, openColorIO}.
 
Render Statistics
USDIMAGINGGL_API VtDictionary GetRenderStats () const
 Returns render statistics.
 
HGI
USDIMAGINGGL_API HgiGetHgi ()
 Returns the HGI interface.
 
Asynchronous
USDIMAGINGGL_API bool PollForAsynchronousUpdates () const
 If allowAsynchronousSceneProcessing is true within the Parameters provided to the UsdImagingGLEngine constructor, an application can periodically call this from the main thread.
 

Static Public Member Functions

static USDIMAGINGGL_API bool IsColorCorrectionCapable ()
 Returns true if the platform is color correction capable.
 

Protected Types

using BBoxVector = std::vector< GfBBox3d >
 

Protected Member Functions

USDIMAGINGGL_API HdRenderIndex_GetRenderIndex () const
 Returns the render index of the engine, if any.
 
USDIMAGINGGL_API void _Execute (const UsdImagingGLRenderParams &params, HdTaskSharedPtrVector tasks)
 
USDIMAGINGGL_API bool _CanPrepare (const UsdPrim &root)
 
USDIMAGINGGL_API void _PreSetTime (const UsdImagingGLRenderParams &params)
 
USDIMAGINGGL_API void _PostSetTime (const UsdImagingGLRenderParams &params)
 
USDIMAGINGGL_API void _PrepareRender (const UsdImagingGLRenderParams &params)
 
USDIMAGINGGL_API void _SetActiveRenderSettingsPrimFromStageMetadata (UsdStageWeakPtr stage)
 
USDIMAGINGGL_API void _UpdateDomeLightCameraVisibility ()
 
USDIMAGINGGL_API void _SetBBoxParams (const BBoxVector &bboxes, const GfVec4f &bboxLineColor, float bboxLineDashSize)
 
USDIMAGINGGL_API void _InitializeHgiIfNecessary ()
 
USDIMAGINGGL_API void _SetRenderDelegateAndRestoreState (HdPluginRenderDelegateUniqueHandle &&)
 
USDIMAGINGGL_API void _SetRenderDelegate (HdPluginRenderDelegateUniqueHandle &&)
 
USDIMAGINGGL_API SdfPath _ComputeControllerPath (const HdPluginRenderDelegateUniqueHandle &)
 
USDIMAGINGGL_API UsdImagingDelegate_GetSceneDelegate () const
 Get a direct pointer to the scene delegate.
 
USDIMAGINGGL_API HdEngine_GetHdEngine ()
 
USDIMAGINGGL_API HdxTaskController * _GetTaskController () const
 
USDIMAGINGGL_API HdSelectionSharedPtr _GetSelection () const
 

Static Protected Member Functions

static USDIMAGINGGL_API bool _UpdateHydraCollection (HdRprimCollection *collection, SdfPathVector const &roots, UsdImagingGLRenderParams const &params)
 
static USDIMAGINGGL_API HdxRenderTaskParams _MakeHydraUsdImagingGLRenderParams (UsdImagingGLRenderParams const &params)
 
static USDIMAGINGGL_API void _ComputeRenderTags (UsdImagingGLRenderParams const &params, TfTokenVector *renderTags)
 
static USDIMAGINGGL_API TfToken _GetDefaultRendererPluginId ()
 

Protected Attributes

HgiUniquePtr _hgi
 
HdDriver _hgiDriver
 
VtValue _userFramebuffer
 
bool _displayUnloadedPrimsWithBounds
 
bool _gpuEnabled
 
HdPluginRenderDelegateUniqueHandle _renderDelegate
 
std::unique_ptr< HdRenderIndex_renderIndex
 
SdfPath const _sceneDelegateId
 
std::unique_ptr< HdxTaskController > _taskController
 
HdxSelectionTrackerSharedPtr _selTracker
 
HdRprimCollection _renderCollection
 
HdRprimCollection _intersectCollection
 
GlfSimpleLightingContextRefPtr _lightingContextForOpenGLState
 
GfVec4f _selectionColor
 
bool _domeLightCameraVisibility
 
SdfPath _rootPath
 
SdfPathVector _excludedPrimPaths
 
SdfPathVector _invisedPrimPaths
 
bool _isPopulated
 

Renderer Plugin Management

USDIMAGINGGL_API bool GetGPUEnabled () const
 Return if the GPU is enabled and can be used for any rendering tasks.
 
USDIMAGINGGL_API TfToken GetCurrentRendererId () const
 Return the id of the currently used renderer plugin.
 
USDIMAGINGGL_API bool SetRendererPlugin (TfToken const &id)
 Set the current render-graph delegate to id.
 
static USDIMAGINGGL_API TfTokenVector GetRendererPlugins ()
 Return the vector of available render-graph delegate plugins.
 
static USDIMAGINGGL_API std::string GetRendererDisplayName (TfToken const &id)
 Return the user-friendly description of a renderer plugin.
 

Render Settings (Scene description driven)

Note
Support is WIP.
USDIMAGINGGL_API void SetActiveRenderSettingsPrimPath (SdfPath const &)
 Set active render settings prim to use to drive rendering.
 
static USDIMAGINGGL_API SdfPathVector GetAvailableRenderSettingsPrimPaths (UsdPrim const &root)
 Utility method to query available render settings prims.
 

Detailed Description

The UsdImagingGLEngine is the main entry point API for rendering USD scenes.

Definition at line 95 of file engine.h.


Class Documentation

◆ UsdImagingGLEngine::Parameters

struct UsdImagingGLEngine::Parameters

Parameters to construct UsdImagingGLEngine.

Definition at line 99 of file engine.h.

Class Members
bool allowAsynchronousSceneProcessing = false allowAsynchronousSceneProcessing indicates to constructed hydra scene indices that asynchronous processing is allowow.

Applications should perodically call PollForAsynchronousUpdates on the engine.

bool displayUnloadedPrimsWithBounds = false displayUnloadedPrimsWithBounds draws bounding boxes for unloaded prims if they have extents/extentsHint authored.
HdDriver driver An HdDriver, containing the Hgi of your choice, can be optionally passed in during construction.

This can be helpful if your application creates multiple UsdImagingGLEngine's that wish to use the same HdDriver / Hgi.

SdfPathVector excludedPaths
bool gpuEnabled = true The gpuEnabled argument determines if this instance will allow Hydra to use the GPU to produce images.
SdfPathVector invisedPaths
TfToken rendererPluginId The rendererPluginId argument indicates the renderer plugin that Hydra should use.

If the empty token is passed in, a default renderer plugin will be chosen depending on the value of gpuEnabled.

SdfPath rootPath = SdfPath::AbsoluteRootPath()
SdfPath sceneDelegateID = SdfPath::AbsoluteRootPath()

Member Typedef Documentation

◆ BBoxVector

using BBoxVector = std::vector<GfBBox3d>
protected

Definition at line 635 of file engine.h.

Constructor & Destructor Documentation

◆ UsdImagingGLEngine()

USDIMAGINGGL_API UsdImagingGLEngine ( const HdDriver driver = HdDriver(),
const TfToken rendererPluginId = TfToken(),
bool  gpuEnabled = true 
)

An HdDriver, containing the Hgi of your choice, can be optionally passed in during construction.

This can be helpful if you application creates multiple UsdImagingGLEngine that wish to use the same HdDriver / Hgi. The rendererPluginId argument indicates the renderer plugin that Hyrda should use. If the empty token is passed in, a default renderer plugin will be chosen depending on the value of gpuEnabled. The gpuEnabled argument determines if this instance will allow Hydra to use the GPU to produce images.

Member Function Documentation

◆ _GetRenderIndex()

USDIMAGINGGL_API HdRenderIndex * _GetRenderIndex ( ) const
protected

Returns the render index of the engine, if any.

This is only used for whitebox testing.

◆ _GetSceneDelegate()

USDIMAGINGGL_API UsdImagingDelegate * _GetSceneDelegate ( ) const
protected

Get a direct pointer to the scene delegate.

Deprecated:
Existing instances of this call will be replaced with new APIs on this class, to support multiplexing between the scene delegate and scene index. This API is scheduled for deletion.

◆ AddSelected()

USDIMAGINGGL_API void AddSelected ( SdfPath const &  path,
int  instanceIndex 
)

Add a path with instanceIndex to the list of prim paths that should be included in selection highlighting.

UsdImagingDelegate::ALL_INSTANCES can be used for highlighting all instances if path is an instancer.

◆ ClearSelected()

USDIMAGINGGL_API void ClearSelected ( )

Clear the list of prim paths that should be included in selection highlighting.

◆ DecodeIntersection()

USDIMAGINGGL_API bool DecodeIntersection ( unsigned char const  primIdColor[4],
unsigned char const  instanceIdColor[4],
SdfPath outHitPrimPath = NULL,
SdfPath outHitInstancerPath = NULL,
int *  outHitInstanceIndex = NULL,
HdInstancerContext *  outInstancerContext = NULL 
)

Decodes a pick result given hydra prim ID/instance ID (like you'd get from an ID render).

◆ GetAovRenderBuffer()

USDIMAGINGGL_API HdRenderBuffer * GetAovRenderBuffer ( TfToken const &  name) const

Returns the AOV render buffer for the given token.

◆ GetAovTexture()

USDIMAGINGGL_API HgiTextureHandle GetAovTexture ( TfToken const &  name) const

Returns an AOV texture handle for the given token.

◆ GetAvailableRenderSettingsPrimPaths()

static USDIMAGINGGL_API SdfPathVector GetAvailableRenderSettingsPrimPaths ( UsdPrim const &  root)
static

Utility method to query available render settings prims.

◆ GetCurrentRendererId()

USDIMAGINGGL_API TfToken GetCurrentRendererId ( ) const

Return the id of the currently used renderer plugin.

◆ GetGPUEnabled()

USDIMAGINGGL_API bool GetGPUEnabled ( ) const

Return if the GPU is enabled and can be used for any rendering tasks.

◆ GetHgi()

USDIMAGINGGL_API Hgi * GetHgi ( )

Returns the HGI interface.

◆ GetRendererAovs()

USDIMAGINGGL_API TfTokenVector GetRendererAovs ( ) const

Return the vector of available renderer AOV settings.

◆ GetRendererCommandDescriptors()

USDIMAGINGGL_API HdCommandDescriptors GetRendererCommandDescriptors ( ) const

Return command deescriptors for commands supported by the active render delegate.

◆ GetRendererDisplayName()

static USDIMAGINGGL_API std::string GetRendererDisplayName ( TfToken const &  id)
static

Return the user-friendly description of a renderer plugin.

◆ GetRendererPlugins()

static USDIMAGINGGL_API TfTokenVector GetRendererPlugins ( )
static

Return the vector of available render-graph delegate plugins.

◆ GetRendererSetting()

USDIMAGINGGL_API VtValue GetRendererSetting ( TfToken const &  id) const

Gets a renderer setting's current value.

◆ GetRendererSettingsList()

USDIMAGINGGL_API UsdImagingGLRendererSettingsList GetRendererSettingsList ( ) const

Returns the list of renderer settings.

◆ GetRenderStats()

USDIMAGINGGL_API VtDictionary GetRenderStats ( ) const

Returns render statistics.

The contents of the dictionary will depend on the current render delegate.

◆ InvokeRendererCommand()

USDIMAGINGGL_API bool InvokeRendererCommand ( const TfToken command,
const HdCommandArgs args = HdCommandArgs() 
) const

Invokes command on the active render delegate.

If successful, returns true, returns false otherwise. Note that the command will not succeeed if it is not among those returned by GetRendererCommandDescriptors() for the same active render delegate.

◆ IsColorCorrectionCapable()

static USDIMAGINGGL_API bool IsColorCorrectionCapable ( )
static

Returns true if the platform is color correction capable.

◆ IsConverged()

USDIMAGINGGL_API bool IsConverged ( ) const

Returns true if the resulting image is fully converged.

(otherwise, caller may need to call Render() again to refine the result)

◆ IsPauseRendererSupported()

USDIMAGINGGL_API bool IsPauseRendererSupported ( ) const

Query the renderer as to whether it supports pausing and resuming.

◆ IsStopRendererSupported()

USDIMAGINGGL_API bool IsStopRendererSupported ( ) const

Query the renderer as to whether it supports stopping and restarting.

◆ PauseRenderer()

USDIMAGINGGL_API bool PauseRenderer ( )

Pause the renderer.

Returns true if successful.

◆ PollForAsynchronousUpdates()

USDIMAGINGGL_API bool PollForAsynchronousUpdates ( ) const

If allowAsynchronousSceneProcessing is true within the Parameters provided to the UsdImagingGLEngine constructor, an application can periodically call this from the main thread.

A return value of true indicates that the scene has changed and the render should be updated.

◆ PrepareBatch()

USDIMAGINGGL_API void PrepareBatch ( const UsdPrim root,
const UsdImagingGLRenderParams params 
)

Support for batched drawing.

◆ Render()

USDIMAGINGGL_API void Render ( const UsdPrim root,
const UsdImagingGLRenderParams params 
)

Entry point for kicking off a render.

◆ RestartRenderer()

USDIMAGINGGL_API bool RestartRenderer ( )

Restart the renderer.

Returns true if successful.

◆ ResumeRenderer()

USDIMAGINGGL_API bool ResumeRenderer ( )

Resume the renderer.

Returns true if successful.

◆ SetActiveRenderSettingsPrimPath()

USDIMAGINGGL_API void SetActiveRenderSettingsPrimPath ( SdfPath const &  )

Set active render settings prim to use to drive rendering.

◆ SetCameraPath()

USDIMAGINGGL_API void SetCameraPath ( SdfPath const &  id)

Scene camera API Set the scene camera path to use for rendering.

◆ SetCameraState()

USDIMAGINGGL_API void SetCameraState ( const GfMatrix4d viewMatrix,
const GfMatrix4d projectionMatrix 
)

Free camera API Set camera framing state directly (without pointing to a camera on the USD stage).

The projection matrix is expected to be pre-adjusted for the window policy.

◆ SetColorCorrectionSettings()

USDIMAGINGGL_API void SetColorCorrectionSettings ( TfToken const &  ccType,
TfToken const &  ocioDisplay = {},
TfToken const &  ocioView = {},
TfToken const &  ocioColorSpace = {},
TfToken const &  ocioLook = {} 
)

Set ccType to one of the HdxColorCorrectionTokens: {disabled, sRGB, openColorIO}.

If 'openColorIO' is used, ocioDisplay, ocioView, ocioColorSpace and ocioLook are options the client may supply to configure OCIO. ocioColorSpace refers to the input (source) color space. The default value is substituted if an option isn't specified. You can find the values for these strings inside the profile/config .ocio file. For example:

displays: rec709g22: !<View> {name: studio, colorspace: linear, looks: studio_65_lg2}

◆ SetEnablePresentation()

USDIMAGINGGL_API void SetEnablePresentation ( bool  enabled)

Enable / disable presenting the render to bound framebuffer.

An application may choose to manage the AOVs that are rendered into itself and skip the engine's presentation.

◆ SetFraming()

USDIMAGINGGL_API void SetFraming ( CameraUtilFraming const &  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.

◆ SetLightingState() [1/2]

USDIMAGINGGL_API void SetLightingState ( GlfSimpleLightingContextPtr const &  src)

Copy lighting state from another lighting context.

◆ SetLightingState() [2/2]

USDIMAGINGGL_API void SetLightingState ( GlfSimpleLightVector const &  lights,
GlfSimpleMaterial const &  material,
GfVec4f const &  sceneAmbient 
)

Set lighting state Derived classes should ensure that passing an empty lights vector disables lighting.

Parameters
lightsis the set of lights to use, or empty to disable lighting.

◆ SetOverrideWindowPolicy()

USDIMAGINGGL_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.

If set to {false, ...}, the window policy of the specified camera will be used.

Note: std::pair<bool, ...> is used instead of std::optional<...> because the latter is only available in C++17 or later.

◆ SetPresentationOutput()

USDIMAGINGGL_API void SetPresentationOutput ( TfToken const &  api,
VtValue const &  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()

USDIMAGINGGL_API void SetRenderBufferSize ( GfVec2i const &  size)

Set the size of the render buffers baking the AOVs.

GUI applications should set this to the size of the window.

◆ SetRendererAov()

USDIMAGINGGL_API bool SetRendererAov ( TfToken const &  id)

Set the current renderer AOV to id.

◆ SetRendererPlugin()

USDIMAGINGGL_API bool SetRendererPlugin ( TfToken const &  id)

Set the current render-graph delegate to id.

the plugin will be loaded if it's not yet.

◆ SetRendererSetting()

USDIMAGINGGL_API void SetRendererSetting ( TfToken const &  id,
VtValue const &  value 
)

Sets a renderer setting's value.

◆ SetRenderViewport()

USDIMAGINGGL_API void SetRenderViewport ( GfVec4d const &  viewport)

Set the viewport to use for rendering as (x,y,w,h), where (x,y) represents the lower left corner of the viewport rectangle, and (w,h) is the width and height of the viewport in pixels.

Deprecated:
Use SetFraming and SetRenderBufferSize instead.

◆ SetRootTransform()

USDIMAGINGGL_API void SetRootTransform ( GfMatrix4d const &  xf)

Sets the root transform.

◆ SetRootVisibility()

USDIMAGINGGL_API void SetRootVisibility ( bool  isVisible)

Sets the root visibility.

◆ SetSelected()

USDIMAGINGGL_API void SetSelected ( SdfPathVector const &  paths)

Sets (replaces) the list of prim paths that should be included in selection highlighting.

These paths may include root paths which will be expanded internally.

◆ SetSelectionColor()

USDIMAGINGGL_API void SetSelectionColor ( GfVec4f const &  color)

Sets the selection highlighting color.

◆ SetWindowPolicy()

USDIMAGINGGL_API void SetWindowPolicy ( CameraUtilConformWindowPolicy  policy)

Set the window policy to use.

XXX: This is currently used for scene cameras set via SetCameraPath. See comment in SetCameraState for the free cam.

◆ StopRenderer()

USDIMAGINGGL_API bool StopRenderer ( )

Stop the renderer.

Returns true if successful.

◆ TestIntersection()

USDIMAGINGGL_API bool TestIntersection ( const GfMatrix4d viewMatrix,
const GfMatrix4d projectionMatrix,
const UsdPrim root,
const UsdImagingGLRenderParams params,
GfVec3d outHitPoint,
GfVec3d outHitNormal,
SdfPath outHitPrimPath = NULL,
SdfPath outHitInstancerPath = NULL,
int *  outHitInstanceIndex = NULL,
HdInstancerContext *  outInstancerContext = NULL 
)

Finds closest point of intersection with a frustum by rendering.

This method uses a PickRender and a customized depth buffer to find an approximate point of intersection by rendering. This is less accurate than implicit methods or rendering with GL_SELECT, but leverages any data already cached in the renderer.

Returns whether a hit occurred and if so, outHitPoint will contain the intersection point in world space (i.e. projectionMatrix and viewMatrix factored back out of the result), and outHitNormal will contain the world space normal at that point.

outHitPrimPath will point to the gprim selected by the pick. outHitInstancerPath will point to the point instancer (if applicable) of that gprim. For nested instancing, outHitInstancerPath points to the closest instancer.

Member Data Documentation

◆ _displayUnloadedPrimsWithBounds

bool _displayUnloadedPrimsWithBounds
protected

Definition at line 702 of file engine.h.

◆ _domeLightCameraVisibility

bool _domeLightCameraVisibility
protected

Definition at line 719 of file engine.h.

◆ _excludedPrimPaths

SdfPathVector _excludedPrimPaths
protected

Definition at line 722 of file engine.h.

◆ _gpuEnabled

bool _gpuEnabled
protected

Definition at line 703 of file engine.h.

◆ _hgi

HgiUniquePtr _hgi
protected

Definition at line 695 of file engine.h.

◆ _hgiDriver

HdDriver _hgiDriver
protected

Definition at line 697 of file engine.h.

◆ _intersectCollection

HdRprimCollection _intersectCollection
protected

Definition at line 713 of file engine.h.

◆ _invisedPrimPaths

SdfPathVector _invisedPrimPaths
protected

Definition at line 723 of file engine.h.

◆ _isPopulated

bool _isPopulated
protected

Definition at line 724 of file engine.h.

◆ _lightingContextForOpenGLState

GlfSimpleLightingContextRefPtr _lightingContextForOpenGLState
protected

Definition at line 715 of file engine.h.

◆ _renderCollection

HdRprimCollection _renderCollection
protected

Definition at line 712 of file engine.h.

◆ _renderDelegate

HdPluginRenderDelegateUniqueHandle _renderDelegate
protected

Definition at line 704 of file engine.h.

◆ _renderIndex

std::unique_ptr<HdRenderIndex> _renderIndex
protected

Definition at line 705 of file engine.h.

◆ _rootPath

SdfPath _rootPath
protected

Definition at line 721 of file engine.h.

◆ _sceneDelegateId

SdfPath const _sceneDelegateId
protected

Definition at line 707 of file engine.h.

◆ _selectionColor

GfVec4f _selectionColor
protected

Definition at line 718 of file engine.h.

◆ _selTracker

HdxSelectionTrackerSharedPtr _selTracker
protected

Definition at line 711 of file engine.h.

◆ _taskController

std::unique_ptr<HdxTaskController> _taskController
protected

Definition at line 709 of file engine.h.

◆ _userFramebuffer

VtValue _userFramebuffer
protected

Definition at line 699 of file engine.h.


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