HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UsdImagingGLEngine Class Reference

#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)
 
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)
 
 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. More...
 
USDIMAGINGGL_API void RenderBatch (const SdfPathVector &paths, const UsdImagingGLRenderParams &params)
 Support for batched drawing. More...
 
USDIMAGINGGL_API void Render (const UsdPrim &root, const UsdImagingGLRenderParams &params)
 Entry point for kicking off a render. More...
 
USDIMAGINGGL_API bool IsConverged () const
 
Root Transform and Visibility
USDIMAGINGGL_API void SetRootTransform (GfMatrix4d const &xf)
 Sets the root transform. More...
 
USDIMAGINGGL_API void SetRootVisibility (bool isVisible)
 Sets the root visibility. More...
 
Camera State
USDIMAGINGGL_API void SetCameraPath (SdfPath const &id)
 
USDIMAGINGGL_API void SetFraming (CameraUtilFraming const &framing)
 
USDIMAGINGGL_API void SetOverrideWindowPolicy (const std::pair< bool, CameraUtilConformWindowPolicy > &policy)
 
USDIMAGINGGL_API void SetRenderBufferSize (GfVec2i const &size)
 
USDIMAGINGGL_API void SetRenderViewport (GfVec4d const &viewport)
 
USDIMAGINGGL_API void SetWindowPolicy (CameraUtilConformWindowPolicy policy)
 
USDIMAGINGGL_API void SetCameraState (const GfMatrix4d &viewMatrix, const GfMatrix4d &projectionMatrix)
 
Light State
USDIMAGINGGL_API void SetLightingState (GlfSimpleLightingContextPtr const &src)
 Copy lighting state from another lighting context. More...
 
USDIMAGINGGL_API void SetLightingState (GlfSimpleLightVector const &lights, GlfSimpleMaterial const &material, GfVec4f const &sceneAmbient)
 
Selection Highlighting
USDIMAGINGGL_API void SetSelected (SdfPathVector const &paths)
 
USDIMAGINGGL_API void ClearSelected ()
 
USDIMAGINGGL_API void AddSelected (SdfPath const &path, int instanceIndex)
 
USDIMAGINGGL_API void SetSelectionColor (GfVec4f const &color)
 Sets the selection highlighting color. More...
 
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)
 
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)
 
AOVs
USDIMAGINGGL_API TfTokenVector GetRendererAovs () const
 Return the vector of available renderer AOV settings. More...
 
USDIMAGINGGL_API bool SetRendererAov (TfToken const &id)
 Set the current renderer AOV to id. More...
 
USDIMAGINGGL_API HgiTextureHandle GetAovTexture (TfToken const &name) const
 Returns an AOV texture handle for the given token. More...
 
USDIMAGINGGL_API HdRenderBufferGetAovRenderBuffer (TfToken const &name) const
 Returns the AOV render buffer for the given token. More...
 
Render Settings (Legacy)
USDIMAGINGGL_API
UsdImagingGLRendererSettingsList 
GetRendererSettingsList () const
 Returns the list of renderer settings. More...
 
USDIMAGINGGL_API VtValue GetRendererSetting (TfToken const &id) const
 Gets a renderer setting's current value. More...
 
USDIMAGINGGL_API void SetRendererSetting (TfToken const &id, VtValue const &value)
 Sets a renderer setting's value. More...
 
Presentation
USDIMAGINGGL_API void SetEnablePresentation (bool enabled)
 
USDIMAGINGGL_API void SetPresentationOutput (TfToken const &api, VtValue const &framebuffer)
 
Renderer Command API
USDIMAGINGGL_API
HdCommandDescriptors 
GetRendererCommandDescriptors () const
 
USDIMAGINGGL_API bool InvokeRendererCommand (const TfToken &command, const HdCommandArgs &args=HdCommandArgs()) const
 
Control of background rendering threads.
USDIMAGINGGL_API bool IsPauseRendererSupported () const
 Query the renderer as to whether it supports pausing and resuming. More...
 
USDIMAGINGGL_API bool PauseRenderer ()
 
USDIMAGINGGL_API bool ResumeRenderer ()
 
USDIMAGINGGL_API bool IsStopRendererSupported () const
 Query the renderer as to whether it supports stopping and restarting. More...
 
USDIMAGINGGL_API bool StopRenderer ()
 
USDIMAGINGGL_API bool RestartRenderer ()
 
