Loading...
Searching...
No Matches
engine.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the terms set forth in the LICENSE.txt file available at
5// https://openusd.org/license.
6//
7
9
10#ifndef PXR_USD_IMAGING_USD_IMAGING_GL_ENGINE_H
11#define PXR_USD_IMAGING_USD_IMAGING_GL_ENGINE_H
12
13#include "pxr/pxr.h"
14#include "pxr/usdImaging/usdImaging/legacyRenderSettingsSceneIndex.h"
15#include "pxr/usdImaging/usdImagingGL/api.h"
16#include "pxr/usdImaging/usdImagingGL/version.h"
17#include "pxr/usdImaging/usdImaging/version.h"
18
20#include "pxr/usdImaging/usdImagingGL/rendererSettings.h"
21
22#include "pxr/imaging/cameraUtil/conformWindow.h"
23
24#include "pxr/imaging/hd/driver.h"
25#include "pxr/imaging/hd/engine.h"
26#include "pxr/imaging/hd/rprimCollection.h"
27#include "pxr/imaging/hd/pluginRenderDelegateUniqueHandle.h"
28#include "pxr/imaging/hd/pluginRendererUniqueHandle.h"
29
30#include "pxr/imaging/hdx/selectionTracker.h"
31#include "pxr/imaging/hdx/renderSetupTask.h"
32
33#include "pxr/imaging/hgi/hgi.h"
34
37
38#include "pxr/imaging/hgi/hgi.h"
39
40#include "pxr/usd/sdf/path.h"
41#include "pxr/usd/usd/timeCode.h"
42
43#include "pxr/base/gf/frustum.h"
45#include "pxr/base/gf/vec4d.h"
46#include "pxr/base/gf/vec4f.h"
47#include "pxr/base/gf/vec4i.h"
48
50
52
53PXR_NAMESPACE_OPEN_SCOPE
54
55class UsdPrim;
56class HdRenderIndex;
57class HdxTaskController;
59
60TF_DECLARE_WEAK_AND_REF_PTRS(GlfSimpleLightingContext);
61TF_DECLARE_REF_PTRS(HdNoticeBatchingSceneIndex);
72
73using UsdStageWeakPtr = TfWeakPtr<class UsdStage>;
74
75namespace UsdImagingGLEngine_Impl
76{
77 using _AppSceneIndicesSharedPtr = std::shared_ptr<struct _AppSceneIndices>;
78}
79
85{
86public:
89 {
91 SdfPathVector excludedPaths;
92 SdfPathVector invisedPaths;
93 SdfPath sceneDelegateID = SdfPath::AbsoluteRootPath();
104 bool gpuEnabled = true;
115 };
116
117 // ---------------------------------------------------------------------
120 // ---------------------------------------------------------------------
121
122 USDIMAGINGGL_API
123 UsdImagingGLEngine(const Parameters &params);
124
133 USDIMAGINGGL_API
135 const TfToken& rendererPluginId = TfToken(),
136 bool gpuEnabled = true);
137
138 USDIMAGINGGL_API
139 UsdImagingGLEngine(const SdfPath& rootPath,
140 const SdfPathVector& excludedPaths,
141 const SdfPathVector& invisedPaths = SdfPathVector(),
142 const SdfPath& sceneDelegateID =
144 const HdDriver& driver = HdDriver(),
145 const TfToken& rendererPluginId = TfToken(),
146 const bool gpuEnabled = true,
147 const bool displayUnloadedPrimsWithBounds = false,
148 const bool allowAsynchronousSceneProcessing = false,
149 const bool enableUsdDrawModes = true);
150
151 // Disallow copies
152 UsdImagingGLEngine(const UsdImagingGLEngine&) = delete;
153 UsdImagingGLEngine& operator=(const UsdImagingGLEngine&) = delete;
154
155 USDIMAGINGGL_API
157
159
160 // ---------------------------------------------------------------------
163 // ---------------------------------------------------------------------
164
166 USDIMAGINGGL_API
167 void PrepareBatch(const UsdPrim& root,
168 const UsdImagingGLRenderParams& params);
169 USDIMAGINGGL_API
170 void RenderBatch(const SdfPathVector& paths,
171 const UsdImagingGLRenderParams& params);
172
174 USDIMAGINGGL_API
175 void Render(const UsdPrim& root,
176 const UsdImagingGLRenderParams &params);
177
180 USDIMAGINGGL_API
181 bool IsConverged() const;
182
184
185 // ---------------------------------------------------------------------
188 // ---------------------------------------------------------------------
189
191 USDIMAGINGGL_API
193
195 USDIMAGINGGL_API
196 void SetRootVisibility(bool isVisible);
197
199
200 // ---------------------------------------------------------------------
203 // ---------------------------------------------------------------------
204
207 USDIMAGINGGL_API
208 void SetCameraPath(SdfPath const& id);
209
213 USDIMAGINGGL_API
214 void SetFraming(CameraUtilFraming const& framing);
215
225 USDIMAGINGGL_API
227 const std::optional<CameraUtilConformWindowPolicy> &policy);
228
232 USDIMAGINGGL_API
233 void SetRenderBufferSize(GfVec2i const& size);
234
240 USDIMAGINGGL_API
241 void SetRenderViewport(GfVec4d const& viewport);
242
246 USDIMAGINGGL_API
247 void SetWindowPolicy(CameraUtilConformWindowPolicy policy);
248
253 USDIMAGINGGL_API
254 void SetCameraState(const GfMatrix4d& viewMatrix,
255 const GfMatrix4d& projectionMatrix);
256
258
259 // ---------------------------------------------------------------------
262 // ---------------------------------------------------------------------
263
265 USDIMAGINGGL_API
266 void SetLightingState(GlfSimpleLightingContextPtr const &src);
267
272 USDIMAGINGGL_API
273 void SetLightingState(GlfSimpleLightVector const &lights,
274 GlfSimpleMaterial const &material,
275 GfVec4f const &sceneAmbient);
276
278
279 // ---------------------------------------------------------------------
282 // ---------------------------------------------------------------------
283
287 USDIMAGINGGL_API
288 void SetSelected(SdfPathVector const& paths);
289
292 USDIMAGINGGL_API
294
298 USDIMAGINGGL_API
299 void AddSelected(SdfPath const &path, int instanceIndex);
300
302 USDIMAGINGGL_API
303 void SetSelectionColor(GfVec4f const& color);
304
306
307 // ---------------------------------------------------------------------
310 // ---------------------------------------------------------------------
311
331 USDIMAGINGGL_API
333 const GfMatrix4d &viewMatrix,
334 const GfMatrix4d &projectionMatrix,
335 const UsdPrim& root,
336 const UsdImagingGLRenderParams &params,
337 GfVec3d *outHitPoint,
338 GfVec3d *outHitNormal,
339 SdfPath *outHitPrimPath = NULL,
340 SdfPath *outHitInstancerPath = NULL,
341 int *outHitInstanceIndex = NULL,
342 HdInstancerContext *outInstancerContext = NULL);
343
344 // Pick result
345 struct IntersectionResult
346 {
347 GfVec3d hitPoint;
348 GfVec3d hitNormal;
349 SdfPath hitPrimPath;
350 SdfPath hitInstancerPath;
351 int hitInstanceIndex;
352 HdInstancerContext instancerContext;
353 };
354
355 typedef std::vector<struct IntersectionResult> IntersectionResultVector;
356
357 // Pick params
358 struct PickParams
359 {
360 TfToken resolveMode;
361 };
362
382 USDIMAGINGGL_API
384 const PickParams& pickParams,
385 const GfMatrix4d& viewMatrix,
386 const GfMatrix4d& projectionMatrix,
387 const UsdPrim& root,
388 const UsdImagingGLRenderParams& params,
389 IntersectionResultVector* outResults);
390
393 USDIMAGINGGL_API
395 unsigned char const primIdColor[4],
396 unsigned char const instanceIdColor[4],
397 SdfPath *outHitPrimPath = NULL,
398 SdfPath *outHitInstancerPath = NULL,
399 int *outHitInstanceIndex = NULL,
400 HdInstancerContext *outInstancerContext = NULL);
401
404 USDIMAGINGGL_API
406 int primIdx,
407 int instanceIdx,
408 SdfPath *outHitPrimPath = NULL,
409 SdfPath *outHitInstancerPath = NULL,
410 int *outHitInstanceIndex = NULL,
411 HdInstancerContext *outInstancerContext = NULL);
412
414
415 // ---------------------------------------------------------------------
418 // ---------------------------------------------------------------------
419
421 USDIMAGINGGL_API
423
425 USDIMAGINGGL_API
426 static std::string GetRendererDisplayName(TfToken const &id);
427
431 USDIMAGINGGL_API
432 std::string GetRendererHgiDisplayName() const;
433
435 USDIMAGINGGL_API
436 bool GetGPUEnabled() const;
437
439 USDIMAGINGGL_API
441
444 USDIMAGINGGL_API
445 bool SetRendererPlugin(TfToken const &id);
446
448
449 // ---------------------------------------------------------------------
452 // ---------------------------------------------------------------------
453
455 USDIMAGINGGL_API
457
459 USDIMAGINGGL_API
460 bool SetRendererAov(TfToken const& id);
461
463 USDIMAGINGGL_API
465
467 USDIMAGINGGL_API
469
471 USDIMAGINGGL_API
473
474 // ---------------------------------------------------------------------
477 // ---------------------------------------------------------------------
478
480 USDIMAGINGGL_API
481 UsdImagingGLRendererSettingsList GetRendererSettingsList() const;
482
484 USDIMAGINGGL_API
486
488 USDIMAGINGGL_API
490 VtValue const& value);
491
493
494 // ---------------------------------------------------------------------
498 // ---------------------------------------------------------------------
499
502 USDIMAGINGGL_API
504
507 USDIMAGINGGL_API
509
511 USDIMAGINGGL_API
512 static SdfPathVector
514
516 USDIMAGINGGL_API
518
520 USDIMAGINGGL_API
522
523
525
526 // ---------------------------------------------------------------------
529 // ---------------------------------------------------------------------
530
534 USDIMAGINGGL_API
535 void SetEnablePresentation(bool enabled);
536
542 USDIMAGINGGL_API
543 void SetPresentationOutput(TfToken const &api, VtValue const &framebuffer);
544
546
547 // ---------------------------------------------------------------------
550 // ---------------------------------------------------------------------
551
555 USDIMAGINGGL_API
556 HdCommandDescriptors GetRendererCommandDescriptors() const;
557
563 USDIMAGINGGL_API
565 const TfToken &command,
566 const HdCommandArgs &args = HdCommandArgs()) const;
567
568 // ---------------------------------------------------------------------
571 // ---------------------------------------------------------------------
572
574 USDIMAGINGGL_API
576
580 USDIMAGINGGL_API
582
586 USDIMAGINGGL_API
588
590 USDIMAGINGGL_API
592
596 USDIMAGINGGL_API
598
602 USDIMAGINGGL_API
604
606
607 // ---------------------------------------------------------------------
610 // ---------------------------------------------------------------------
611
626 USDIMAGINGGL_API
628 TfToken const& ccType,
629 TfToken const& ocioDisplay = {},
630 TfToken const& ocioView = {},
631 TfToken const& ocioColorSpace = {},
632 TfToken const& ocioLook = {});
633
635
637 USDIMAGINGGL_API
639
640 // ---------------------------------------------------------------------
643 // ---------------------------------------------------------------------
644
650 USDIMAGINGGL_API
652
654
655 // ---------------------------------------------------------------------
658 // ---------------------------------------------------------------------
659
662 USDIMAGINGGL_API
664
666
667 // ---------------------------------------------------------------------
670 // ---------------------------------------------------------------------
671
678 USDIMAGINGGL_API
680
682
683
684 // ---------------------------------------------------------------------
687 // ---------------------------------------------------------------------
688
690 USDIMAGINGGL_API
693
694protected:
695
697 friend class UsdImagingGL_UnitTestGLDrawing;
698
701 USDIMAGINGGL_API
703
704 USDIMAGINGGL_API
705 void _Execute(const UsdImagingGLRenderParams &params,
706 const SdfPathVector &taskPaths);
707
708 USDIMAGINGGL_API
709 bool _CanPrepare(const UsdPrim& root);
710 USDIMAGINGGL_API
711 void _PreSetTime(const UsdImagingGLRenderParams& params);
712 USDIMAGINGGL_API
713 void _PostSetTime(const UsdImagingGLRenderParams& params);
714
715 USDIMAGINGGL_API
716 void _PrepareRender(const UsdImagingGLRenderParams& params);
717
718 USDIMAGINGGL_API
719 void _SetActiveRenderSettingsPrimFromStageMetadata(UsdStageWeakPtr stage);
720
721 USDIMAGINGGL_API
722 void _SetSceneGlobalsCurrentFrame(UsdTimeCode const &time);
723
724 USDIMAGINGGL_API
725 void _UpdateDomeLightCameraVisibility();
726
727 using BBoxVector = std::vector<GfBBox3d>;
728
729 USDIMAGINGGL_API
730 void _SetBBoxParams(
731 const BBoxVector& bboxes,
732 const GfVec4f& bboxLineColor,
733 float bboxLineDashSize);
734
735 // Create a hydra collection given root paths and render params.
736 // Returns true if the collection was updated.
737 USDIMAGINGGL_API
738 static bool _UpdateHydraCollection(HdRprimCollection *collection,
739 SdfPathVector const& roots,
740 UsdImagingGLRenderParams const& params);
741 USDIMAGINGGL_API
742 static HdxRenderTaskParams _MakeHydraUsdImagingGLRenderParams(
743 UsdImagingGLRenderParams const& params);
744 USDIMAGINGGL_API
745 static void _ComputeRenderTags(UsdImagingGLRenderParams const& params,
746 TfTokenVector *renderTags);
747
748 USDIMAGINGGL_API
749 void _InitializeHgiIfNecessary();
750
751 USDIMAGINGGL_API
752 void _SetRenderDelegateAndRestoreState(
754 HdContainerDataSourceHandle const &sceneIndexInputArgs);
755
756 USDIMAGINGGL_API
757 void _SetRenderDelegate(
759 HdContainerDataSourceHandle const &sceneIndexInputArgs);
760
761 USDIMAGINGGL_API
762 SdfPath _ComputeControllerPath(const TfToken &pluginId);
763
764 USDIMAGINGGL_API
765 SdfPath _ComputeControllerPath(const HdPluginRenderDelegateUniqueHandle &);
766
767 USDIMAGINGGL_API
768 static TfToken _GetDefaultRendererPluginId();
769
775 USDIMAGINGGL_API
777
778 USDIMAGINGGL_API
779 HdEngine *_GetHdEngine();
780
783 USDIMAGINGGL_API
784 HdxTaskController *_GetTaskController() const;
785
786 USDIMAGINGGL_API
787 HdSelectionSharedPtr _GetSelection() const;
788
789 // Create UsdImagingStageSceneIndex and subsequent scene indices.
790 void
791 _CreateUsdImagingSceneIndices(HdContainerDataSourceHandle const &inputArgs);
792
793protected:
794
795 // Note that any of the fields below might become private
796 // in the future and subclasses should use the above getters
797 // to access them instead.
798
799 HgiUniquePtr _hgi;
800 // Similar for HdDriver.
801 HdDriver _hgiDriver;
802
803 VtValue _userFramebuffer;
804
805protected:
806 bool _displayUnloadedPrimsWithBounds;
807 bool _gpuEnabled;
808
809 /* Hydra 2.0 */
810
812 HdxTaskControllerSceneIndexRefPtr _taskControllerSceneIndex;
813
814 /* Hydra 1.0 */
816 std::unique_ptr<HdRenderIndex> _renderIndex;
817 std::unique_ptr<HdxTaskController> _taskController;
818
819 SdfPath const _sceneDelegateId;
820
821 HdxSelectionTrackerSharedPtr _selTracker;
822 HdRprimCollection _renderCollection;
823 HdRprimCollection _intersectCollection;
824
825 GlfSimpleLightingContextRefPtr _lightingContextForOpenGLState;
826
827 // Data we want to live across render plugin switches:
828 GfVec4f _selectionColor;
829 bool _domeLightCameraVisibility;
830
831 SdfPath _rootPath;
832 SdfPathVector _excludedPrimPaths;
833 SdfPathVector _invisedPrimPaths;
834 bool _isPopulated;
835
836private:
837 bool _HasRenderer() const;
838 HdSceneIndexBaseRefPtr _GetTerminalSceneIndex() const;
839
840 HdSceneIndexBaseRefPtr
841 _AppendOverridesSceneIndices(
842 const HdSceneIndexBaseRefPtr &inputScene);
843
844 UsdImagingGLEngine_Impl::_AppSceneIndicesSharedPtr _appSceneIndices;
845
846 bool _CreateSceneIndicesAndRenderer(
847 HdRendererPluginHandle const &plugin,
848 HdContainerDataSourceHandle const &sceneIndexInputArgs);
849
850 void _DestroyHydraObjects();
851
852 SdfPath _GetInstancerForPrim(const SdfPath &sceneIndexPath) const;
853
854 // Note that we'll only ever use one of _sceneIndex/_sceneDelegate
855 // at a time.
856 UsdImagingStageSceneIndexRefPtr _stageSceneIndex;
857 HdNoticeBatchingSceneIndexRefPtr _postInstancingNoticeBatchingSceneIndex;
858 UsdImagingSelectionSceneIndexRefPtr _selectionSceneIndex;
859 UsdImagingRootOverridesSceneIndexRefPtr _rootOverridesSceneIndex;
860 UsdImagingLegacyRenderSettingsSceneIndexRefPtr _legacyRenderSettingsSceneIndex;
861 HdsiLegacyDisplayStyleOverrideSceneIndexRefPtr _displayStyleSceneIndex;
862 HdsiPrimTypeAndPathPruningSceneIndexRefPtr _lightPruningSceneIndex;
863 // State of the _lightPruningSceneIndex.
864 bool _lightPruningSceneIndexEnableSceneLights;
865 HdSceneIndexBaseRefPtr _usdImagingFinalSceneIndex;
866
867 HdMergingSceneIndexRefPtr _mergingSceneIndex;
868 HdCachingSceneIndexRefPtr _cachingSceneIndex;
869 HdSceneIndexBaseRefPtr _terminalSceneIndex;
870
871 /* Hydra 1.0 */
872 std::unique_ptr<UsdImagingDelegate> _sceneDelegate;
873 std::unique_ptr<HdEngine> _engine;
874
875 bool _allowAsynchronousSceneProcessing = false;
876 bool _enableUsdDrawModes = true;
877};
878
879PXR_NAMESPACE_CLOSE_SCOPE
880
881#endif // PXR_USD_IMAGING_USD_IMAGING_GL_ENGINE_H
Framing information.
Definition: framing.h:63
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:71
Basic type for a vector of 2 int components.
Definition: vec2i.h:44
Basic type for a vector of 3 double components.
Definition: vec3d.h:46
Basic type for a vector of 4 double components.
Definition: vec4d.h:46
Basic type for a vector of 4 float components.
Definition: vec4f.h:46
A scene index that caches the prim data source and child prim paths.
HdDriver represents a device object, commonly a render device, that is owned by the application and p...
Definition: driver.h:23
The application-facing entry point top-level entry point for accessing Hydra.
Definition: engine.h:31
Merges multiple scenes together.
A (movable) handle for a render delegate that was created using a a plugin.
A handle for a renderer that was created by a renderer plugin.
A render buffer is a handle to a data resource that can be rendered into, such as a 2d image for a dr...
Definition: renderBuffer.h:33
The Hydra render index is a flattened representation of the client scene graph, which may be composed...
Definition: renderIndex.h:105
A handle for HdRendererPlugin also storing the plugin id.
A named, semantic collection of objects.
Abstract interface to scene data.
Definition: sceneIndex.h:54
A scene index overriding the legacy display style for each prim.
Scene Index that prunes prims if its type is in a given list and its path matches a given predicate.
Scene index that populates the "sceneGlobals" data source as modeled by HdSceneGlobalsSchema and prov...
Manages tasks necessary to render an image (or perform picking) as well as the related render buffers...
Hydra Graphics Interface.
Definition: hgi.h:95
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:281
static SDF_API const SdfPath & AbsoluteRootPath()
The absolute path representing the top of the namespace hierarchy.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
Pointer storage with deletion detection.
Definition: weakPtr.h:128
The primary translation layer between the Hydra (Hd) core and the Usd scene graph.
Definition: delegate.h:67
The UsdImagingGLEngine is the main entry point API for rendering USD scenes.
Definition: engine.h:85
USDIMAGINGGL_API void SetSelectionColor(GfVec4f const &color)
Sets the selection highlighting color.
USDIMAGINGGL_API bool StopRenderer()
Stop the renderer.
USDIMAGINGGL_API void SetRenderBufferSize(GfVec2i const &size)
Set the size of the render buffers baking the AOVs.
USDIMAGINGGL_API bool SetRendererAov(TfToken const &id)
Set the current renderer AOV to id.
USDIMAGINGGL_API bool DecodeIntersection(int primIdx, int instanceIdx, 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 UsdImagingDelegate * _GetSceneDelegate() const
Get a direct pointer to the scene delegate.
USDIMAGINGGL_API void SetActiveRenderPassPrimPath(SdfPath const &)
Set active render pass prim to use to drive rendering.
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 t...
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),...
USDIMAGINGGL_API bool RestartRenderer()
Restart the renderer.
USDIMAGINGGL_API Hgi * GetHgi()
Returns the HGI interface.
static USDIMAGINGGL_API TfTokenVector GetRendererPlugins()
Return the vector of available render-graph delegate plugins.
HdDriver driver
An HdDriver, containing the Hgi of your choice, can be optionally passed in during construction.
Definition: engine.h:97
USDIMAGINGGL_API void Render(const UsdPrim &root, const UsdImagingGLRenderParams &params)
Entry point for kicking off a render.
USDIMAGINGGL_API VtValue GetRendererSetting(TfToken const &id) const
Gets a renderer setting's current value.
USDIMAGINGGL_API bool ResumeRenderer()
Resume the renderer.
USDIMAGINGGL_API HdRenderIndex * _GetRenderIndex() const
Returns the render index of the engine, if any.
USDIMAGINGGL_API void SetEnablePresentation(bool enabled)
Enable / disable presenting the render to bound framebuffer.
USDIMAGINGGL_API void SetLightingState(GlfSimpleLightingContextPtr const &src)
Copy lighting state from another lighting context.
USDIMAGINGGL_API SdfPath GetActiveRenderSettingsPrimPath() const
Returns the active render settings prim path by querying the terminal scene index.
USDIMAGINGGL_API bool PauseRenderer()
Pause the renderer.
USDIMAGINGGL_API SdfPath GetActiveRenderPassPrimPath() const
Returns the active render pass prim path by querying the terminal scene index.
USDIMAGINGGL_API void SetCameraPath(SdfPath const &id)
Scene camera API Set the scene camera path to use for rendering.
USDIMAGINGGL_API void PrepareBatch(const UsdPrim &root, const UsdImagingGLRenderParams &params)
Support for batched drawing.
USDIMAGINGGL_API void SetRootVisibility(bool isVisible)
Sets the root visibility.
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}.
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 lightin...
TfToken rendererPluginId
The rendererPluginId argument indicates the renderer plugin that Hydra should use.
Definition: engine.h:101
bool enableUsdDrawModes
enableUsdDrawModes enables the UsdGeomModelAPI draw mode feature.
Definition: engine.h:114
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 TfTokenVector GetRendererAovs() const
Return the vector of available renderer AOV settings.
USDIMAGINGGL_API HdxTaskController * _GetTaskController() const
USDIMAGINGGL_API bool PollForAsynchronousUpdates() const
If allowAsynchronousSceneProcessing is true within the Parameters provided to the UsdImagingGLEngine ...
USDIMAGINGGL_API bool IsStopRendererSupported() const
Query the renderer as to whether it supports stopping and restarting.
USDIMAGINGGL_API bool IsConverged() const
Returns true if the resulting image is fully converged.
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).
bool displayUnloadedPrimsWithBounds
displayUnloadedPrimsWithBounds draws bounding boxes for unloaded prims if they have extents/extentsHi...
Definition: engine.h:107
USDIMAGINGGL_API HdRenderBuffer * GetAovRenderBuffer(TfToken const &name) const
Returns the AOV render buffer for the given token.
USDIMAGINGGL_API bool InvokeRendererCommand(const TfToken &command, const HdCommandArgs &args=HdCommandArgs()) const
Invokes command on the active render delegate.
USDIMAGINGGL_API bool SetRendererPlugin(TfToken const &id)
Set the current render-graph delegate to id.
USDIMAGINGGL_API bool SetRendererAovs(TfTokenVector const &ids)
Set the current renderer AOVs to a list of ids.
static USDIMAGINGGL_API bool IsColorCorrectionCapable()
Returns true if the platform is color correction capable.
static USDIMAGINGGL_API SdfPathVector GetAvailableRenderSettingsPrimPaths(UsdPrim const &root)
Utility method to query available render settings prims.
USDIMAGINGGL_API HgiTextureHandle GetAovTexture(TfToken const &name) const
Returns an AOV texture handle for the given token.
USDIMAGINGGL_API bool IsPauseRendererSupported() const
Query the renderer as to whether it supports pausing and resuming.
static USDIMAGINGGL_API std::string GetRendererDisplayName(TfToken const &id)
Return the user-friendly name of a renderer plugin.
USDIMAGINGGL_API void SetRendererSetting(TfToken const &id, VtValue const &value)
Sets a renderer setting's value.
bool allowAsynchronousSceneProcessing
allowAsynchronousSceneProcessing indicates to constructed hydra scene indices that asynchronous proce...
Definition: engine.h:111
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 pres...
USDIMAGINGGL_API UsdImagingGLRendererSettingsList GetRendererSettingsList() const
Returns the list of renderer settings.
USDIMAGINGGL_API std::string GetRendererHgiDisplayName() const
Return the user-friendly name of the Hgi implementation.
USDIMAGINGGL_API TfToken GetCurrentRendererId() const
Return the id of the currently used renderer plugin.
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 dis...
static USDIMAGINGGL_API bool UseUsdImagingSceneIndex()
Returns true if using the UsdImaging scene index.
USDIMAGINGGL_API void ClearSelected()
Clear the list of prim paths that should be included in selection highlighting.
USDIMAGINGGL_API VtDictionary GetRenderStats() const
Returns render statistics.
USDIMAGINGGL_API HdCommandDescriptors GetRendererCommandDescriptors() const
Return command deescriptors for commands supported by the active render delegate.
USDIMAGINGGL_API void SetSelected(SdfPathVector const &paths)
Sets (replaces) the list of prim paths that should be included in selection highlighting.
bool gpuEnabled
The gpuEnabled argument determines if this instance will allow Hydra to use the GPU to produce images...
Definition: engine.h:104
USDIMAGINGGL_API bool TestIntersection(const PickParams &pickParams, const GfMatrix4d &viewMatrix, const GfMatrix4d &projectionMatrix, const UsdPrim &root, const UsdImagingGLRenderParams &params, IntersectionResultVector *outResults)
Perform picking by finding the intersection of objects in the scene with a renderered frustum.
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 pix...
USDIMAGINGGL_API void SetWindowPolicy(CameraUtilConformWindowPolicy policy)
Set the window policy to use.
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 void AddSelected(SdfPath const &path, int instanceIndex)
Add a path with instanceIndex to the list of prim paths that should be included in selection highligh...
USDIMAGINGGL_API void SetRootTransform(GfMatrix4d const &xf)
Sets the root transform.
USDIMAGINGGL_API void SetActiveRenderSettingsPrimPath(SdfPath const &)
Set active render settings prim to use to drive rendering.
USDIMAGINGGL_API bool GetGPUEnabled() const
Return if the GPU is enabled and can be used for any rendering tasks.
Parameters to construct UsdImagingGLEngine.
Definition: engine.h:89
Used as an arguments class for various methods in UsdImagingGLEngine.
Definition: renderParams.h:57
Overrides some data sources on the root prim.
A simple scene index adding HdSelectionsSchema to all prims selected with AddSelection.
A scene index consuming a UsdStage.
UsdPrim is the sole persistent scenegraph object on a UsdStage, and is the embodiment of a "Prim" as ...
Definition: prim.h:117
Represent a time value, which may be either numeric, holding a double value, or a sentinel value UsdT...
Definition: timeCode.h:72
A map with string keys and VtValue values.
Definition: dictionary.h:52
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:90
Standard pointer typedefs.
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
Definition: declarePtrs.h:58
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Definition: declarePtrs.h:72
RenderTask parameters (renderpass state).
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440