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/noticeBatchingSceneIndex.h"
27#include "pxr/imaging/hd/rprimCollection.h"
28#include "pxr/imaging/hd/pluginRenderDelegateUniqueHandle.h"
29#include "pxr/imaging/hd/pluginRendererUniqueHandle.h"
30
31#include "pxr/imaging/hdx/selectionTracker.h"
32#include "pxr/imaging/hdx/renderSetupTask.h"
33
34#include "pxr/imaging/hgi/hgi.h"
35
38
39#include "pxr/imaging/hgi/hgi.h"
40
41#include "pxr/usd/sdf/path.h"
42#include "pxr/usd/usd/timeCode.h"
43
44#include "pxr/base/gf/frustum.h"
46#include "pxr/base/gf/vec4d.h"
47#include "pxr/base/gf/vec4f.h"
48#include "pxr/base/gf/vec4i.h"
49
51
53
54PXR_NAMESPACE_OPEN_SCOPE
55
56class UsdPrim;
57class HdRenderIndex;
60
61TF_DECLARE_WEAK_AND_REF_PTRS(GlfSimpleLightingContext);
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
346
347 using IntersectionResultVector = std::vector<IntersectionResult>;
348
351 {
366 };
367
374 USDIMAGINGGL_API
376 const PickParams& pickParams,
377 const GfMatrix4d& viewMatrix,
378 const GfMatrix4d& projectionMatrix,
379 const UsdPrim& root,
380 const UsdImagingGLRenderParams& params,
381 IntersectionResultVector* outResults);
382
385 USDIMAGINGGL_API
387 unsigned char const primIdColor[4],
388 unsigned char const instanceIdColor[4],
389 SdfPath *outHitPrimPath = NULL,
390 SdfPath *outHitInstancerPath = NULL,
391 int *outHitInstanceIndex = NULL,
392 HdInstancerContext *outInstancerContext = NULL);
393
396 USDIMAGINGGL_API
398 int primIdx,
399 int instanceIdx,
400 SdfPath *outHitPrimPath = NULL,
401 SdfPath *outHitInstancerPath = NULL,
402 int *outHitInstanceIndex = NULL,
403 HdInstancerContext *outInstancerContext = NULL);
404
425 USDIMAGINGGL_API
427 const GfMatrix4d &viewMatrix,
428 const GfMatrix4d &projectionMatrix,
429 const UsdPrim& root,
430 const UsdImagingGLRenderParams &params,
431 GfVec3d *outHitPoint,
432 GfVec3d *outHitNormal,
433 SdfPath *outHitPrimPath = NULL,
434 SdfPath *outHitInstancerPath = NULL,
435 int *outHitInstanceIndex = NULL,
436 HdInstancerContext *outInstancerContext = NULL);
437
439
440 // ---------------------------------------------------------------------
443 // ---------------------------------------------------------------------
444
446 USDIMAGINGGL_API
448
450 USDIMAGINGGL_API
451 static std::string GetRendererDisplayName(TfToken const &id);
452
456 USDIMAGINGGL_API
457 std::string GetRendererHgiDisplayName() const;
458
460 USDIMAGINGGL_API
461 bool GetGPUEnabled() const;
462
464 USDIMAGINGGL_API
466
469 USDIMAGINGGL_API
470 bool SetRendererPlugin(TfToken const &id);
471
473
474 // ---------------------------------------------------------------------
477 // ---------------------------------------------------------------------
478
480 USDIMAGINGGL_API
482
484 USDIMAGINGGL_API
485 bool SetRendererAov(TfToken const& id);
486
488 USDIMAGINGGL_API
490
492 USDIMAGINGGL_API
494
496 USDIMAGINGGL_API
498
499 // ---------------------------------------------------------------------
502 // ---------------------------------------------------------------------
503
505 USDIMAGINGGL_API
506 UsdImagingGLRendererSettingsList GetRendererSettingsList() const;
507
509 USDIMAGINGGL_API
511
513 USDIMAGINGGL_API
515 VtValue const& value);
516
518
519 // ---------------------------------------------------------------------
523 // ---------------------------------------------------------------------
524
527 USDIMAGINGGL_API
529
532 USDIMAGINGGL_API
534
536 USDIMAGINGGL_API
537 static SdfPathVector
539
541 USDIMAGINGGL_API
543
545 USDIMAGINGGL_API
547
548
550
551 // ---------------------------------------------------------------------
554 // ---------------------------------------------------------------------
555
559 USDIMAGINGGL_API
560 void SetEnablePresentation(bool enabled);
561
567 USDIMAGINGGL_API
568 void SetPresentationOutput(TfToken const &api, VtValue const &framebuffer);
569
571
572 // ---------------------------------------------------------------------
575 // ---------------------------------------------------------------------
576
580 USDIMAGINGGL_API
581 HdCommandDescriptors GetRendererCommandDescriptors() const;
582
588 USDIMAGINGGL_API
590 const TfToken &command,
591 const HdCommandArgs &args = HdCommandArgs()) const;
592
593 // ---------------------------------------------------------------------
596 // ---------------------------------------------------------------------
597
599 USDIMAGINGGL_API
601
605 USDIMAGINGGL_API
607
611 USDIMAGINGGL_API
613
615 USDIMAGINGGL_API
617
621 USDIMAGINGGL_API
623
627 USDIMAGINGGL_API
629
631
632 // ---------------------------------------------------------------------
635 // ---------------------------------------------------------------------
636
651 USDIMAGINGGL_API
653 TfToken const& ccType,
654 TfToken const& ocioDisplay = {},
655 TfToken const& ocioView = {},
656 TfToken const& ocioColorSpace = {},
657 TfToken const& ocioLook = {});
658
660
662 USDIMAGINGGL_API
664
665 // ---------------------------------------------------------------------
668 // ---------------------------------------------------------------------
669
675 USDIMAGINGGL_API
677
679
680 // ---------------------------------------------------------------------
683 // ---------------------------------------------------------------------
684
687 USDIMAGINGGL_API
689
691
692 // ---------------------------------------------------------------------
695 // ---------------------------------------------------------------------
696
703 USDIMAGINGGL_API
705
707
708
709 // ---------------------------------------------------------------------
712 // ---------------------------------------------------------------------
713
715 USDIMAGINGGL_API
718
719protected:
720
722 friend class UsdImagingGL_UnitTestGLDrawing;
723
728 USDIMAGINGGL_API
730
731 USDIMAGINGGL_API
732 void _Execute(const UsdImagingGLRenderParams &params,
733 const SdfPathVector &taskPaths);
734
735 USDIMAGINGGL_API
736 bool _CanPrepare(const UsdPrim& root);
737 USDIMAGINGGL_API
738 void _PreSetTime(const UsdImagingGLRenderParams& params);
739 USDIMAGINGGL_API
740 void _PostSetTime(const UsdImagingGLRenderParams& params);
741
742 USDIMAGINGGL_API
743 void _PrepareRender(const UsdImagingGLRenderParams& params);
744
745 USDIMAGINGGL_API
746 void _SetActiveRenderSettingsPrimFromStageMetadata(UsdStageWeakPtr stage);
747
748 USDIMAGINGGL_API
749 void _SetSceneGlobalsCurrentFrame(UsdTimeCode const &time);
750
751 USDIMAGINGGL_API
752 void _UpdateDomeLightCameraVisibility();
753
754 using BBoxVector = std::vector<GfBBox3d>;
755
756 USDIMAGINGGL_API
757 void _SetBBoxParams(
758 const BBoxVector& bboxes,
759 const GfVec4f& bboxLineColor,
760 float bboxLineDashSize);
761
762 // Create a hydra collection given root paths and render params.
763 // Returns true if the collection was updated.
764 USDIMAGINGGL_API
765 static bool _UpdateHydraCollection(HdRprimCollection *collection,
766 SdfPathVector const& roots,
767 UsdImagingGLRenderParams const& params);
768 USDIMAGINGGL_API
769 static HdxRenderTaskParams _MakeHydraUsdImagingGLRenderParams(
770 UsdImagingGLRenderParams const& params);
771 USDIMAGINGGL_API
772 static void _ComputeRenderTags(UsdImagingGLRenderParams const& params,
773 TfTokenVector *renderTags);
774
775 USDIMAGINGGL_API
776 void _InitializeHgiIfNecessary();
777
778 USDIMAGINGGL_API
779 void _SetRenderDelegateAndRestoreState(
781 HdContainerDataSourceHandle const &sceneIndexInputArgs);
782
783 USDIMAGINGGL_API
784 void _SetRenderDelegate(
786 HdContainerDataSourceHandle const &sceneIndexInputArgs);
787
788 USDIMAGINGGL_API
789 SdfPath _ComputeControllerPath(const TfToken &pluginId);
790
791 USDIMAGINGGL_API
792 SdfPath _ComputeControllerPath(const HdPluginRenderDelegateUniqueHandle &);
793
794 USDIMAGINGGL_API
795 static TfToken _GetDefaultRendererPluginId();
796
802 USDIMAGINGGL_API
804
806 USDIMAGINGGL_API
808
810 USDIMAGINGGL_API
811 HdSelectionSharedPtr _GetSelection() const;
812
813 // Create UsdImagingStageSceneIndex and subsequent scene indices.
814 void
815 _CreateUsdImagingSceneIndices(HdContainerDataSourceHandle const &inputArgs);
816
817protected:
818
819 // Note that any of the fields below might become private
820 // in the future and subclasses should use the above getters
821 // to access them instead.
822
823 HgiUniquePtr _hgi;
824 // Similar for HdDriver.
825 HdDriver _hgiDriver;
826
827 VtValue _userFramebuffer;
828
829protected:
830 bool _displayUnloadedPrimsWithBounds;
831 bool _gpuEnabled;
832
833 HdPluginRendererUniqueHandle _renderer; // Hydra 2.0
834 HdxTaskControllerSceneIndexRefPtr _taskControllerSceneIndex; // Hydra 2.0
835
836 HdPluginRenderDelegateUniqueHandle _renderDelegate; // \deprecated Hydra 1.0
837 std::unique_ptr<HdRenderIndex> _renderIndex; // \deprecated Hydra 1.0
838
839 SdfPath const _sceneDelegateId;
840
841 HdxSelectionTrackerSharedPtr _selTracker; // Hydra 1.0
842 HdRprimCollection _renderCollection;
843 HdRprimCollection _intersectCollection;
844
845 GlfSimpleLightingContextRefPtr _lightingContextForOpenGLState;
846
847 // Data we want to live across render plugin switches:
848 GfVec4f _selectionColor;
849 bool _domeLightCameraVisibility;
850
851 SdfPath _rootPath;
852 SdfPathVector _excludedPrimPaths;
853 SdfPathVector _invisedPrimPaths;
854 bool _isPopulated;
855
856private:
857 bool _HasRenderer() const;
858 HdSceneIndexBaseRefPtr _GetTerminalSceneIndex() const;
859
860 HdSceneIndexBaseRefPtr
861 _AppendOverridesSceneIndices(
862 const HdSceneIndexBaseRefPtr &inputScene);
863
864 UsdImagingGLEngine_Impl::_AppSceneIndicesSharedPtr _appSceneIndices;
865
866 bool _CreateSceneIndicesAndRenderer(
867 HdRendererPluginHandle const &plugin,
868 const HdRendererCreateArgsSchema &rendererCreateArgs,
869 HdContainerDataSourceHandle const &sceneIndexInputArgs,
870 bool hasRendererPluginSceneIndexInputArgs);
871
872 void _DestroyHydraObjects();
873
874 SdfPath _GetInstancerForPrim(const SdfPath &sceneIndexPath) const;
875
876 // Note that we'll only ever use one of _sceneIndex/_sceneDelegate
877 // at a time.
878 UsdExecImagingStageSceneIndexInterfaceRefPtr _execStageSceneIndex;
879 HdNoticeBatchingSceneIndexRefPtr _noticeBatchingStageSceneIndex;
880 UsdImagingRootOverridesSceneIndexRefPtr _rootOverridesSceneIndex;
881 UsdImagingLegacyRenderSettingsSceneIndexRefPtr _legacyRenderSettingsSceneIndex;
882 HdsiLegacyDisplayStyleOverrideSceneIndexRefPtr _displayStyleSceneIndex;
883 HdsiPrimTypeAndPathPruningSceneIndexRefPtr _lightPruningSceneIndex;
884 // State of the _lightPruningSceneIndex.
885 bool _lightPruningSceneIndexEnableSceneLights;
886
887 UsdImagingSceneIndexRefPtr _usdImagingSceneIndex;
888 HdSceneIndexBaseRefPtr _usdImagingFinalSceneIndex;
889
890 HdMergingSceneIndexRefPtr _mergingSceneIndex;
891 HdCachingSceneIndexRefPtr _cachingSceneIndex;
892 HdSceneIndexBaseRefPtr _terminalSceneIndex;
893
894 /* Hydra 1.0 */
895 std::unique_ptr<UsdImagingDelegate> _sceneDelegate;
896
897 // \deprecated
898 std::unique_ptr<HdEngine> _engine;
899
900 bool _allowAsynchronousSceneProcessing = false;
901 bool _enableUsdDrawModes = true;
902};
903
904PXR_NAMESPACE_CLOSE_SCOPE
905
906#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...
The render index is part of the Hydra 1.0 API and is only used for emulation purposes so that HdScene...
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:85
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:329
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: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
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:334
GfVec3d hitNormal
Normal at intersection point in world space.
Definition engine.h:331
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:344
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 bool PollForAsynchronousUpdates() const
If allowAsynchronousSceneProcessing is true within the Parameters provided to the UsdImagingGLEngine ...
TfToken resolveMode
Resolve mode.
Definition engine.h:365
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.
USDIMAGINGGL_API HdEngine * _GetHdEngine()
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 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:89
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