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
28#include "pxr/imaging/hdx/selectionTracker.h"
29#include "pxr/imaging/hdx/renderSetupTask.h"
30
31#include "pxr/imaging/hgi/hgi.h"
32
35
36#include "pxr/imaging/hgi/hgi.h"
37
38#include "pxr/usd/sdf/path.h"
39#include "pxr/usd/usd/timeCode.h"
40
41#include "pxr/base/gf/frustum.h"
43#include "pxr/base/gf/vec4d.h"
44#include "pxr/base/gf/vec4f.h"
45#include "pxr/base/gf/vec4i.h"
46
48
50
51PXR_NAMESPACE_OPEN_SCOPE
52
53class UsdPrim;
54class HdRenderIndex;
55class HdxTaskController;
57
58TF_DECLARE_WEAK_AND_REF_PTRS(GlfSimpleLightingContext);
59TF_DECLARE_REF_PTRS(HdNoticeBatchingSceneIndex);
60TF_DECLARE_REF_PTRS(UsdImagingStageSceneIndex);
68
69using UsdStageWeakPtr = TfWeakPtr<class UsdStage>;
70
71namespace UsdImagingGLEngine_Impl
72{
73 using _AppSceneIndicesSharedPtr = std::shared_ptr<struct _AppSceneIndices>;
74}
75
81{
82public:
85 {
87 SdfPathVector excludedPaths;
88 SdfPathVector invisedPaths;
89 SdfPath sceneDelegateID = SdfPath::AbsoluteRootPath();
100 bool gpuEnabled = true;
111 };
112
113 // ---------------------------------------------------------------------
116 // ---------------------------------------------------------------------
117
118 USDIMAGINGGL_API
119 UsdImagingGLEngine(const Parameters &params);
120
129 USDIMAGINGGL_API
131 const TfToken& rendererPluginId = TfToken(),
132 bool gpuEnabled = true);
133
134 USDIMAGINGGL_API
135 UsdImagingGLEngine(const SdfPath& rootPath,
136 const SdfPathVector& excludedPaths,
137 const SdfPathVector& invisedPaths = SdfPathVector(),
138 const SdfPath& sceneDelegateID =
140 const HdDriver& driver = HdDriver(),
141 const TfToken& rendererPluginId = TfToken(),
142 const bool gpuEnabled = true,
143 const bool displayUnloadedPrimsWithBounds = false,
144 const bool allowAsynchronousSceneProcessing = false,
145 const bool enableUsdDrawModes = true);
146
147 // Disallow copies
148 UsdImagingGLEngine(const UsdImagingGLEngine&) = delete;
149 UsdImagingGLEngine& operator=(const UsdImagingGLEngine&) = delete;
150
151 USDIMAGINGGL_API
153
155
156 // ---------------------------------------------------------------------
159 // ---------------------------------------------------------------------
160
162 USDIMAGINGGL_API
163 void PrepareBatch(const UsdPrim& root,
164 const UsdImagingGLRenderParams& params);
165 USDIMAGINGGL_API
166 void RenderBatch(const SdfPathVector& paths,
167 const UsdImagingGLRenderParams& params);
168
170 USDIMAGINGGL_API
171 void Render(const UsdPrim& root,
172 const UsdImagingGLRenderParams &params);
173
176 USDIMAGINGGL_API
177 bool IsConverged() const;
178
180
181 // ---------------------------------------------------------------------
184 // ---------------------------------------------------------------------
185
187 USDIMAGINGGL_API
189
191 USDIMAGINGGL_API
192 void SetRootVisibility(bool isVisible);
193
195
196 // ---------------------------------------------------------------------
199 // ---------------------------------------------------------------------
200
203 USDIMAGINGGL_API
204 void SetCameraPath(SdfPath const& id);
205
209 USDIMAGINGGL_API
210 void SetFraming(CameraUtilFraming const& framing);
211
221 USDIMAGINGGL_API
223 const std::optional<CameraUtilConformWindowPolicy> &policy);
224
228 USDIMAGINGGL_API
229 void SetRenderBufferSize(GfVec2i const& size);
230
236 USDIMAGINGGL_API
237 void SetRenderViewport(GfVec4d const& viewport);
238
242 USDIMAGINGGL_API
243 void SetWindowPolicy(CameraUtilConformWindowPolicy policy);
244
249 USDIMAGINGGL_API
250 void SetCameraState(const GfMatrix4d& viewMatrix,
251 const GfMatrix4d& projectionMatrix);
252
254
255 // ---------------------------------------------------------------------
258 // ---------------------------------------------------------------------
259
261 USDIMAGINGGL_API
262 void SetLightingState(GlfSimpleLightingContextPtr const &src);
263
268 USDIMAGINGGL_API
269 void SetLightingState(GlfSimpleLightVector const &lights,
270 GlfSimpleMaterial const &material,
271 GfVec4f const &sceneAmbient);
272
274
275 // ---------------------------------------------------------------------
278 // ---------------------------------------------------------------------
279
283 USDIMAGINGGL_API
284 void SetSelected(SdfPathVector const& paths);
285
288 USDIMAGINGGL_API
290
294 USDIMAGINGGL_API
295 void AddSelected(SdfPath const &path, int instanceIndex);
296
298 USDIMAGINGGL_API
299 void SetSelectionColor(GfVec4f const& color);
300
302
303 // ---------------------------------------------------------------------
306 // ---------------------------------------------------------------------
307
327 USDIMAGINGGL_API
329 const GfMatrix4d &viewMatrix,
330 const GfMatrix4d &projectionMatrix,
331 const UsdPrim& root,
332 const UsdImagingGLRenderParams &params,
333 GfVec3d *outHitPoint,
334 GfVec3d *outHitNormal,
335 SdfPath *outHitPrimPath = NULL,
336 SdfPath *outHitInstancerPath = NULL,
337 int *outHitInstanceIndex = NULL,
338 HdInstancerContext *outInstancerContext = NULL);
339
340 // Pick result
341 struct IntersectionResult
342 {
343 GfVec3d hitPoint;
344 GfVec3d hitNormal;
345 SdfPath hitPrimPath;
346 SdfPath hitInstancerPath;
347 int hitInstanceIndex;
348 HdInstancerContext instancerContext;
349 };
350
351 typedef std::vector<struct IntersectionResult> IntersectionResultVector;
352
353 // Pick params
354 struct PickParams
355 {
356 TfToken resolveMode;
357 };
358
378 USDIMAGINGGL_API
380 const PickParams& pickParams,
381 const GfMatrix4d& viewMatrix,
382 const GfMatrix4d& projectionMatrix,
383 const UsdPrim& root,
384 const UsdImagingGLRenderParams& params,
385 IntersectionResultVector* outResults);
386
389 USDIMAGINGGL_API
391 unsigned char const primIdColor[4],
392 unsigned char const instanceIdColor[4],
393 SdfPath *outHitPrimPath = NULL,
394 SdfPath *outHitInstancerPath = NULL,
395 int *outHitInstanceIndex = NULL,
396 HdInstancerContext *outInstancerContext = NULL);
397
400 USDIMAGINGGL_API
402 int primIdx,
403 int instanceIdx,
404 SdfPath *outHitPrimPath = NULL,
405 SdfPath *outHitInstancerPath = NULL,
406 int *outHitInstanceIndex = NULL,
407 HdInstancerContext *outInstancerContext = NULL);
408
410
411 // ---------------------------------------------------------------------
414 // ---------------------------------------------------------------------
415
417 USDIMAGINGGL_API
419
421 USDIMAGINGGL_API
422 static std::string GetRendererDisplayName(TfToken const &id);
423
427 USDIMAGINGGL_API
428 std::string GetRendererHgiDisplayName() const;
429
431 USDIMAGINGGL_API
432 bool GetGPUEnabled() const;
433
435 USDIMAGINGGL_API
437
440 USDIMAGINGGL_API
441 bool SetRendererPlugin(TfToken const &id);
442
444
445 // ---------------------------------------------------------------------
448 // ---------------------------------------------------------------------
449
451 USDIMAGINGGL_API
453
455 USDIMAGINGGL_API
456 bool SetRendererAov(TfToken const& id);
457
459 USDIMAGINGGL_API
461
463 USDIMAGINGGL_API
465
467 USDIMAGINGGL_API
469
470 // ---------------------------------------------------------------------
473 // ---------------------------------------------------------------------
474
476 USDIMAGINGGL_API
477 UsdImagingGLRendererSettingsList GetRendererSettingsList() const;
478
480 USDIMAGINGGL_API
482
484 USDIMAGINGGL_API
486 VtValue const& value);
487
489
490 // ---------------------------------------------------------------------
494 // ---------------------------------------------------------------------
495
498 USDIMAGINGGL_API
500
503 USDIMAGINGGL_API
505
507 USDIMAGINGGL_API
508 static SdfPathVector
510
512 USDIMAGINGGL_API
514
516 USDIMAGINGGL_API
518
519
521
522 // ---------------------------------------------------------------------
525 // ---------------------------------------------------------------------
526
530 USDIMAGINGGL_API
531 void SetEnablePresentation(bool enabled);
532
538 USDIMAGINGGL_API
539 void SetPresentationOutput(TfToken const &api, VtValue const &framebuffer);
540
542
543 // ---------------------------------------------------------------------
546 // ---------------------------------------------------------------------
547
551 USDIMAGINGGL_API
552 HdCommandDescriptors GetRendererCommandDescriptors() const;
553
559 USDIMAGINGGL_API
561 const TfToken &command,
562 const HdCommandArgs &args = HdCommandArgs()) const;
563
564 // ---------------------------------------------------------------------
567 // ---------------------------------------------------------------------
568
570 USDIMAGINGGL_API
572
576 USDIMAGINGGL_API
578
582 USDIMAGINGGL_API
584
586 USDIMAGINGGL_API
588
592 USDIMAGINGGL_API
594
598 USDIMAGINGGL_API
600
602
603 // ---------------------------------------------------------------------
606 // ---------------------------------------------------------------------
607
622 USDIMAGINGGL_API
624 TfToken const& ccType,
625 TfToken const& ocioDisplay = {},
626 TfToken const& ocioView = {},
627 TfToken const& ocioColorSpace = {},
628 TfToken const& ocioLook = {});
629
631
633 USDIMAGINGGL_API
635
636 // ---------------------------------------------------------------------
639 // ---------------------------------------------------------------------
640
646 USDIMAGINGGL_API
648
650
651 // ---------------------------------------------------------------------
654 // ---------------------------------------------------------------------
655
658 USDIMAGINGGL_API
660
662
663 // ---------------------------------------------------------------------
666 // ---------------------------------------------------------------------
667
674 USDIMAGINGGL_API
676
678
679protected:
680
682 friend class UsdImagingGL_UnitTestGLDrawing;
683
686 USDIMAGINGGL_API
688
689 USDIMAGINGGL_API
690 void _Execute(const UsdImagingGLRenderParams &params,
691 const SdfPathVector &taskPaths);
692
693 USDIMAGINGGL_API
694 bool _CanPrepare(const UsdPrim& root);
695 USDIMAGINGGL_API
696 void _PreSetTime(const UsdImagingGLRenderParams& params);
697 USDIMAGINGGL_API
698 void _PostSetTime(const UsdImagingGLRenderParams& params);
699
700 USDIMAGINGGL_API
701 void _PrepareRender(const UsdImagingGLRenderParams& params);
702
703 USDIMAGINGGL_API
704 void _SetActiveRenderSettingsPrimFromStageMetadata(UsdStageWeakPtr stage);
705
706 USDIMAGINGGL_API
707 void _SetSceneGlobalsCurrentFrame(UsdTimeCode const &time);
708
709 USDIMAGINGGL_API
710 void _UpdateDomeLightCameraVisibility();
711
712 using BBoxVector = std::vector<GfBBox3d>;
713
714 USDIMAGINGGL_API
715 void _SetBBoxParams(
716 const BBoxVector& bboxes,
717 const GfVec4f& bboxLineColor,
718 float bboxLineDashSize);
719
720 // Create a hydra collection given root paths and render params.
721 // Returns true if the collection was updated.
722 USDIMAGINGGL_API
723 static bool _UpdateHydraCollection(HdRprimCollection *collection,
724 SdfPathVector const& roots,
725 UsdImagingGLRenderParams const& params);
726 USDIMAGINGGL_API
727 static HdxRenderTaskParams _MakeHydraUsdImagingGLRenderParams(
728 UsdImagingGLRenderParams const& params);
729 USDIMAGINGGL_API
730 static void _ComputeRenderTags(UsdImagingGLRenderParams const& params,
731 TfTokenVector *renderTags);
732
733 USDIMAGINGGL_API
734 void _InitializeHgiIfNecessary();
735
736 USDIMAGINGGL_API
737 void _SetRenderDelegateAndRestoreState(
739
740 USDIMAGINGGL_API
741 void _SetRenderDelegate(HdPluginRenderDelegateUniqueHandle &&);
742
743 USDIMAGINGGL_API
744 SdfPath _ComputeControllerPath(const TfToken &pluginId);
745
746 USDIMAGINGGL_API
747 SdfPath _ComputeControllerPath(const HdPluginRenderDelegateUniqueHandle &);
748
749 USDIMAGINGGL_API
750 static TfToken _GetDefaultRendererPluginId();
751
757 USDIMAGINGGL_API
759
760 USDIMAGINGGL_API
761 HdEngine *_GetHdEngine();
762
765 USDIMAGINGGL_API
766 HdxTaskController *_GetTaskController() const;
767
768 USDIMAGINGGL_API
769 HdSelectionSharedPtr _GetSelection() const;
770
771 // Create UsdImagingStageSceneIndex and subsequent scene indices.
772 void
773 _CreateUsdImagingSceneIndices();
774
775protected:
776
777 // Note that any of the fields below might become private
778 // in the future and subclasses should use the above getters
779 // to access them instead.
780
781 HgiUniquePtr _hgi;
782 // Similar for HdDriver.
783 HdDriver _hgiDriver;
784
785 VtValue _userFramebuffer;
786
787protected:
788 bool _displayUnloadedPrimsWithBounds;
789 bool _gpuEnabled;
791 std::unique_ptr<HdRenderIndex> _renderIndex;
792
793 SdfPath const _sceneDelegateId;
794
795 std::unique_ptr<HdxTaskController> _taskController;
796 HdxTaskControllerSceneIndexRefPtr _taskControllerSceneIndex;
797
798 HdxSelectionTrackerSharedPtr _selTracker;
799 HdRprimCollection _renderCollection;
800 HdRprimCollection _intersectCollection;
801
802 GlfSimpleLightingContextRefPtr _lightingContextForOpenGLState;
803
804 // Data we want to live across render plugin switches:
805 GfVec4f _selectionColor;
806 bool _domeLightCameraVisibility;
807
808 SdfPath _rootPath;
809 SdfPathVector _excludedPrimPaths;
810 SdfPathVector _invisedPrimPaths;
811 bool _isPopulated;
812
813private:
814 bool _HasRenderer() const;
815 HdSceneIndexBaseRefPtr _GetTerminalSceneIndex() const;
816
817 HdSceneIndexBaseRefPtr
818 _AppendOverridesSceneIndices(
819 const HdSceneIndexBaseRefPtr &inputScene);
820
821 UsdImagingGLEngine_Impl::_AppSceneIndicesSharedPtr _appSceneIndices;
822
823 void _DestroyHydraObjects();
824
825 // Note that we'll only ever use one of _sceneIndex/_sceneDelegate
826 // at a time.
827 UsdImagingStageSceneIndexRefPtr _stageSceneIndex;
828 HdNoticeBatchingSceneIndexRefPtr _postInstancingNoticeBatchingSceneIndex;
829 UsdImagingSelectionSceneIndexRefPtr _selectionSceneIndex;
830 UsdImagingRootOverridesSceneIndexRefPtr _rootOverridesSceneIndex;
831 HdsiLegacyDisplayStyleOverrideSceneIndexRefPtr _displayStyleSceneIndex;
832 HdsiPrimTypeAndPathPruningSceneIndexRefPtr _lightPruningSceneIndex;
833 // State of the _lightPruningSceneIndex.
834 bool _lightPruningSceneIndexEnableSceneLights;
835 HdSceneIndexBaseRefPtr _sceneIndex;
836
837 std::unique_ptr<UsdImagingDelegate> _sceneDelegate;
838
839 std::unique_ptr<HdEngine> _engine;
840
841 bool _allowAsynchronousSceneProcessing = false;
842 bool _enableUsdDrawModes = true;
843};
844
845
846PXR_NAMESPACE_CLOSE_SCOPE
847
848#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
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
A (movable) handle for a render delegate that was created using a a 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 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:81
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:93
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:97
bool enableUsdDrawModes
enableUsdDrawModes enables the UsdGeomModelAPI draw mode feature.
Definition: engine.h:110
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:103
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:107
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 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:100
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:85
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:43
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:152
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