Color Correction
USDIMAGINGGL_API void SetColorCorrectionSettings (TfToken const &ccType, TfToken const &ocioDisplay={}, TfToken const &ocioView={}, TfToken const &ocioColorSpace={}, TfToken const &ocioLook={})
 
Render Statistics
USDIMAGINGGL_API VtDictionary GetRenderStats () const
 
HGI
USDIMAGINGGL_API HgiGetHgi ()
 

Static Public Member Functions

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

Protected Types

using BBoxVector = std::vector< GfBBox3d >
 

Protected Member Functions

USDIMAGINGGL_API HdRenderIndex_GetRenderIndex () const
 
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
 
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
 

Friends

class UsdImagingGL_UnitTestGLDrawing
 Open some protected methods for whitebox testing. More...
 

Renderer Plugin Management

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

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. More...
 
static USDIMAGINGGL_API
SdfPathVector 
GetAvailableRenderSettingsPrimPaths (UsdPrim const &root)
 Utility method to query available render settings prims. More...
 

Detailed Description

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

Definition at line 95 of file engine.h.

Member Typedef Documentation

using UsdImagingGLEngine::BBoxVector = std::vector<GfBBox3d>
protected

Definition at line 614 of file engine.h.

Constructor & Destructor Documentation

USDIMAGINGGL_API UsdImagingGLEngine::UsdImagingGLEngine ( const Parameters params)

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.

USDIMAGINGGL_API UsdImagingGLEngine::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.

USDIMAGINGGL_API UsdImagingGLEngine::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 
)

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.

UsdImagingGLEngine::UsdImagingGLEngine ( const UsdImagingGLEngine )
delete

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.

USDIMAGINGGL_API UsdImagingGLEngine::~UsdImagingGLEngine ( )

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

USDIMAGINGGL_API bool UsdImagingGLEngine::_CanPrepare ( const UsdPrim root)
protected
USDIMAGINGGL_API SdfPath UsdImagingGLEngine::_ComputeControllerPath ( const HdPluginRenderDelegateUniqueHandle )
protected
static USDIMAGINGGL_API void UsdImagingGLEngine::_ComputeRenderTags ( UsdImagingGLRenderParams const params,
TfTokenVector renderTags 
)
staticprotected
USDIMAGINGGL_API void UsdImagingGLEngine::_Execute ( const UsdImagingGLRenderParams params,
HdTaskSharedPtrVector  tasks 
)
protected
static USDIMAGINGGL_API TfToken UsdImagingGLEngine::_GetDefaultRendererPluginId ( )
staticprotected
USDIMAGINGGL_API HdEngine* UsdImagingGLEngine::_GetHdEngine ( )
protected
USDIMAGINGGL_API HdRenderIndex* UsdImagingGLEngine::_GetRenderIndex ( ) const
protected

Returns the render index of the engine, if any. This is only used for whitebox testing.

USDIMAGINGGL_API UsdImagingDelegate* UsdImagingGLEngine::_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.
USDIMAGINGGL_API HdSelectionSharedPtr UsdImagingGLEngine::_GetSelection ( ) const
protected
USDIMAGINGGL_API HdxTaskController* UsdImagingGLEngine::_GetTaskController ( ) const
protected
USDIMAGINGGL_API void UsdImagingGLEngine::_InitializeHgiIfNecessary ( )
protected
static USDIMAGINGGL_API HdxRenderTaskParams UsdImagingGLEngine::_MakeHydraUsdImagingGLRenderParams ( UsdImagingGLRenderParams const params)
staticprotected
USDIMAGINGGL_API void UsdImagingGLEngine::_PostSetTime ( const UsdImagingGLRenderParams params)
protected
USDIMAGINGGL_API void UsdImagingGLEngine::_PrepareRender ( const UsdImagingGLRenderParams params)
protected
USDIMAGINGGL_API void UsdImagingGLEngine::_PreSetTime ( const UsdImagingGLRenderParams params)
protected
USDIMAGINGGL_API void UsdImagingGLEngine::_SetActiveRenderSettingsPrimFromStageMetadata ( UsdStageWeakPtr  stage)
protected
USDIMAGINGGL_API void UsdImagingGLEngine::_SetBBoxParams ( const BBoxVector bboxes,
const GfVec4f bboxLineColor,
float  bboxLineDashSize 
)
protected
USDIMAGINGGL_API void UsdImagingGLEngine::_SetRenderDelegate ( HdPluginRenderDelegateUniqueHandle &&  )
protected
USDIMAGINGGL_API void UsdImagingGLEngine::_SetRenderDelegateAndRestoreState ( HdPluginRenderDelegateUniqueHandle &&  )
protected
USDIMAGINGGL_API void UsdImagingGLEngine::_UpdateDomeLightCameraVisibility ( )
protected
static USDIMAGINGGL_API bool UsdImagingGLEngine::_UpdateHydraCollection ( HdRprimCollection collection,
SdfPathVector const roots,
UsdImagingGLRenderParams const params 
)
staticprotected
USDIMAGINGGL_API void UsdImagingGLEngine::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.

