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/usdImagingGL/api.h"
15#include "pxr/usdImaging/usdImagingGL/version.h"
16#include "pxr/usdImaging/usdImaging/version.h"
17
19#include "pxr/usdImaging/usdImagingGL/rendererSettings.h"
20
21#include "pxr/imaging/cameraUtil/conformWindow.h"
22
23#include "pxr/imaging/hd/driver.h"
24#include "pxr/imaging/hd/engine.h"
25#include "pxr/imaging/hd/rprimCollection.h"
26#include "pxr/imaging/hd/pluginRenderDelegateUniqueHandle.h"
27#include "pxr/imaging/hd/pluginRendererUniqueHandle.h"
28
29#include "pxr/imaging/hdx/selectionTracker.h"
30#include "pxr/imaging/hdx/renderSetupTask.h"
31
32#include "pxr/imaging/hgi/hgi.h"
33
36
37#include "pxr/imaging/hgi/hgi.h"
38
39#include "pxr/usd/sdf/path.h"
40#include "pxr/usd/usd/timeCode.h"
41
42#include "pxr/base/gf/frustum.h"
44#include "pxr/base/gf/vec4d.h"
45#include "pxr/base/gf/vec4f.h"
46#include "pxr/base/gf/vec4i.h"
47
49
51
52PXR_NAMESPACE_OPEN_SCOPE
53
54class UsdPrim;
55class HdRenderIndex;
56class HdxTaskController;
58
59TF_DECLARE_WEAK_AND_REF_PTRS(GlfSimpleLightingContext);
60TF_DECLARE_REF_PTRS(HdNoticeBatchingSceneIndex);
61TF_DECLARE_REF_PTRS(UsdImagingStageSceneIndex);
71
72using UsdStageWeakPtr = TfWeakPtr<class UsdStage>;
73
74namespace UsdImagingGLEngine_Impl
75{
76 using _AppSceneIndicesSharedPtr = std::shared_ptr<struct _AppSceneIndices>;
77}
78
84{
85public:
88 {
90 SdfPathVector excludedPaths;
91 SdfPathVector invisedPaths;
92 SdfPath sceneDelegateID = SdfPath::AbsoluteRootPath();
103 bool gpuEnabled = true;
114 };
115
116 // ---------------------------------------------------------------------
119 // ---------------------------------------------------------------------
120
121 USDIMAGINGGL_API
122 UsdImagingGLEngine(const Parameters &params);
123
132 USDIMAGINGGL_API
134 const TfToken& rendererPluginId = TfToken(),
135 bool gpuEnabled = true);
136
137 USDIMAGINGGL_API
138 UsdImagingGLEngine(const SdfPath& rootPath,
139 const SdfPathVector& excludedPaths,
140 const SdfPathVector& invisedPaths = SdfPathVector(),
141 const SdfPath& sceneDelegateID =
143 const HdDriver& driver = HdDriver(),
144 const TfToken& rendererPluginId = TfToken(),
145 const bool gpuEnabled = true,
146 const bool displayUnloadedPrimsWithBounds = false,
147 const bool allowAsynchronousSceneProcessing = false,
148 const bool enableUsdDrawModes = true);
149
150 // Disallow copies
151 UsdImagingGLEngine(const UsdImagingGLEngine&) = delete;
152 UsdImagingGLEngine& operator=(const UsdImagingGLEngine&) = delete;
153
154 USDIMAGINGGL_API
156
158
159 // ---------------------------------------------------------------------
162 // ---------------------------------------------------------------------
163
165 USDIMAGINGGL_API
166 void PrepareBatch(const UsdPrim& root,
167 const UsdImagingGLRenderParams& params);
168 USDIMAGINGGL_API
169 void RenderBatch(const SdfPathVector& paths,
170 const UsdImagingGLRenderParams& params);
171
173 USDIMAGINGGL_API
174 void Render(const UsdPrim& root,
175 const UsdImagingGLRenderParams &params);
176
179 USDIMAGINGGL_API
180 bool IsConverged() const;
181
183
184 // ---------------------------------------------------------------------
187 // ---------------------------------------------------------------------
188
190 USDIMAGINGGL_API
192
194 USDIMAGINGGL_API
195 void SetRootVisibility(bool isVisible);
196
198
199 // ---------------------------------------------------------------------
202 // ---------------------------------------------------------------------
203
206 USDIMAGINGGL_API
207 void SetCameraPath(SdfPath const& id);
208
212 USDIMAGINGGL_API
213 void SetFraming(CameraUtilFraming const& framing);
214
224 USDIMAGINGGL_API
226 const std::optional<CameraUtilConformWindowPolicy> &policy);
227
231 USDIMAGINGGL_API
232 void SetRenderBufferSize(GfVec2i const& size);
233
239 USDIMAGINGGL_API
240 void SetRenderViewport(GfVec4d const& viewport);
241
245 USDIMAGINGGL_API
246 void SetWindowPolicy(CameraUtilConformWindowPolicy policy);
247
252 USDIMAGINGGL_API
253 void SetCameraState(const GfMatrix4d& viewMatrix,
254 const GfMatrix4d& projectionMatrix);
255
257
258 // ---------------------------------------------------------------------
261 // ---------------------------------------------------------------------
262
264 USDIMAGINGGL_API
265 void SetLightingState(GlfSimpleLightingContextPtr const &src);
266
271 USDIMAGINGGL_API
272 void SetLightingState(GlfSimpleLightVector const &lights,
273 GlfSimpleMaterial const &material,
274 GfVec4f const &sceneAmbient);
275
277
278 // ---------------------------------------------------------------------
281 // ---------------------------------------------------------------------
282
286 USDIMAGINGGL_API
287 void SetSelected(SdfPathVector const& paths);
288
291 USDIMAGINGGL_API
293
297 USDIMAGINGGL_API
298 void AddSelected(SdfPath const &path, int instanceIndex);
299
301 USDIMAGINGGL_API
302 void SetSelectionColor(GfVec4f const& color);
303
305
306 // ---------------------------------------------------------------------
309 // ---------------------------------------------------------------------
310
330 USDIMAGINGGL_API
332 const GfMatrix4d &viewMatrix,
333 const GfMatrix4d &projectionMatrix,
334 const UsdPrim& root,
335 const UsdImagingGLRenderParams &params,
336 GfVec3d *outHitPoint,
337 GfVec3d *outHitNormal,
338 SdfPath *outHitPrimPath = NULL,
339 SdfPath *outHitInstancerPath = NULL,
340 int *outHitInstanceIndex = NULL,
341 HdInstancerContext *outInstancerContext = NULL);
342
343 // Pick result
344 struct IntersectionResult
345 {
346 GfVec3d hitPoint;
347 GfVec3d hitNormal;
348 SdfPath hitPrimPath;
349 SdfPath hitInstancerPath;
350 int hitInstanceIndex;
351 HdInstancerContext instancerContext;
352 };
353
354 typedef std::vector<struct IntersectionResult> IntersectionResultVector;
355
356 // Pick params
357 struct PickParams
358 {
359 TfToken resolveMode;
360 };
361
381 USDIMAGINGGL_API
383 const PickParams& pickParams,
384 const GfMatrix4d& viewMatrix,
385 const GfMatrix4d& projectionMatrix,
386 const UsdPrim& root,
387 const UsdImagingGLRenderParams& params,
388 IntersectionResultVector* outResults);
389
392 USDIMAGINGGL_API
394 unsigned char const primIdColor[4],
395 unsigned char const instanceIdColor[4],
396 SdfPath *outHitPrimPath = NULL,
397 SdfPath *outHitInstancerPath = NULL,
398 int *outHitInstanceIndex = NULL,
399 HdInstancerContext *outInstancerContext = NULL);
400
403 USDIMAGINGGL_API
405 int primIdx,
406 int instanceIdx,
407 SdfPath *outHitPrimPath = NULL,
408 SdfPath *outHitInstancerPath = NULL,
409 int *outHitInstanceIndex = NULL,
410 HdInstancerContext *outInstancerContext = NULL);
411
413
414 // ---------------------------------------------------------------------
417 // ---------------------------------------------------------------------
418
420 USDIMAGINGGL_API
422
424 USDIMAGINGGL_API
425 static std::string GetRendererDisplayName(TfToken const &id);
426
430 USDIMAGINGGL_API
431 std::string GetRendererHgiDisplayName() const;
432
434 USDIMAGINGGL_API
435 bool GetGPUEnabled() const;
436
438 USDIMAGINGGL_API
440
443 USDIMAGINGGL_API
444 bool SetRendererPlugin(TfToken const &id);
445
447
448 // ---------------------------------------------------------------------
451 // ---------------------------------------------------------------------
452
454 USDIMAGINGGL_API
456
458 USDIMAGINGGL_API
459 bool SetRendererAov(TfToken const& id);
460
462 USDIMAGINGGL_API
464
466 USDIMAGINGGL_API
468
470 USDIMAGINGGL_API
472
473 // ---------------------------------------------------------------------
476 // ---------------------------------------------------------------------
477
479 USDIMAGINGGL_API
480 UsdImagingGLRendererSettingsList GetRendererSettingsList() const;
481
483 USDIMAGINGGL_API
485
487 USDIMAGINGGL_API
489 VtValue const& value);
490
492
493 // ---------------------------------------------------------------------
497 // ---------------------------------------------------------------------
498
501 USDIMAGINGGL_API
503
506 USDIMAGINGGL_API
508
510 USDIMAGINGGL_API
511 static SdfPathVector
513
515 USDIMAGINGGL_API
517
519 USDIMAGINGGL_API
521
522
524
525 // ---------------------------------------------------------------------
528 // ---------------------------------------------------------------------
529
533 USDIMAGINGGL_API
534 void SetEnablePresentation(bool enabled);
535
541 USDIMAGINGGL_API
542 void SetPresentationOutput(TfToken const &api, VtValue const &framebuffer);
543
545
546 // ---------------------------------------------------------------------
549 // ---------------------------------------------------------------------
550
554 USDIMAGINGGL_API
555 HdCommandDescriptors GetRendererCommandDescriptors() const;
556
562 USDIMAGINGGL_API
564 const TfToken &command,
565 const HdCommandArgs &args = HdCommandArgs()) const;
566
567 // ---------------------------------------------------------------------
570 // ---------------------------------------------------------------------
571
573 USDIMAGINGGL_API
575
579 USDIMAGINGGL_API
581
585 USDIMAGINGGL_API
587
589 USDIMAGINGGL_API
591
595 USDIMAGINGGL_API
597
601 USDIMAGINGGL_API
603
605
606 // ---------------------------------------------------------------------
609 // ---------------------------------------------------------------------
610
625 USDIMAGINGGL_API
627 TfToken const& ccType,
628 TfToken const& ocioDisplay = {},
629 TfToken const& ocioView = {},
630 TfToken const& ocioColorSpace = {},
631 TfToken const& ocioLook = {});
632
634
636 USDIMAGINGGL_API
638
639 // ---------------------------------------------------------------------
642 // ---------------------------------------------------------------------
643
649 USDIMAGINGGL_API
651
653
654 // ---------------------------------------------------------------------
657 // ---------------------------------------------------------------------
658
661 USDIMAGINGGL_API
663
665
666 // ---------------------------------------------------------------------
669 // ---------------------------------------------------------------------
670
677 USDIMAGINGGL_API
679
681
682
683 // ---------------------------------------------------------------------
686 // ---------------------------------------------------------------------
687
689 USDIMAGINGGL_API
692
693protected:
694
696 friend class UsdImagingGL_UnitTestGLDrawing;
697
700 USDIMAGINGGL_API
702
703 USDIMAGINGGL_API
704 void _Execute(const UsdImagingGLRenderParams &params,
705 const SdfPathVector &taskPaths);
706
707 USDIMAGINGGL_API
708 bool _CanPrepare(const UsdPrim& root);
709 USDIMAGINGGL_API
710 void _PreSetTime(const UsdImagingGLRenderParams& params);
711 USDIMAGINGGL_API
712 void _PostSetTime(const UsdImagingGLRenderParams& params);
713
714 USDIMAGINGGL_API
715 void _PrepareRender(const UsdImagingGLRenderParams& params);
716
717 USDIMAGINGGL_API
718 void _SetActiveRenderSettingsPrimFromStageMetadata(UsdStageWeakPtr stage);
719
720 USDIMAGINGGL_API
721 void _SetSceneGlobalsCurrentFrame(UsdTimeCode const &time);
722
723 USDIMAGINGGL_API
724 void _UpdateDomeLightCameraVisibility();
725
726 using BBoxVector = std::vector<GfBBox3d>;
727
728 USDIMAGINGGL_API
729 void _SetBBoxParams(
730 const BBoxVector& bboxes,
731 const GfVec4f& bboxLineColor,
732 float bboxLineDashSize);
733
734 // Create a hydra collection given root paths and render params.
735 // Returns true if the collection was updated.
736 USDIMAGINGGL_API
737 static bool _UpdateHydraCollection(HdRprimCollection *collection,
738 SdfPathVector const& roots,
739 UsdImagingGLRenderParams const& params);
740 USDIMAGINGGL_API
741 static HdxRenderTaskParams _MakeHydraUsdImagingGLRenderParams(
742 UsdImagingGLRenderParams const& params);
743 USDIMAGINGGL_API
744 static void _ComputeRenderTags(UsdImagingGLRenderParams const& params,
745 TfTokenVector *renderTags);
746
747 USDIMAGINGGL_API
748 void _InitializeHgiIfNecessary();
749
750 USDIMAGINGGL_API
751 void _SetRenderDelegateAndRestoreState(
753
754 USDIMAGINGGL_API
755 void _SetRenderDelegate(HdPluginRenderDelegateUniqueHandle &&);
756
757 USDIMAGINGGL_API
758 SdfPath _ComputeControllerPath(const TfToken &pluginId);
759
760 USDIMAGINGGL_API
761 SdfPath _ComputeControllerPath(const HdPluginRenderDelegateUniqueHandle &);
762
763 USDIMAGINGGL_API
764 static TfToken _GetDefaultRendererPluginId();
765
771 USDIMAGINGGL_API
773
774 USDIMAGINGGL_API
775 HdEngine *_GetHdEngine();
776
779 USDIMAGINGGL_API
780 HdxTaskController *_GetTaskController() const;
781
782 USDIMAGINGGL_API
783 HdSelectionSharedPtr _GetSelection() const;
784
785 // Create UsdImagingStageSceneIndex and subsequent scene indices.
786 void
787 _CreateUsdImagingSceneIndices();
788
789protected:
790
791 // Note that any of the fields below might become private
792 // in the future and subclasses should use the above getters
793 // to access them instead.
794
795 HgiUniquePtr _hgi;
796 // Similar for HdDriver.
797 HdDriver _hgiDriver;
798
799 VtValue _userFramebuffer;
800
801protected:
802 bool _displayUnloadedPrimsWithBounds;
803 bool _gpuEnabled;
804
805 /* Hydra 2.0 */
806
808 HdxTaskControllerSceneIndexRefPtr _taskControllerSceneIndex;
809
810 /* Hydra 1.0 */
812 std::unique_ptr<HdRenderIndex> _renderIndex;
813 std::unique_ptr<HdxTaskController> _taskController;
814
815 SdfPath const _sceneDelegateId;
816
817 HdxSelectionTrackerSharedPtr _selTracker;
818 HdRprimCollection _renderCollection;
819 HdRprimCollection _intersectCollection;
820
821 GlfSimpleLightingContextRefPtr _lightingContextForOpenGLState;
822
823 // Data we want to live across render plugin switches:
824 GfVec4f _selectionColor;
825 bool _domeLightCameraVisibility;
826
827 SdfPath _rootPath;
828 SdfPathVector _excludedPrimPaths;
829 SdfPathVector _invisedPrimPaths;
830 bool _isPopulated;
831
832private:
833 bool _HasRenderer() const;
834 HdSceneIndexBaseRefPtr _GetTerminalSceneIndex() const;
835
836 HdSceneIndexBaseRefPtr
837 _AppendOverridesSceneIndices(
838 const HdSceneIndexBaseRefPtr &inputScene);
839
840 UsdImagingGLEngine_Impl::_AppSceneIndicesSharedPtr _appSceneIndices;
841
842 bool _CreateSceneIndicesAndRenderer(HdRendererPluginHandle const &plugin);
843
844 void _DestroyHydraObjects();
845
846 SdfPath _GetInstancerForPrim(const SdfPath &sceneIndexPath) const;
847
848 // Note that we'll only ever use one of _sceneIndex/_sceneDelegate
849 // at a time.
850 UsdImagingStageSceneIndexRefPtr _stageSceneIndex;
851 HdNoticeBatchingSceneIndexRefPtr _postInstancingNoticeBatchingSceneIndex;
852 UsdImagingSelectionSceneIndexRefPtr _selectionSceneIndex;
853 UsdImagingRootOverridesSceneIndexRefPtr _rootOverridesSceneIndex;
854 HdsiLegacyDisplayStyleOverrideSceneIndexRefPtr _displayStyleSceneIndex;
855 HdsiPrimTypeAndPathPruningSceneIndexRefPtr _lightPruningSceneIndex;
856 // State of the _lightPruningSceneIndex.
857 bool _lightPruningSceneIndexEnableSceneLights;
858 HdSceneIndexBaseRefPtr _usdImagingFinalSceneIndex;
859
860 HdMergingSceneIndexRefPtr _mergingSceneIndex;
861 HdCachingSceneIndexRefPtr _cachingSceneIndex;
862 HdSceneIndexBaseRefPtr _terminalSceneIndex;
863
864 /* Hydra 1.0 */
865 std::unique_ptr<UsdImagingDelegate> _sceneDelegate;
866 std::unique_ptr<HdEngine> _engine;
867
868 bool _allowAsynchronousSceneProcessing = false;
869 bool _enableUsdDrawModes = true;
870};
871
872PXR_NAMESPACE_CLOSE_SCOPE
873
874#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:274
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:84
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:96
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:100
bool enableUsdDrawModes
enableUsdDrawModes enables the UsdGeomModelAPI draw mode feature.
Definition: engine.h:113
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:106
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:110
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:103
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:88
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.
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