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/noticeBatchingSceneIndex.h"
26#include "pxr/imaging/hd/rprimCollection.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;
58
59TF_DECLARE_WEAK_AND_REF_PTRS(GlfSimpleLightingContext);
70
71using UsdStageWeakPtr = TfWeakPtr<class UsdStage>;
72
73namespace UsdImagingGLEngine_Impl
74{
75 using _AppSceneIndicesSharedPtr = std::shared_ptr<struct _AppSceneIndices>;
76}
77
83{
84public:
87 {
89 SdfPathVector excludedPaths;
90 SdfPathVector invisedPaths;
91 SdfPath sceneDelegateID = SdfPath::AbsoluteRootPath();
102 bool gpuEnabled = true;
113 };
114
115 // ---------------------------------------------------------------------
118 // ---------------------------------------------------------------------
119
120 USDIMAGINGGL_API
121 UsdImagingGLEngine(const Parameters &params);
122
131 USDIMAGINGGL_API
133 const TfToken& rendererPluginId = TfToken(),
134 bool gpuEnabled = true);
135
136 USDIMAGINGGL_API
137 UsdImagingGLEngine(const SdfPath& rootPath,
138 const SdfPathVector& excludedPaths,
139 const SdfPathVector& invisedPaths = SdfPathVector(),
140 const SdfPath& sceneDelegateID =
142 const HdDriver& driver = HdDriver(),
143 const TfToken& rendererPluginId = TfToken(),
144 const bool gpuEnabled = true,
145 const bool displayUnloadedPrimsWithBounds = false,
146 const bool allowAsynchronousSceneProcessing = false,
147 const bool enableUsdDrawModes = true);
148
149 // Disallow copies
150 UsdImagingGLEngine(const UsdImagingGLEngine&) = delete;
151 UsdImagingGLEngine& operator=(const UsdImagingGLEngine&) = delete;
152
153 USDIMAGINGGL_API
155
157
158 // ---------------------------------------------------------------------
161 // ---------------------------------------------------------------------
162
164 USDIMAGINGGL_API
165 void PrepareBatch(const UsdPrim& root,
166 const UsdImagingGLRenderParams& params);
167 USDIMAGINGGL_API
168 void RenderBatch(const SdfPathVector& paths,
169 const UsdImagingGLRenderParams& params);
170
172 USDIMAGINGGL_API
173 void Render(const UsdPrim& root,
174 const UsdImagingGLRenderParams &params);
175
178 USDIMAGINGGL_API
179 bool IsConverged() const;
180
182
183 // ---------------------------------------------------------------------
186 // ---------------------------------------------------------------------
187
189 USDIMAGINGGL_API
191
193 USDIMAGINGGL_API
194 void SetRootVisibility(bool isVisible);
195
197
198 // ---------------------------------------------------------------------
201 // ---------------------------------------------------------------------
202
205 USDIMAGINGGL_API
206 void SetCameraPath(SdfPath const& id);
207
211 USDIMAGINGGL_API
212 void SetFraming(CameraUtilFraming const& framing);
213
223 USDIMAGINGGL_API
225 const std::optional<CameraUtilConformWindowPolicy> &policy);
226
230 USDIMAGINGGL_API
231 void SetRenderBufferSize(GfVec2i const& size);
232
238 USDIMAGINGGL_API
239 void SetRenderViewport(GfVec4d const& viewport);
240
244 USDIMAGINGGL_API
245 void SetWindowPolicy(CameraUtilConformWindowPolicy policy);
246
251 USDIMAGINGGL_API
252 void SetCameraState(const GfMatrix4d& viewMatrix,
253 const GfMatrix4d& projectionMatrix);
254
256
257 // ---------------------------------------------------------------------
260 // ---------------------------------------------------------------------
261
263 USDIMAGINGGL_API
264 void SetLightingState(GlfSimpleLightingContextPtr const &src);
265
270 USDIMAGINGGL_API
271 void SetLightingState(GlfSimpleLightVector const &lights,
272 GlfSimpleMaterial const &material,
273 GfVec4f const &sceneAmbient);
274
276
277 // ---------------------------------------------------------------------
280 // ---------------------------------------------------------------------
281
285 USDIMAGINGGL_API
286 void SetSelected(SdfPathVector const& paths);
287
290 USDIMAGINGGL_API
292
296 USDIMAGINGGL_API
297 void AddSelected(SdfPath const &path, int instanceIndex);
298
300 USDIMAGINGGL_API
301 void SetSelectionColor(GfVec4f const& color);
302
304
305 // ---------------------------------------------------------------------
308 // ---------------------------------------------------------------------
309
344
345 using IntersectionResultVector = std::vector<IntersectionResult>;
346
349 {
364 };
365
372 USDIMAGINGGL_API
374 const PickParams& pickParams,
375 const GfMatrix4d& viewMatrix,
376 const GfMatrix4d& projectionMatrix,
377 const UsdPrim& root,
378 const UsdImagingGLRenderParams& params,
379 IntersectionResultVector* outResults);
380
383 USDIMAGINGGL_API
385 unsigned char const primIdColor[4],
386 unsigned char const instanceIdColor[4],
387 SdfPath *outHitPrimPath = NULL,
388 SdfPath *outHitInstancerPath = NULL,
389 int *outHitInstanceIndex = NULL,
390 HdInstancerContext *outInstancerContext = NULL);
391
394 USDIMAGINGGL_API
396 int primIdx,
397 int instanceIdx,
398 SdfPath *outHitPrimPath = NULL,
399 SdfPath *outHitInstancerPath = NULL,
400 int *outHitInstanceIndex = NULL,
401 HdInstancerContext *outInstancerContext = NULL);
402
423 USDIMAGINGGL_API
425 const GfMatrix4d &viewMatrix,
426 const GfMatrix4d &projectionMatrix,
427 const UsdPrim& root,
428 const UsdImagingGLRenderParams &params,
429 GfVec3d *outHitPoint,
430 GfVec3d *outHitNormal,
431 SdfPath *outHitPrimPath = NULL,
432 SdfPath *outHitInstancerPath = NULL,
433 int *outHitInstanceIndex = NULL,
434 HdInstancerContext *outInstancerContext = NULL);
435
437
438 // ---------------------------------------------------------------------
441 // ---------------------------------------------------------------------
442
444 USDIMAGINGGL_API
446
448 USDIMAGINGGL_API
449 static std::string GetRendererDisplayName(TfToken const &id);
450
454 USDIMAGINGGL_API
455 std::string GetRendererHgiDisplayName() const;
456
458 USDIMAGINGGL_API
459 bool GetGPUEnabled() const;
460
462 USDIMAGINGGL_API
464
467 USDIMAGINGGL_API
468 bool SetRendererPlugin(TfToken const &id);
469
471
472 // ---------------------------------------------------------------------
475 // ---------------------------------------------------------------------
476
478 USDIMAGINGGL_API
480
482 USDIMAGINGGL_API
483 bool SetRendererAov(TfToken const& id);
484
486 USDIMAGINGGL_API
488
490 USDIMAGINGGL_API
492
494 USDIMAGINGGL_API
496
497 // ---------------------------------------------------------------------
500 // ---------------------------------------------------------------------
501
503 USDIMAGINGGL_API
504 UsdImagingGLRendererSettingsList GetRendererSettingsList() const;
505
507 USDIMAGINGGL_API
509
511 USDIMAGINGGL_API
513 VtValue const& value);
514
516
517 // ---------------------------------------------------------------------
521 // ---------------------------------------------------------------------
522
525 USDIMAGINGGL_API
527
530 USDIMAGINGGL_API
532
534 USDIMAGINGGL_API
535 static SdfPathVector
537
539 USDIMAGINGGL_API
541
543 USDIMAGINGGL_API
545
546
548
549 // ---------------------------------------------------------------------
552 // ---------------------------------------------------------------------
553
557 USDIMAGINGGL_API
558 void SetEnablePresentation(bool enabled);
559
565 USDIMAGINGGL_API
566 void SetPresentationOutput(TfToken const &api, VtValue const &framebuffer);
567
569
570 // ---------------------------------------------------------------------
573 // ---------------------------------------------------------------------
574
578 USDIMAGINGGL_API
579 HdCommandDescriptors GetRendererCommandDescriptors() const;
580
586 USDIMAGINGGL_API
588 const TfToken &command,
589 const HdCommandArgs &args = HdCommandArgs()) const;
590
591 // ---------------------------------------------------------------------
594 // ---------------------------------------------------------------------
595
597 USDIMAGINGGL_API
599
603 USDIMAGINGGL_API
605
609 USDIMAGINGGL_API
611
613 USDIMAGINGGL_API
615
619 USDIMAGINGGL_API
621
625 USDIMAGINGGL_API
627
629
630 // ---------------------------------------------------------------------
633 // ---------------------------------------------------------------------
634
649 USDIMAGINGGL_API
651 TfToken const& ccType,
652 TfToken const& ocioDisplay = {},
653 TfToken const& ocioView = {},
654 TfToken const& ocioColorSpace = {},
655 TfToken const& ocioLook = {});
656
658
660 USDIMAGINGGL_API
662
663 // ---------------------------------------------------------------------
666 // ---------------------------------------------------------------------
667
673 USDIMAGINGGL_API
675
677
678 // ---------------------------------------------------------------------
681 // ---------------------------------------------------------------------
682
685 USDIMAGINGGL_API
687
689
690 // ---------------------------------------------------------------------
693 // ---------------------------------------------------------------------
694
701 USDIMAGINGGL_API
703
705
706
707 // ---------------------------------------------------------------------
710 // ---------------------------------------------------------------------
711
713 USDIMAGINGGL_API
716
717protected:
718
720 friend class UsdImagingGL_UnitTestGLDrawing;
721
722 USDIMAGINGGL_API
723 void _Execute(const UsdImagingGLRenderParams &params,
724 const SdfPathVector &taskPaths);
725
726 USDIMAGINGGL_API
727 bool _CanPrepare(const UsdPrim& root);
728 USDIMAGINGGL_API
729 void _PreSetTime(const UsdImagingGLRenderParams& params);
730 USDIMAGINGGL_API
731 void _PostSetTime(const UsdImagingGLRenderParams& params);
732
733 USDIMAGINGGL_API
734 void _PrepareRender(const UsdImagingGLRenderParams& params);
735
736 USDIMAGINGGL_API
737 void _SetActiveRenderSettingsPrimFromStageMetadata(UsdStageWeakPtr stage);
738
739 USDIMAGINGGL_API
740 void _SetSceneGlobalsCurrentFrame(UsdTimeCode const &time);
741
742 USDIMAGINGGL_API
743 void _UpdateDomeLightCameraVisibility();
744
745 using BBoxVector = std::vector<GfBBox3d>;
746
747 USDIMAGINGGL_API
748 void _SetBBoxParams(
749 const BBoxVector& bboxes,
750 const GfVec4f& bboxLineColor,
751 float bboxLineDashSize);
752
753 // Create a hydra collection given root paths and render params.
754 // Returns true if the collection was updated.
755 USDIMAGINGGL_API
756 static bool _UpdateHydraCollection(HdRprimCollection *collection,
757 SdfPathVector const& roots,
758 UsdImagingGLRenderParams const& params);
759 USDIMAGINGGL_API
760 static HdxRenderTaskParams _MakeHydraUsdImagingGLRenderParams(
761 UsdImagingGLRenderParams const& params);
762 USDIMAGINGGL_API
763 static void _ComputeRenderTags(UsdImagingGLRenderParams const& params,
764 TfTokenVector *renderTags);
765
766 USDIMAGINGGL_API
767 SdfPath _ComputeControllerPath(const TfToken &pluginId);
768
769 USDIMAGINGGL_API
770 static TfToken _GetDefaultRendererPluginId();
771
777 USDIMAGINGGL_API
779
781 USDIMAGINGGL_API
782 HdSelectionSharedPtr _GetSelection() const;
783
784 USDIMAGINGGL_API
785 HdContainerDataSourceHandle
786 _GetSceneIndexCreateArgs(
787 HdRendererPluginHandle const &plugin);
788
789 USDIMAGINGGL_API
790 HdContainerDataSourceHandle
791 _GetSceneIndexCreateArgsFromLegacyRenderControl();
792
793 // Create UsdImagingStageSceneIndex and subsequent scene indices.
794 USDIMAGINGGL_API
795 HdSceneIndexBaseRefPtr
796 _CreateUsdImagingSceneIndices(HdContainerDataSourceHandle const &inputArgs);
797
798 // Create the merging scene index and all subsequent filtering scene index
799 // and the renderer fed by those.
800 USDIMAGINGGL_API
801 void
802 _CreateSceneIndexChainAndRenderer(
803 HdContainerDataSourceHandle const &sceneIndexCreateArgs,
804 HdRendererPluginHandle const &plugin,
805 const HdRendererCreateArgsSchema &rendererCreateArgs);
806
807 Hgi *
808 _GetOrCreateHgi();
809
810protected:
811 // The Hgi used by the renderer.
812 // It is either provided by the user or the Hgi::CreatePlatformDefaultHgi().
813 Hgi * _hgi;
814
815 // Result of Hgi::CreatePlatformDefaultHgi() if needed.
816 HgiUniquePtr _defaultHgi;
817
818 VtValue _userFramebuffer;
819
820protected:
821 bool _displayUnloadedPrimsWithBounds;
822 bool _gpuEnabled;
823
824 HdPluginRendererUniqueHandle _renderer; // Hydra 2.0
825 HdxTaskControllerSceneIndexRefPtr _taskControllerSceneIndex; // Hydra 2.0
826
827 SdfPath const _sceneDelegateId;
828
829 HdxSelectionTrackerSharedPtr _selTracker; // Hydra 1.0
830 HdRprimCollection _renderCollection;
831 HdRprimCollection _intersectCollection;
832
833 GlfSimpleLightingContextRefPtr _lightingContextForOpenGLState;
834
835 // Data we want to live across render plugin switches:
836 GfVec4f _selectionColor;
837 bool _domeLightCameraVisibility;
838
839 SdfPath _rootPath;
840 SdfPathVector _excludedPrimPaths;
841 SdfPathVector _invisedPrimPaths;
842 bool _isPopulated;
843
844private:
845 HdSceneIndexBaseRefPtr _GetTerminalSceneIndex() const;
846
847 HdLegacyRenderControlInterface * _GetLegacyRenderControl() const;
848
849 HdSceneIndexBaseRefPtr
850 _AppendOverridesSceneIndices(
851 const HdSceneIndexBaseRefPtr &inputScene);
852
853 UsdImagingGLEngine_Impl::_AppSceneIndicesSharedPtr _appSceneIndices;
854
855 bool _CreateSceneIndicesAndRenderer(
856 HdRendererPluginHandle const &plugin,
857 const HdRendererCreateArgsSchema &rendererCreateArgs);
858
859 void _DestroyHydraObjects();
860
861 SdfPath _GetInstancerForPrim(const SdfPath &sceneIndexPath) const;
862
863 // Note that we'll only ever use one of _sceneIndex/_sceneDelegate
864 // at a time.
865 UsdExecImagingStageSceneIndexInterfaceRefPtr _execStageSceneIndex;
866 HdNoticeBatchingSceneIndexRefPtr _noticeBatchingStageSceneIndex;
867 UsdImagingRootOverridesSceneIndexRefPtr _rootOverridesSceneIndex;
868 UsdImagingLegacyRenderSettingsSceneIndexRefPtr _legacyRenderSettingsSceneIndex;
869 HdsiLegacyDisplayStyleOverrideSceneIndexRefPtr _displayStyleSceneIndex;
870 HdsiPrimTypeAndPathPruningSceneIndexRefPtr _lightPruningSceneIndex;
871 // State of the _lightPruningSceneIndex.
872 bool _lightPruningSceneIndexEnableSceneLights;
873
874 UsdImagingSceneIndexRefPtr _usdImagingSceneIndex;
875
876 HdMergingSceneIndexRefPtr _mergingSceneIndex;
877 HdCachingSceneIndexRefPtr _cachingSceneIndex;
878 HdSceneIndexBaseRefPtr _terminalSceneIndex;
879
880 /* Hydra 1.0 */
881 std::unique_ptr<UsdImagingDelegate> _sceneDelegate;
882
883 bool _allowAsynchronousSceneProcessing = false;
884 bool _enableUsdDrawModes = true;
885};
886
887PXR_NAMESPACE_CLOSE_SCOPE
888
889#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
Transitory Hydra-1.0-like API for HdRenderer.
Merges multiple scenes together.
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...
Arguments to HdRendererPlugin::IsSupported and CreateRenderer.
A handle for HdRendererPlugin also storing the plugin id.
A named, semantic collection of objects.
Abstract interface to scene data.
Definition sceneIndex.h:55
A scene index providing override fallback values for 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
A scene index that provides values computed by exec.
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:83
USDIMAGINGGL_API void SetSelectionColor(GfVec4f const &color)
Sets the selection highlighting color.
USDIMAGINGGL_API bool StopRenderer()
Stop the renderer.
GfVec3d hitPoint
Intersection point in world space (that is, given projectionMatrix and viewMatrix are factored out of...
Definition engine.h:327
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 HdSelectionSharedPtr _GetSelection() const
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:95
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 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}.
SdfPath hitPrimPath
Path to picked gprim on the USD stage.
Definition engine.h:332
GfVec3d hitNormal
Normal at intersection point in world space.
Definition engine.h:329
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...
HdInstancerContext instancerContext
Paths to nested point instancers and instance indices identifying the picked instance.
Definition engine.h:342
TfToken rendererPluginId
The rendererPluginId argument indicates the renderer plugin that Hydra should use.
Definition engine.h:99
bool enableUsdDrawModes
enableUsdDrawModes enables the UsdGeomModelAPI draw mode feature.
Definition engine.h:112
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 bool PollForAsynchronousUpdates() const
If allowAsynchronousSceneProcessing is true within the Parameters provided to the UsdImagingGLEngine ...
TfToken resolveMode
Resolve mode.
Definition engine.h:363
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:105
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:109
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:102
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 given 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)
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:87
Used as an arguments class for various methods in UsdImagingGLEngine.
Overrides some data sources on the root prim.
A scene index encapsulating the chain of scene indices (resolving, e.g., USD native instancing) that ...
Definition sceneIndex.h:38
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