USDIMAGINGGL_API void UsdImagingGLEngine::ClearSelected ( )

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

USDIMAGINGGL_API bool UsdImagingGLEngine::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).

USDIMAGINGGL_API HdRenderBuffer* UsdImagingGLEngine::GetAovRenderBuffer ( TfToken const name) const

Returns the AOV render buffer for the given token.

USDIMAGINGGL_API HgiTextureHandle UsdImagingGLEngine::GetAovTexture ( TfToken const name) const

Returns an AOV texture handle for the given token.

static USDIMAGINGGL_API SdfPathVector UsdImagingGLEngine::GetAvailableRenderSettingsPrimPaths ( UsdPrim const root)
static

Utility method to query available render settings prims.

USDIMAGINGGL_API TfToken UsdImagingGLEngine::GetCurrentRendererId ( ) const

Return the id of the currently used renderer plugin.

USDIMAGINGGL_API bool UsdImagingGLEngine::GetGPUEnabled ( ) const

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

USDIMAGINGGL_API Hgi* UsdImagingGLEngine::GetHgi ( )

Returns the HGI interface.

USDIMAGINGGL_API TfTokenVector UsdImagingGLEngine::GetRendererAovs ( ) const

Return the vector of available renderer AOV settings.

USDIMAGINGGL_API HdCommandDescriptors UsdImagingGLEngine::GetRendererCommandDescriptors ( ) const

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

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

Return the user-friendly description of a renderer plugin.

static USDIMAGINGGL_API TfTokenVector UsdImagingGLEngine::GetRendererPlugins ( )
static

Return the vector of available render-graph delegate plugins.

USDIMAGINGGL_API VtValue UsdImagingGLEngine::GetRendererSetting ( TfToken const id) const

Gets a renderer setting's current value.

USDIMAGINGGL_API UsdImagingGLRendererSettingsList UsdImagingGLEngine::GetRendererSettingsList ( ) const

Returns the list of renderer settings.

USDIMAGINGGL_API VtDictionary UsdImagingGLEngine::GetRenderStats ( ) const

Returns render statistics.

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

USDIMAGINGGL_API bool UsdImagingGLEngine::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.

static USDIMAGINGGL_API bool UsdImagingGLEngine::IsColorCorrectionCapable ( )
static

Returns true if the platform is color correction capable.

USDIMAGINGGL_API bool UsdImagingGLEngine::IsConverged ( ) const

Returns true if the resulting image is fully converged. (otherwise, caller may need to call Render() again to refine the result)

USDIMAGINGGL_API bool UsdImagingGLEngine::IsPauseRendererSupported ( ) const

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

USDIMAGINGGL_API bool UsdImagingGLEngine::IsStopRendererSupported ( ) const

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

UsdImagingGLEngine& UsdImagingGLEngine::operator= ( const UsdImagingGLEngine )
delete

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.

USDIMAGINGGL_API bool UsdImagingGLEngine::PauseRenderer ( )

Pause the renderer.

Returns true if successful.

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

Support for batched drawing.

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

Entry point for kicking off a render.

USDIMAGINGGL_API void UsdImagingGLEngine::RenderBatch ( const SdfPathVector paths,
const UsdImagingGLRenderParams params 
)

Support for batched drawing.

USDIMAGINGGL_API bool UsdImagingGLEngine::RestartRenderer ( )

Restart the renderer.

Returns true if successful.

USDIMAGINGGL_API bool UsdImagingGLEngine::ResumeRenderer ( )

Resume the renderer.

Returns true if successful.

USDIMAGINGGL_API void UsdImagingGLEngine::SetActiveRenderSettingsPrimPath ( SdfPath const )

Set active render settings prim to use to drive rendering.

USDIMAGINGGL_API void UsdImagingGLEngine::SetCameraPath ( SdfPath const id)

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

USDIMAGINGGL_API void UsdImagingGLEngine::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.

USDIMAGINGGL_API void UsdImagingGLEngine::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}

