10 #ifndef PXR_USD_IMAGING_USD_IMAGING_GL_ENGINE_H
11 #define PXR_USD_IMAGING_USD_IMAGING_GL_ENGINE_H
75 namespace UsdImagingGLEngine_Impl
136 bool gpuEnabled =
true);
142 const SdfPath& sceneDelegateID =
146 const bool gpuEnabled =
true,
147 const bool displayUnloadedPrimsWithBounds =
false,
148 const bool allowAsynchronousSceneProcessing =
false,
149 const bool enableUsdDrawModes =
true);
227 const std::optional<CameraUtilConformWindowPolicy> &policy);
339 SdfPath *outHitPrimPath = NULL,
340 SdfPath *outHitInstancerPath = NULL,
341 int *outHitInstanceIndex = NULL,
395 unsigned char const primIdColor[4],
396 unsigned char const instanceIdColor[4],
397 SdfPath *outHitPrimPath = NULL,
398 SdfPath *outHitInstancerPath = NULL,
399 int *outHitInstanceIndex = NULL,
408 SdfPath *outHitPrimPath = NULL,
409 SdfPath *outHitInstancerPath = NULL,
410 int *outHitInstanceIndex = NULL,
629 TfToken const& ocioDisplay = {},
631 TfToken const& ocioColorSpace = {},
733 float bboxLineDashSize);
754 HdContainerDataSourceHandle
const &sceneIndexInputArgs);
759 HdContainerDataSourceHandle
const &sceneIndexInputArgs);
837 bool _HasRenderer()
const;
838 HdSceneIndexBaseRefPtr _GetTerminalSceneIndex()
const;
840 HdSceneIndexBaseRefPtr
841 _AppendOverridesSceneIndices(
842 const HdSceneIndexBaseRefPtr &inputScene);
846 bool _CreateSceneIndicesAndRenderer(
848 HdContainerDataSourceHandle
const &sceneIndexInputArgs);
850 void _DestroyHydraObjects();
852 SdfPath _GetInstancerForPrim(
const SdfPath &sceneIndexPath)
const;
856 UsdImagingStageSceneIndexRefPtr _stageSceneIndex;
857 HdNoticeBatchingSceneIndexRefPtr _postInstancingNoticeBatchingSceneIndex;
858 UsdImagingSelectionSceneIndexRefPtr _selectionSceneIndex;
859 UsdImagingRootOverridesSceneIndexRefPtr _rootOverridesSceneIndex;
860 UsdImagingLegacyRenderSettingsSceneIndexRefPtr _legacyRenderSettingsSceneIndex;
861 HdsiLegacyDisplayStyleOverrideSceneIndexRefPtr _displayStyleSceneIndex;
862 HdsiPrimTypeAndPathPruningSceneIndexRefPtr _lightPruningSceneIndex;
864 bool _lightPruningSceneIndexEnableSceneLights;
865 HdSceneIndexBaseRefPtr _usdImagingFinalSceneIndex;
867 HdMergingSceneIndexRefPtr _mergingSceneIndex;
868 HdCachingSceneIndexRefPtr _cachingSceneIndex;
869 HdSceneIndexBaseRefPtr _terminalSceneIndex;
872 std::unique_ptr<UsdImagingDelegate> _sceneDelegate;
873 std::unique_ptr<HdEngine> _engine;
875 bool _allowAsynchronousSceneProcessing =
false;
876 bool _enableUsdDrawModes =
true;
881 #endif // PXR_USD_IMAGING_USD_IMAGING_GL_ENGINE_H
USDIMAGINGGL_API void SetRenderViewport(GfVec4d const &viewport)
bool displayUnloadedPrimsWithBounds
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.
static SDF_API const SdfPath & AbsoluteRootPath()
GlfSimpleLightingContextRefPtr _lightingContextForOpenGLState
HdRprimCollection _intersectCollection
USDIMAGINGGL_API void SetSelectionColor(GfVec4f const &color)
Sets the selection highlighting color.
USDIMAGINGGL_API HdSelectionSharedPtr _GetSelection() const
USDIMAGINGGL_API void SetOverrideWindowPolicy(const std::optional< CameraUtilConformWindowPolicy > &policy)
TF_DECLARE_REF_PTRS(HdNoticeBatchingSceneIndex)
TF_DECLARE_WEAK_AND_REF_PTRS(GlfSimpleLightingContext)
USDIMAGINGGL_API bool _CanPrepare(const UsdPrim &root)
GT_API const UT_StringHolder time
SdfPath const _sceneDelegateId
HdPluginRenderDelegateUniqueHandle _renderDelegate
#define PXR_NAMESPACE_OPEN_SCOPE
static USDIMAGINGGL_API HdxRenderTaskParams _MakeHydraUsdImagingGLRenderParams(UsdImagingGLRenderParams const ¶ms)
GLsizei const GLfloat * value
USDIMAGINGGL_API bool TestIntersection(const GfMatrix4d &viewMatrix, const GfMatrix4d &projectionMatrix, const UsdPrim &root, const UsdImagingGLRenderParams ¶ms, GfVec3d *outHitPoint, GfVec3d *outHitNormal, SdfPath *outHitPrimPath=NULL, SdfPath *outHitInstancerPath=NULL, int *outHitInstanceIndex=NULL, HdInstancerContext *outInstancerContext=NULL)
USDIMAGINGGL_API void SetCameraPath(SdfPath const &id)
GLsizei const GLchar *const * path
static USDIMAGINGGL_API bool _UpdateHydraCollection(HdRprimCollection *collection, SdfPathVector const &roots, UsdImagingGLRenderParams const ¶ms)
SdfPathVector invisedPaths
USDIMAGINGGL_API Hgi * GetHgi()
SdfPathVector excludedPaths
USDIMAGINGGL_API void _InitializeHgiIfNecessary()
USDIMAGINGGL_API bool PauseRenderer()
USDIMAGINGGL_API void SetActiveRenderSettingsPrimPath(SdfPath const &)
Set active render settings prim to use to drive rendering.
UsdImagingGLEngine & operator=(const UsdImagingGLEngine &)=delete
USDIMAGINGGL_API void _Execute(const UsdImagingGLRenderParams ¶ms, const SdfPathVector &taskPaths)
int HgiHandle< class HgiTexture > HgiTextureHandle
bool _domeLightCameraVisibility
static USDIMAGINGGL_API bool IsColorCorrectionCapable()
Returns true if the platform is color correction capable.
GLenum GLenum GLsizei const GLuint GLboolean enabled
USDIMAGINGGL_API SdfPath GetActiveRenderSettingsPrimPath() const
void _CreateUsdImagingSceneIndices(HdContainerDataSourceHandle const &inputArgs)
USDIMAGINGGL_API bool SetRendererAovs(TfTokenVector const &ids)
Set the current renderer AOVs to a list of ids.
bool _displayUnloadedPrimsWithBounds
GLenum const GLfloat * params
UsdStagePtr UsdStageWeakPtr
USDIMAGINGGL_API bool IsPauseRendererSupported() const
Query the renderer as to whether it supports pausing and resuming.
USDIMAGINGGL_API void _PreSetTime(const UsdImagingGLRenderParams ¶ms)
USDIMAGINGGL_API bool PollForAsynchronousUpdates() const
USDIMAGINGGL_API UsdImagingDelegate * _GetSceneDelegate() const
std::shared_ptr< class HdxSelectionTracker > HdxSelectionTrackerSharedPtr
std::vector< std::pair< SdfPath, int > > HdInstancerContext
Instancer context: a pair of instancer paths and instance indices.
USDIMAGINGGL_API void SetCameraState(const GfMatrix4d &viewMatrix, const GfMatrix4d &projectionMatrix)
USDIMAGINGGL_API bool SetRendererPlugin(TfToken const &id)
USDIMAGINGGL_API void SetFraming(CameraUtilFraming const &framing)
Parameters to construct UsdImagingGLEngine.
USDIMAGINGGL_API void SetRenderBufferSize(GfVec2i const &size)
friend class UsdImagingGL_UnitTestGLDrawing
Open some protected methods for whitebox testing.
static USDIMAGINGGL_API bool UseUsdImagingSceneIndex()
Returns true if using the UsdImaging scene index.
static USDIMAGINGGL_API void _ComputeRenderTags(UsdImagingGLRenderParams const ¶ms, TfTokenVector *renderTags)
USDIMAGINGGL_API void _PostSetTime(const UsdImagingGLRenderParams ¶ms)
USDIMAGINGGL_API void AddSelected(SdfPath const &path, int instanceIndex)
HdRprimCollection _renderCollection
USDIMAGINGGL_API void _SetBBoxParams(const BBoxVector &bboxes, const GfVec4f &bboxLineColor, float bboxLineDashSize)
USDIMAGINGGL_API HgiTextureHandle GetAovTexture(TfToken const &name) const
Returns an AOV texture handle for the given token.
std::vector< class SdfPath > SdfPathVector
std::vector< struct IntersectionResult > IntersectionResultVector
std::vector< HdCommandDescriptor > HdCommandDescriptors
USDIMAGINGGL_API void SetSelected(SdfPathVector const &paths)
USDIMAGINGGL_API HdRenderIndex * _GetRenderIndex() const
static USDIMAGINGGL_API TfTokenVector GetRendererPlugins()
Return the vector of available render-graph delegate plugins.
USDIMAGINGGL_API void _SetRenderDelegateAndRestoreState(HdPluginRenderDelegateUniqueHandle &&, HdContainerDataSourceHandle const &sceneIndexInputArgs)
USDIMAGINGGL_API void SetRootTransform(GfMatrix4d const &xf)
Sets the root transform.
USDIMAGINGGL_API void SetWindowPolicy(CameraUtilConformWindowPolicy policy)
USDIMAGINGGL_API ~UsdImagingGLEngine()
std::vector< TfToken > TfTokenVector
Convenience types.
USDIMAGINGGL_API bool SetRendererAov(TfToken const &id)
Set the current renderer AOV to id.
USDIMAGINGGL_API bool InvokeRendererCommand(const TfToken &command, const HdCommandArgs &args=HdCommandArgs()) const
GLuint const GLchar * name
USDIMAGINGGL_API void _SetSceneGlobalsCurrentFrame(UsdTimeCode const &time)
USDIMAGINGGL_API SdfPath GetActiveRenderPassPrimPath() const
HdxSelectionTrackerSharedPtr _selTracker
HdxTaskControllerSceneIndexRefPtr _taskControllerSceneIndex
USDIMAGINGGL_API UsdImagingGLRendererSettingsList GetRendererSettingsList() const
Returns the list of renderer settings.
std::unique_ptr< HdRenderIndex > _renderIndex
USDIMAGINGGL_API bool IsConverged() const
USDIMAGINGGL_API void SetRendererSetting(TfToken const &id, VtValue const &value)
Sets a renderer setting's value.
USDIMAGINGGL_API void Render(const UsdPrim &root, const UsdImagingGLRenderParams ¶ms)
Entry point for kicking off a render.
SdfPathVector _invisedPrimPaths
USDIMAGINGGL_API void _SetActiveRenderSettingsPrimFromStageMetadata(UsdStageWeakPtr stage)
std::unique_ptr< HdxTaskController > _taskController
USDIMAGINGGL_API void PrepareBatch(const UsdPrim &root, const UsdImagingGLRenderParams ¶ms)
Support for batched drawing.
USDIMAGINGGL_API void _PrepareRender(const UsdImagingGLRenderParams ¶ms)
VtDictionary HdCommandArgs
USDIMAGINGGL_API bool StopRenderer()
USDIMAGINGGL_API bool RestartRenderer()
USDIMAGINGGL_API HdRenderBuffer * GetAovRenderBuffer(TfToken const &name) const
Returns the AOV render buffer for the given token.
USDIMAGINGGL_API void ClearSelected()
std::vector< GfBBox3d > BBoxVector
USDIMAGINGGL_API bool IsStopRendererSupported() const
Query the renderer as to whether it supports stopping and restarting.
std::vector< UsdImagingGLRendererSetting > UsdImagingGLRendererSettingsList
USDIMAGINGGL_API void SetLightingState(GlfSimpleLightingContextPtr const &src)
Copy lighting state from another lighting context.
USDIMAGINGGL_API void RenderBatch(const SdfPathVector &paths, const UsdImagingGLRenderParams ¶ms)
Support for batched drawing.
#define PXR_NAMESPACE_CLOSE_SCOPE
USDIMAGINGGL_API UsdImagingGLEngine(const Parameters ¶ms)
USDIMAGINGGL_API TfTokenVector GetRendererAovs() const
Return the vector of available renderer AOV settings.
USDIMAGINGGL_API void SetColorCorrectionSettings(TfToken const &ccType, TfToken const &ocioDisplay={}, TfToken const &ocioView={}, TfToken const &ocioColorSpace={}, TfToken const &ocioLook={})
**If you just want to fire and args
USDIMAGINGGL_API VtValue GetRendererSetting(TfToken const &id) const
Gets a renderer setting's current value.
USDIMAGINGGL_API bool ResumeRenderer()
SdfPathVector _excludedPrimPaths
static USDIMAGINGGL_API std::string GetRendererDisplayName(TfToken const &id)
Return the user-friendly name of a renderer plugin.
std::shared_ptr< struct _AppSceneIndices > _AppSceneIndicesSharedPtr
USDIMAGINGGL_API HdEngine * _GetHdEngine()
USDIMAGINGGL_API void _UpdateDomeLightCameraVisibility()
USDIMAGINGGL_API void SetActiveRenderPassPrimPath(SdfPath const &)
Set active render pass prim to use to drive rendering.
USDIMAGINGGL_API SdfPath _ComputeControllerPath(const TfToken &pluginId)
USDIMAGINGGL_API VtDictionary GetRenderStats() const
USDIMAGINGGL_API HdCommandDescriptors GetRendererCommandDescriptors() const
std::shared_ptr< class HdSelection > HdSelectionSharedPtr
bool allowAsynchronousSceneProcessing
HdInstancerContext instancerContext
USDIMAGINGGL_API void _SetRenderDelegate(HdPluginRenderDelegateUniqueHandle &&, HdContainerDataSourceHandle const &sceneIndexInputArgs)
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)
static USDIMAGINGGL_API TfToken _GetDefaultRendererPluginId()
USDIMAGINGGL_API void SetRootVisibility(bool isVisible)
Sets the root visibility.
std::vector< class GlfSimpleLight > GlfSimpleLightVector
USDIMAGINGGL_API HdxTaskController * _GetTaskController() const
USDIMAGINGGL_API void SetEnablePresentation(bool enabled)
USDIMAGINGGL_API void SetPresentationOutput(TfToken const &api, VtValue const &framebuffer)
std::unique_ptr< class Hgi > HgiUniquePtr
HdPluginRendererUniqueHandle _renderer
static USDIMAGINGGL_API SdfPathVector GetAvailableRenderSettingsPrimPaths(UsdPrim const &root)
Utility method to query available render settings prims.
USDIMAGINGGL_API std::string GetRendererHgiDisplayName() const