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"
19#include "pxr/usdImaging/usdImagingGL/rendererSettings.h"
20#include "pxr/imaging/cameraUtil/conformWindow.h"
21#include "pxr/imaging/hd/driver.h"
22#include "pxr/imaging/hd/noticeBatchingSceneIndex.h"
23#include "pxr/imaging/hd/rprimCollection.h"
24#include "pxr/imaging/hd/pluginRendererUniqueHandle.h"
25#include "pxr/imaging/hdx/selectionTracker.h"
26#include "pxr/imaging/hdx/renderSetupTask.h"
27#include "pxr/imaging/hgi/hgi.h"
30#include "pxr/imaging/hgi/hgi.h"
31#include "pxr/usd/sdf/path.h"
32#include "pxr/usd/usd/timeCode.h"
33#include "pxr/base/gf/frustum.h"
35#include "pxr/base/gf/vec4d.h"
36#include "pxr/base/gf/vec4f.h"
37#include "pxr/base/gf/vec4i.h"
40
41PXR_NAMESPACE_OPEN_SCOPE
42
43class UsdPrim;
46
47TF_DECLARE_WEAK_AND_REF_PTRS(GlfSimpleLightingContext);
60
61using UsdStageWeakPtr = TfWeakPtr<class UsdStage>;
62
63namespace UsdImagingGLEngine_Impl
64{
65 using _AppSceneIndicesSharedPtr = std::shared_ptr<struct _AppSceneIndices>;
66}
67
73{
74public:
77 {
79 SdfPathVector excludedPaths;
80 SdfPathVector invisedPaths;
81 SdfPath sceneDelegateID = SdfPath::AbsoluteRootPath();
92 bool gpuEnabled = true;
103 };
104
105 // ---------------------------------------------------------------------
108 // ---------------------------------------------------------------------
109
110 USDIMAGINGGL_API
111 UsdImagingGLEngine(const Parameters &params);
112
121 USDIMAGINGGL_API
123 const TfToken& rendererPluginId = TfToken(),
124 bool gpuEnabled = true);
125
126 USDIMAGINGGL_API
127 UsdImagingGLEngine(const SdfPath& rootPath,
128 const SdfPathVector& excludedPaths,
129 const SdfPathVector& invisedPaths = SdfPathVector(),
130 const SdfPath& sceneDelegateID =
132 const HdDriver& driver = HdDriver(),
133 const TfToken& rendererPluginId = TfToken(),
134 const bool gpuEnabled = true,
135 const bool displayUnloadedPrimsWithBounds = false,
136 const bool allowAsynchronousSceneProcessing = false,
137 const bool enableUsdDrawModes = true);
138
139 // Disallow copies
140 UsdImagingGLEngine(const UsdImagingGLEngine&) = delete;
141 UsdImagingGLEngine& operator=(const UsdImagingGLEngine&) = delete;
142
143 USDIMAGINGGL_API
145
147
148 // ---------------------------------------------------------------------
151 // ---------------------------------------------------------------------
152
154 USDIMAGINGGL_API
155 void PrepareBatch(const UsdPrim& root,
156 const UsdImagingGLRenderParams& params);
157 USDIMAGINGGL_API
158 void RenderBatch(const SdfPathVector& paths,
159 const UsdImagingGLRenderParams& params);
160
162 USDIMAGINGGL_API
163 void Render(const UsdPrim& root,
164 const UsdImagingGLRenderParams &params);
165
168 USDIMAGINGGL_API
169 bool IsConverged() const;
170
172
173 // ---------------------------------------------------------------------
176 // ---------------------------------------------------------------------
177
179 USDIMAGINGGL_API
181
183 USDIMAGINGGL_API
184 void SetRootVisibility(bool isVisible);
185
187
188 // ---------------------------------------------------------------------
191 // ---------------------------------------------------------------------
192
195 USDIMAGINGGL_API
196 void SetCameraPath(SdfPath const& id);
197
201 USDIMAGINGGL_API
202 void SetFraming(CameraUtilFraming const& framing);
203
213 USDIMAGINGGL_API
215 const std::optional<CameraUtilConformWindowPolicy> &policy);
216
220 USDIMAGINGGL_API
221 void SetRenderBufferSize(GfVec2i const& size);
222
228 USDIMAGINGGL_API
229 void SetRenderViewport(GfVec4d const& viewport);
230
234 USDIMAGINGGL_API
235 void SetWindowPolicy(CameraUtilConformWindowPolicy policy);
236
241 USDIMAGINGGL_API
242 void SetCameraState(const GfMatrix4d& viewMatrix,
243 const GfMatrix4d& projectionMatrix);
244
246
247 // ---------------------------------------------------------------------
250 // ---------------------------------------------------------------------
251
253 USDIMAGINGGL_API
254 void SetLightingState(GlfSimpleLightingContextPtr const &src);
255
260 USDIMAGINGGL_API
261 void SetLightingState(GlfSimpleLightVector const &lights,
262 GlfSimpleMaterial const &material,
263 GfVec4f const &sceneAmbient);
264
266
267 // ---------------------------------------------------------------------
270 // ---------------------------------------------------------------------
271
275 USDIMAGINGGL_API
276 void SetSelected(SdfPathVector const& paths);
277
280 USDIMAGINGGL_API
282
286 USDIMAGINGGL_API
287 void AddSelected(SdfPath const &path, int instanceIndex);
288
290 USDIMAGINGGL_API
291 void SetSelectionColor(GfVec4f const& color);
292
294
295 // ---------------------------------------------------------------------
298 // ---------------------------------------------------------------------
299
334
335 using IntersectionResultVector = std::vector<IntersectionResult>;
336
339 {
354 };
355
362 USDIMAGINGGL_API
364 const PickParams& pickParams,
365 const GfMatrix4d& viewMatrix,
366 const GfMatrix4d& projectionMatrix,
367 const UsdPrim& root,
368 const UsdImagingGLRenderParams& params,
369 IntersectionResultVector* outResults);
370
373 USDIMAGINGGL_API
375 unsigned char const primIdColor[4],
376 unsigned char const instanceIdColor[4],
377 SdfPath *outHitPrimPath = NULL,
378 SdfPath *outHitInstancerPath = NULL,
379 int *outHitInstanceIndex = NULL,
380 HdInstancerContext *outInstancerContext = NULL);
381
384 USDIMAGINGGL_API
386 int primIdx,
387 int instanceIdx,
388 SdfPath *outHitPrimPath = NULL,
389 SdfPath *outHitInstancerPath = NULL,
390 int *outHitInstanceIndex = NULL,
391 HdInstancerContext *outInstancerContext = NULL);
392
395 {
396 SdfPath primPath;
397 HdInstancerContext instancerContext;
398 };
399
400 using DecodeResultVector = std::vector<DecodeResult>;
401
402 struct PickId
403 {
404 int primId;
405 int instanceId;
406 };
407
408 using PickIdVector = std::vector<PickId>;
409
416 USDIMAGINGGL_API
417 DecodeResultVector DecodeIntersections(const PickIdVector& pickIds);
418
439 USDIMAGINGGL_API
441 const GfMatrix4d &viewMatrix,
442 const GfMatrix4d &projectionMatrix,
443 const UsdPrim& root,
444 const UsdImagingGLRenderParams &params,
445 GfVec3d *outHitPoint,
446 GfVec3d *outHitNormal,
447 SdfPath *outHitPrimPath = NULL,
448 SdfPath *outHitInstancerPath = NULL,
449 int *outHitInstanceIndex = NULL,
450 HdInstancerContext *outInstancerContext = NULL);
451
453
454 // ---------------------------------------------------------------------
457 // ---------------------------------------------------------------------
458
460 USDIMAGINGGL_API
462
464 USDIMAGINGGL_API
465 static std::string GetRendererDisplayName(TfToken const &id);
466
470 USDIMAGINGGL_API
471 std::string GetRendererHgiDisplayName() const;
472
474 USDIMAGINGGL_API
475 bool GetGPUEnabled() const;
476
478 USDIMAGINGGL_API
480
483 USDIMAGINGGL_API
484 bool SetRendererPlugin(TfToken const &id);
485
487
488 // ---------------------------------------------------------------------
491 // ---------------------------------------------------------------------
492
494 USDIMAGINGGL_API
496
498 USDIMAGINGGL_API
499 bool SetRendererAov(TfToken const& id);
500
502 USDIMAGINGGL_API
504
506 USDIMAGINGGL_API
508
510 USDIMAGINGGL_API
512
513 // ---------------------------------------------------------------------
516 // ---------------------------------------------------------------------
517
519 USDIMAGINGGL_API
520 UsdImagingGLRendererSettingsList GetRendererSettingsList() const;
521
523 USDIMAGINGGL_API
525
527 USDIMAGINGGL_API
529 VtValue const& value);
530
532
533 // ---------------------------------------------------------------------
537 // ---------------------------------------------------------------------
538
541 USDIMAGINGGL_API
543
546 USDIMAGINGGL_API
548
550 USDIMAGINGGL_API
551 static SdfPathVector
553
555 USDIMAGINGGL_API
557
559 USDIMAGINGGL_API
561
562
564
565 // ---------------------------------------------------------------------
568 // ---------------------------------------------------------------------
569
573 USDIMAGINGGL_API
574 void SetEnablePresentation(bool enabled);
575
581 USDIMAGINGGL_API
582 void SetPresentationOutput(TfToken const &api, VtValue const &framebuffer);
583
585
586 // ---------------------------------------------------------------------
589 // ---------------------------------------------------------------------
590
594 USDIMAGINGGL_API
595 HdCommandDescriptors GetRendererCommandDescriptors() const;
596
602 USDIMAGINGGL_API
604 const TfToken &command,
605 const HdCommandArgs &args = HdCommandArgs()) const;
606
607 // ---------------------------------------------------------------------
610 // ---------------------------------------------------------------------
611
613 USDIMAGINGGL_API
615
619 USDIMAGINGGL_API
621
625 USDIMAGINGGL_API
627
629 USDIMAGINGGL_API
631
635 USDIMAGINGGL_API
637
641 USDIMAGINGGL_API
643
645
646 // ---------------------------------------------------------------------
649 // ---------------------------------------------------------------------
650
665 USDIMAGINGGL_API
667 TfToken const& ccType,
668 TfToken const& ocioDisplay = {},
669 TfToken const& ocioView = {},
670 TfToken const& ocioColorSpace = {},
671 TfToken const& ocioLook = {});
672
674
676 USDIMAGINGGL_API
678
679 // ---------------------------------------------------------------------
682 // ---------------------------------------------------------------------
683
689 USDIMAGINGGL_API
691
693
694 // ---------------------------------------------------------------------
697 // ---------------------------------------------------------------------
698
701 USDIMAGINGGL_API
703
705
706 // ---------------------------------------------------------------------
709 // ---------------------------------------------------------------------
710
717 USDIMAGINGGL_API
719
721
722protected:
723
725 friend class UsdImagingGL_UnitTestGLDrawing;
726
727 USDIMAGINGGL_API
728 void _Execute(const UsdImagingGLRenderParams &params,
729 const SdfPathVector &taskPaths);
730 USDIMAGINGGL_API
731 bool _CanPrepare(const UsdPrim& root);
732 USDIMAGINGGL_API
733 void _PreSetTime(const UsdImagingGLRenderParams& params);
734 USDIMAGINGGL_API
735 void _PostSetTime(const UsdImagingGLRenderParams& params);
736 USDIMAGINGGL_API
737 void _PrepareRender(const UsdImagingGLRenderParams& params);
738 USDIMAGINGGL_API
739 void _SetSceneGlobalsCurrentFrame(UsdTimeCode const &time);
740
741 USDIMAGINGGL_API
742 void _UpdateDomeLightCameraVisibility();
743
744 using BBoxVector = std::vector<GfBBox3d>;
745
746 USDIMAGINGGL_API
747 void _SetBBoxParams(
748 const BBoxVector& bboxes,
749 const GfVec4f& bboxLineColor,
750 float bboxLineDashSize);
751
752 // Create a hydra collection given root paths and render params.
753 // Returns true if the collection was updated.
754 USDIMAGINGGL_API
755 static bool _UpdateHydraCollection(HdRprimCollection *collection,
756 SdfPathVector const& roots,
757 UsdImagingGLRenderParams const& params);
758 USDIMAGINGGL_API
759 static HdxRenderTaskParams _MakeHydraUsdImagingGLRenderParams(
760 UsdImagingGLRenderParams const& params);
761 USDIMAGINGGL_API
762 static void _ComputeRenderTags(UsdImagingGLRenderParams const& params,
763 TfTokenVector *renderTags);
764
765 USDIMAGINGGL_API
766 SdfPath _ComputeControllerPath(const TfToken &pluginId);
767
768 USDIMAGINGGL_API
769 static TfToken _GetDefaultRendererPluginId();
770
771 USDIMAGINGGL_API
772 HdContainerDataSourceHandle
773 _GetSceneIndexCreateArgs(
774 HdRendererPluginHandle const &plugin);
775
776 USDIMAGINGGL_API
777 HdContainerDataSourceHandle
778 _GetSceneIndexCreateArgsFromLegacyRenderControl();
779
780 // Create UsdImagingStageSceneIndex and subsequent scene indices.
781 USDIMAGINGGL_API
782 HdSceneIndexBaseRefPtr
783 _CreateUsdImagingSceneIndices(HdContainerDataSourceHandle const &inputArgs);
784
785 // Create the merging scene index and all subsequent filtering scene index
786 // and the renderer fed by those.
787 USDIMAGINGGL_API
788 void
789 _CreateSceneIndexChainAndRenderer(
790 HdContainerDataSourceHandle const &sceneIndexCreateArgs,
791 HdRendererPluginHandle const &plugin,
792 const HdRendererCreateArgsSchema &rendererCreateArgs);
793
794 // Get the terminal scene index of the scene index graph that feeds
795 // the renderer.
796 USDIMAGINGGL_API
797 HdSceneIndexBaseRefPtr
798 _GetTerminalSceneIndex() const;
799
800 Hgi *
801 _GetOrCreateHgi();
802
803protected:
804 // The Hgi used by the renderer.
805 // It is either provided by the user or the Hgi::CreatePlatformDefaultHgi().
806 Hgi * _hgi;
807
808 // Result of Hgi::CreatePlatformDefaultHgi() if needed.
809 HgiUniquePtr _defaultHgi;
810
811 VtValue _userFramebuffer;
812
813 bool _displayUnloadedPrimsWithBounds;
814 bool _gpuEnabled;
815
817 HdxTaskControllerSceneIndexRefPtr _taskControllerSceneIndex;
818
819 SdfPath const _sceneDelegateId;
820
821 HdxSelectionTrackerSharedPtr _selTracker; // Hydra 1.0
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 HdLegacyRenderControlInterface * _GetLegacyRenderControl() const;
838
839 // The application-managed render settings scene index, if the renderer
840 // advertised render setting descriptors (the Hydra 2.0 path). Null
841 // otherwise (in which case callers fall back to the legacy render control).
842 HdsiApplicationRenderSettingsSceneIndexRefPtr
843 _GetApplicationRenderSettingsSceneIndex() const;
844
845 HdsiPurposeFilteringSceneIndexRefPtr
846 _GetPurposeFilteringSceneIndex() const;
847
848 SdfPath _GetSceneIndexPrimPathFromPrimId(int primId) const;
849
850 HdSceneIndexBaseRefPtr
851 _AppendOverridesSceneIndices(
852 HdSceneIndexBaseRefPtr const &inputScene,
853 HdContainerDataSourceHandle const &sceneIndexCreateArgs);
854
855 UsdImagingGLEngine_Impl::_AppSceneIndicesSharedPtr _appSceneIndices;
856
857 HdSceneIndexBaseRefPtr
858 _CreateExecSceneIndices(const HdSceneIndexBaseRefPtr &inputScene);
859
860 bool _CreateSceneIndicesAndRenderer(
861 HdRendererPluginHandle const &plugin,
862 const HdRendererCreateArgsSchema &rendererCreateArgs);
863
864 void _DestroyHydraObjects();
865
866 SdfPath _GetInstancerForPrim(const SdfPath &sceneIndexPath) const;
867
868private:
869 // Scene indexes
870 UsdImagingStageSceneIndexInterfaceRefPtr _execStageSceneIndex;
871 HdNoticeBatchingSceneIndexRefPtr _noticeBatchingStageSceneIndex;
872 UsdImagingRootOverridesSceneIndexRefPtr _rootOverridesSceneIndex;
873 UsdImagingLegacyRenderSettingsSceneIndexRefPtr
874 _legacyRenderSettingsSceneIndex;
875 HdsiLegacyDisplayStyleOverrideSceneIndexRefPtr _displayStyleSceneIndex;
876 HdsiPrimTypeAndPathPruningSceneIndexRefPtr _lightPruningSceneIndex;
877 UsdImagingSceneIndexRefPtr _usdImagingSceneIndex;
878 HdMergingSceneIndexRefPtr _mergingSceneIndex;
879 HdCachingSceneIndexRefPtr _cachingSceneIndex;
880 HdSceneIndexBaseRefPtr _terminalSceneIndex;
881
882 // Create-args container data source returned by the renderer plugin
883 // (see HdRendererPlugin::GetSceneIndexCreateArgs). Retained so that
884 // GetRendererSettingsList() can source the render settings from it.
885 HdContainerDataSourceHandle _sceneIndexCreateArgs;
886
887 // State of the _lightPruningSceneIndex.
888 bool _lightPruningSceneIndexEnableSceneLights;
889
890 bool _allowAsynchronousSceneProcessing = false;
891 bool _enableUsdDrawModes = true;
892};
893
894PXR_NAMESPACE_CLOSE_SCOPE
895
896#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:47
Basic type for a vector of 4 double components.
Definition vec4d.h:48
Basic type for a vector of 4 float components.
Definition vec4f.h:48
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 filtering scene index that lets an application inject a single, authoritative render settings prim ...
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 prunes prims whose resolved (flattened) purpose is not in the configured set of acce...
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:81
Pointer storage with deletion detection.
Definition weakPtr.h:128
The UsdImagingGLEngine is the main entry point API for rendering USD scenes.
Definition engine.h:73
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:317
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 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:85
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:322
GfVec3d hitNormal
Normal at intersection point in world space.
Definition engine.h:319
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:332
TfToken rendererPluginId
The rendererPluginId argument indicates the renderer plugin that Hydra should use.
Definition engine.h:89
bool enableUsdDrawModes
enableUsdDrawModes enables the UsdGeomModelAPI draw mode feature.
Definition engine.h:102
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:353
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:95
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 renderer plugin.
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:99
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...
USDIMAGINGGL_API DecodeResultVector DecodeIntersections(const PickIdVector &pickIds)
Batch version of DecodeIntersection.
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:92
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.
Result of a batch DecodeIntersection call.
Definition engine.h:395
Parameters to construct UsdImagingGLEngine.
Definition engine.h:77
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
An interface for initial scene indices that populate the Hydra scene with prims and data sources from...
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:73
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:489