USDIMAGINGGL_API void UsdImagingGLEngine::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.

USDIMAGINGGL_API void UsdImagingGLEngine::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 UsdImagingGLEngine::SetLightingState ( GlfSimpleLightingContextPtr const src)

Copy lighting state from another lighting context.

USDIMAGINGGL_API void UsdImagingGLEngine::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.
USDIMAGINGGL_API void UsdImagingGLEngine::SetOverrideWindowPolicy ( const std::pair< bool, 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.

USDIMAGINGGL_API void UsdImagingGLEngine::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.

USDIMAGINGGL_API void UsdImagingGLEngine::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.

USDIMAGINGGL_API bool UsdImagingGLEngine::SetRendererAov ( TfToken const id)

Set the current renderer AOV to id.

USDIMAGINGGL_API bool UsdImagingGLEngine::SetRendererPlugin ( TfToken const id)

Set the current render-graph delegate to id. the plugin will be loaded if it's not yet.

USDIMAGINGGL_API void UsdImagingGLEngine::SetRendererSetting ( TfToken const id,
VtValue const value 
)

Sets a renderer setting's value.

USDIMAGINGGL_API void UsdImagingGLEngine::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.
USDIMAGINGGL_API void UsdImagingGLEngine::SetRootTransform ( GfMatrix4d const xf)

Sets the root transform.

USDIMAGINGGL_API void UsdImagingGLEngine::SetRootVisibility ( bool  isVisible)

Sets the root visibility.

USDIMAGINGGL_API void UsdImagingGLEngine::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.

USDIMAGINGGL_API void UsdImagingGLEngine::SetSelectionColor ( GfVec4f const color)

Sets the selection highlighting color.

USDIMAGINGGL_API void UsdImagingGLEngine::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.

USDIMAGINGGL_API bool UsdImagingGLEngine::StopRenderer ( )

Stop the renderer.

Returns true if successful.

USDIMAGINGGL_API bool UsdImagingGLEngine::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.

Friends And Related Function Documentation

friend class UsdImagingGL_UnitTestGLDrawing
friend

Open some protected methods for whitebox testing.

Definition at line 587 of file engine.h.

Member Data Documentation

bool UsdImagingGLEngine::_displayUnloadedPrimsWithBounds
protected

Definition at line 681 of file engine.h.

bool UsdImagingGLEngine::_domeLightCameraVisibility
protected

Definition at line 698 of file engine.h.

SdfPathVector UsdImagingGLEngine::_excludedPrimPaths
protected

Definition at line 701 of file engine.h.

bool UsdImagingGLEngine::_gpuEnabled
protected

Definition at line 682 of file engine.h.

HgiUniquePtr UsdImagingGLEngine::_hgi
protected

Definition at line 674 of file engine.h.

HdDriver UsdImagingGLEngine::_hgiDriver
protected

Definition at line 676 of file engine.h.

HdRprimCollection UsdImagingGLEngine::_intersectCollection
protected

Definition at line 692 of file engine.h.

SdfPathVector UsdImagingGLEngine::_invisedPrimPaths
protected

Definition at line 702 of file engine.h.

bool UsdImagingGLEngine::_isPopulated
protected

Definition at line 703 of file engine.h.

GlfSimpleLightingContextRefPtr UsdImagingGLEngine::_lightingContextForOpenGLState
protected

Definition at line 694 of file engine.h.

HdRprimCollection UsdImagingGLEngine::_renderCollection
protected

Definition at line 691 of file engine.h.

HdPluginRenderDelegateUniqueHandle UsdImagingGLEngine::_renderDelegate
protected

Definition at line 683 of file engine.h.

std::unique_ptr<HdRenderIndex> UsdImagingGLEngine::_renderIndex
protected

Definition at line 684 of file engine.h.

SdfPath UsdImagingGLEngine::_rootPath
protected

Definition at line 700 of file engine.h.

SdfPath const UsdImagingGLEngine::_sceneDelegateId
protected

Definition at line 686 of file engine.h.

GfVec4f UsdImagingGLEngine::_selectionColor
protected

Definition at line 697 of file engine.h.

HdxSelectionTrackerSharedPtr UsdImagingGLEngine::_selTracker
protected

Definition at line 690 of file engine.h.

std::unique_ptr<HdxTaskController> UsdImagingGLEngine::_taskController
protected

Definition at line 688 of file engine.h.

VtValue UsdImagingGLEngine::_userFramebuffer
protected

Definition at line 678 of file engine.h.


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