27 #ifndef PXR_USD_IMAGING_USD_IMAGING_GL_ENGINE_H
28 #define PXR_USD_IMAGING_USD_IMAGING_GL_ENGINE_H
86 namespace UsdImagingGLEngine_Impl
144 bool gpuEnabled =
true);
150 const SdfPath& sceneDelegateID =
154 bool gpuEnabled =
true,
155 bool displayUnloadedPrimsWithBounds =
false,
156 bool allowAsynchronousSceneProcessing =
false);
234 const std::optional<CameraUtilConformWindowPolicy> &
policy);
344 SdfPath *outHitPrimPath = NULL,
345 SdfPath *outHitInstancerPath = NULL,
346 int *outHitInstanceIndex = NULL,
353 unsigned char const primIdColor[4],
354 unsigned char const instanceIdColor[4],
355 SdfPath *outHitPrimPath = NULL,
356 SdfPath *outHitInstancerPath = NULL,
357 int *outHitInstanceIndex = NULL,
551 TfToken const& ocioDisplay = {},
553 TfToken const& ocioColorSpace = {},
641 float bboxLineDashSize);
729 static void _RegisterApplicationSceneIndices();
735 static HdSceneIndexBaseRefPtr
736 _AppendSceneGlobalsSceneIndexCallback(
738 const HdSceneIndexBaseRefPtr &inputScene,
739 const HdContainerDataSourceHandle &inputArgs);
741 HdSceneIndexBaseRefPtr
742 _AppendOverridesSceneIndices(
743 const HdSceneIndexBaseRefPtr &inputScene);
747 void _DestroyHydraObjects();
751 UsdImagingStageSceneIndexRefPtr _stageSceneIndex;
752 UsdImagingSelectionSceneIndexRefPtr _selectionSceneIndex;
753 UsdImagingRootOverridesSceneIndexRefPtr _rootOverridesSceneIndex;
754 HdsiLegacyDisplayStyleOverrideSceneIndexRefPtr _displayStyleSceneIndex;
755 HdsiPrimTypePruningSceneIndexRefPtr _materialPruningSceneIndex;
756 HdsiPrimTypePruningSceneIndexRefPtr _lightPruningSceneIndex;
757 HdSceneIndexBaseRefPtr _sceneIndex;
759 std::unique_ptr<UsdImagingDelegate> _sceneDelegate;
761 std::unique_ptr<HdEngine> _engine;
763 bool _allowAsynchronousSceneProcessing =
false;
769 #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 SdfPath _ComputeControllerPath(const HdPluginRenderDelegateUniqueHandle &)
USDIMAGINGGL_API TfToken GetCurrentRendererId() const
Return the id of the currently used renderer plugin.
static SDF_API const SdfPath & AbsoluteRootPath()
GlfSimpleLightingContextRefPtr _lightingContextForOpenGLState
USDIMAGINGGL_API void _Execute(const UsdImagingGLRenderParams ¶ms, HdTaskSharedPtrVector tasks)
HdRprimCollection _intersectCollection
hboost::math::policies::policy< hboost::math::policies::domain_error< hboost::math::policies::ignore_error >, hboost::math::policies::pole_error< hboost::math::policies::ignore_error >, hboost::math::policies::overflow_error< hboost::math::policies::ignore_error >, hboost::math::policies::underflow_error< hboost::math::policies::ignore_error >, hboost::math::policies::denorm_error< hboost::math::policies::ignore_error >, hboost::math::policies::rounding_error< hboost::math::policies::ignore_error >, hboost::math::policies::evaluation_error< hboost::math::policies::ignore_error >, hboost::math::policies::indeterminate_result_error< hboost::math::policies::ignore_error > > policy
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_WEAK_AND_REF_PTRS(GlfSimpleLightingContext)
USDIMAGINGGL_API bool _CanPrepare(const UsdPrim &root)
SdfPath const _sceneDelegateId
HdPluginRenderDelegateUniqueHandle _renderDelegate
static USDIMAGINGGL_API HdxRenderTaskParams _MakeHydraUsdImagingGLRenderParams(UsdImagingGLRenderParams const ¶ms)
GLsizei const GLchar *const * string
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
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
std::vector< HdTaskSharedPtr > HdTaskSharedPtrVector
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 void _ComputeRenderTags(UsdImagingGLRenderParams const ¶ms, TfTokenVector *renderTags)
USDIMAGINGGL_API void _PostSetTime(const UsdImagingGLRenderParams ¶ms)
USDIMAGINGGL_API void AddSelected(SdfPath const &path, int instanceIndex)
TF_DECLARE_REF_PTRS(UsdImagingStageSceneIndex)
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< 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 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
std::vector< class SdfPath > SdfPathVector
A vector of SdfPaths.
HdxSelectionTrackerSharedPtr _selTracker
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.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
USDIMAGINGGL_API void _PrepareRender(const UsdImagingGLRenderParams ¶ms)
VtDictionary HdCommandArgs
USDIMAGINGGL_API bool StopRenderer()
USDIMAGINGGL_API void _SetRenderDelegateAndRestoreState(HdPluginRenderDelegateUniqueHandle &&)
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 description of a renderer plugin.
std::shared_ptr< struct _AppSceneIndices > _AppSceneIndicesSharedPtr
USDIMAGINGGL_API HdEngine * _GetHdEngine()
USDIMAGINGGL_API void _UpdateDomeLightCameraVisibility()
USDIMAGINGGL_API VtDictionary GetRenderStats() const
USDIMAGINGGL_API void _SetRenderDelegate(HdPluginRenderDelegateUniqueHandle &&)
USDIMAGINGGL_API HdCommandDescriptors GetRendererCommandDescriptors() const
std::shared_ptr< class HdSelection > HdSelectionSharedPtr
bool allowAsynchronousSceneProcessing
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
static USDIMAGINGGL_API SdfPathVector GetAvailableRenderSettingsPrimPaths(UsdPrim const &root)
Utility method to query available render settings prims.