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(UsdImagingStageSceneIndex);
67
68using UsdStageWeakPtr = TfWeakPtr<class UsdStage>;
69
70namespace UsdImagingGLEngine_Impl
71{
72 using _AppSceneIndicesSharedPtr = std::shared_ptr<struct _AppSceneIndices>;
73}
74
80{
81public:
84 {
86 SdfPathVector excludedPaths;
87 SdfPathVector invisedPaths;
88 SdfPath sceneDelegateID = SdfPath::AbsoluteRootPath();
99 bool gpuEnabled = true;
107 };
108
109 // ---------------------------------------------------------------------
112 // ---------------------------------------------------------------------
113
114 USDIMAGINGGL_API
115 UsdImagingGLEngine(const Parameters &params);
116
125 USDIMAGINGGL_API
127 const TfToken& rendererPluginId = TfToken(),
128 bool gpuEnabled = true);
129
130 USDIMAGINGGL_API
131 UsdImagingGLEngine(const SdfPath& rootPath,
132 const SdfPathVector& excludedPaths,
133 const SdfPathVector& invisedPaths = SdfPathVector(),
134 const SdfPath& sceneDelegateID =
136 const HdDriver& driver = HdDriver(),
137 const TfToken& rendererPluginId = TfToken(),
138 bool gpuEnabled = true,
139 bool displayUnloadedPrimsWithBounds = false,
140 bool allowAsynchronousSceneProcessing = false);
141
142 // Disallow copies
143 UsdImagingGLEngine(const UsdImagingGLEngine&) = delete;
144 UsdImagingGLEngine& operator=(const UsdImagingGLEngine&) = delete;
145
146 USDIMAGINGGL_API
148
150
151 // ---------------------------------------------------------------------
154 // ---------------------------------------------------------------------
155
157 USDIMAGINGGL_API
158 void PrepareBatch(const UsdPrim& root,
159 const UsdImagingGLRenderParams& params);
160 USDIMAGINGGL_API
161 void RenderBatch(const SdfPathVector& paths,
162 const UsdImagingGLRenderParams& params);
163
165 USDIMAGINGGL_API
166 void Render(const UsdPrim& root,
167 const UsdImagingGLRenderParams &params);
168
171 USDIMAGINGGL_API
172 bool IsConverged() const;
173
175
176 // ---------------------------------------------------------------------
179 // ---------------------------------------------------------------------
180
182 USDIMAGINGGL_API
184
186 USDIMAGINGGL_API
187 void SetRootVisibility(bool isVisible);
188
190
191 // ---------------------------------------------------------------------
194 // ---------------------------------------------------------------------
195
198 USDIMAGINGGL_API
199 void SetCameraPath(SdfPath const& id);
200
204 USDIMAGINGGL_API
205 void SetFraming(CameraUtilFraming const& framing);
206
216 USDIMAGINGGL_API
218 const std::optional<CameraUtilConformWindowPolicy> &policy);
219
223 USDIMAGINGGL_API
224 void SetRenderBufferSize(GfVec2i const& size);
225
231 USDIMAGINGGL_API
232 void SetRenderViewport(GfVec4d const& viewport);
233
237 USDIMAGINGGL_API
238 void SetWindowPolicy(CameraUtilConformWindowPolicy policy);
239
244 USDIMAGINGGL_API
245 void SetCameraState(const GfMatrix4d& viewMatrix,
246 const GfMatrix4d& projectionMatrix);
247
249
250 // ---------------------------------------------------------------------
253 // ---------------------------------------------------------------------
254
256 USDIMAGINGGL_API
257 void SetLightingState(GlfSimpleLightingContextPtr const &src);
258
263 USDIMAGINGGL_API
264 void SetLightingState(GlfSimpleLightVector const &lights,
265 GlfSimpleMaterial const &material,
266 GfVec4f const &sceneAmbient);
267
269
270 // ---------------------------------------------------------------------
273 // ---------------------------------------------------------------------
274
278 USDIMAGINGGL_API
279 void SetSelected(SdfPathVector const& paths);
280
283 USDIMAGINGGL_API
285
289 USDIMAGINGGL_API
290 void AddSelected(SdfPath const &path, int instanceIndex);
291
293 USDIMAGINGGL_API
294 void SetSelectionColor(GfVec4f const& color);
295
297
298 // ---------------------------------------------------------------------
301 // ---------------------------------------------------------------------
302
322 USDIMAGINGGL_API
324 const GfMatrix4d &viewMatrix,
325 const GfMatrix4d &projectionMatrix,
326 const UsdPrim& root,
327 const UsdImagingGLRenderParams &params,
328 GfVec3d *outHitPoint,
329 GfVec3d *outHitNormal,
330 SdfPath *outHitPrimPath = NULL,
331 SdfPath *outHitInstancerPath = NULL,
332 int *outHitInstanceIndex = NULL,
333 HdInstancerContext *outInstancerContext = NULL);
334
335 // Pick result
336 struct IntersectionResult
337 {
338 GfVec3d hitPoint;
339 GfVec3d hitNormal;
340 SdfPath hitPrimPath;
341 SdfPath hitInstancerPath;
342 int hitInstanceIndex;
343 HdInstancerContext instancerContext;
344 };
345
346 typedef std::vector<struct IntersectionResult> IntersectionResultVector;
347
348 // Pick params
349 struct PickParams
350 {
351 TfToken resolveMode;
352 };
353
373 USDIMAGINGGL_API
375 const PickParams& pickParams,
376 const GfMatrix4d& viewMatrix,
377 const GfMatrix4d& projectionMatrix,
378 const UsdPrim& root,
379 const UsdImagingGLRenderParams& params,
380 IntersectionResultVector* outResults);
381
384 USDIMAGINGGL_API
386 unsigned char const primIdColor[4],
387 unsigned char const instanceIdColor[4],
388 SdfPath *outHitPrimPath = NULL,
389 SdfPath *outHitInstancerPath = NULL,
390 int *outHitInstanceIndex = NULL,
391 HdInstancerContext *outInstancerContext = NULL);
392
395 USDIMAGINGGL_API
397 int primIdx,
398 int instanceIdx,
399 SdfPath *outHitPrimPath = NULL,
400 SdfPath *outHitInstancerPath = NULL,
401 int *outHitInstanceIndex = NULL,
402 HdInstancerContext *outInstancerContext = NULL);
403
405
406 // ---------------------------------------------------------------------
409 // ---------------------------------------------------------------------
410
412 USDIMAGINGGL_API
414
416 USDIMAGINGGL_API
417 static std::string GetRendererDisplayName(TfToken const &id);
418
422 USDIMAGINGGL_API
423 std::string GetRendererHgiDisplayName() const;
424
426 USDIMAGINGGL_API
427 bool GetGPUEnabled() const;
428
430 USDIMAGINGGL_API
432
435 USDIMAGINGGL_API
436 bool SetRendererPlugin(TfToken const &id);
437
439
440 // ---------------------------------------------------------------------
443 // ---------------------------------------------------------------------
444
446 USDIMAGINGGL_API
448
450 USDIMAGINGGL_API
451 bool SetRendererAov(TfToken const& id);
452
454 USDIMAGINGGL_API
456
458 USDIMAGINGGL_API
460
462 USDIMAGINGGL_API
464
465 // ---------------------------------------------------------------------
468 // ---------------------------------------------------------------------
469
471 USDIMAGINGGL_API
472 UsdImagingGLRendererSettingsList GetRendererSettingsList() const;
473
475 USDIMAGINGGL_API
477
479 USDIMAGINGGL_API
481 VtValue const& value);
482
484
485 // ---------------------------------------------------------------------
489 // ---------------------------------------------------------------------
490
492 USDIMAGINGGL_API
494
496 USDIMAGINGGL_API
498
500 USDIMAGINGGL_API
501 static SdfPathVector
503
505
506 // ---------------------------------------------------------------------
509 // ---------------------------------------------------------------------
510
514 USDIMAGINGGL_API
515 void SetEnablePresentation(bool enabled);
516
522 USDIMAGINGGL_API
523 void SetPresentationOutput(TfToken const &api, VtValue const &framebuffer);
524
526
527 // ---------------------------------------------------------------------
530 // ---------------------------------------------------------------------
531
535 USDIMAGINGGL_API
536 HdCommandDescriptors GetRendererCommandDescriptors() const;
537
543 USDIMAGINGGL_API
545 const TfToken &command,
546 const HdCommandArgs &args = HdCommandArgs()) const;
547
548 // ---------------------------------------------------------------------
551 // ---------------------------------------------------------------------
552
554 USDIMAGINGGL_API
556
560 USDIMAGINGGL_API
562
566 USDIMAGINGGL_API
568
570 USDIMAGINGGL_API
572
576 USDIMAGINGGL_API
578
582 USDIMAGINGGL_API
584
586
587 // ---------------------------------------------------------------------
590 // ---------------------------------------------------------------------
591
606 USDIMAGINGGL_API
608 TfToken const& ccType,
609 TfToken const& ocioDisplay = {},
610 TfToken const& ocioView = {},
611 TfToken const& ocioColorSpace = {},
612 TfToken const& ocioLook = {});
613
615
617 USDIMAGINGGL_API
619
620 // ---------------------------------------------------------------------
623 // ---------------------------------------------------------------------
624
630 USDIMAGINGGL_API
632
634
635 // ---------------------------------------------------------------------
638 // ---------------------------------------------------------------------
639
642 USDIMAGINGGL_API
644
646
647 // ---------------------------------------------------------------------
650 // ---------------------------------------------------------------------
651
658 USDIMAGINGGL_API
660
662
663protected:
664
666 friend class UsdImagingGL_UnitTestGLDrawing;
667
670 USDIMAGINGGL_API
672
675 USDIMAGINGGL_API
677 const HdTaskSharedPtrVector tasks);
678
679 USDIMAGINGGL_API
680 void _Execute(const UsdImagingGLRenderParams &params,
681 const SdfPathVector &taskPaths);
682
683 USDIMAGINGGL_API
684 bool _CanPrepare(const UsdPrim& root);
685 USDIMAGINGGL_API
686 void _PreSetTime(const UsdImagingGLRenderParams& params);
687 USDIMAGINGGL_API
688 void _PostSetTime(const UsdImagingGLRenderParams& params);
689
690 USDIMAGINGGL_API
691 void _PrepareRender(const UsdImagingGLRenderParams& params);
692
693 USDIMAGINGGL_API
694 void _SetActiveRenderSettingsPrimFromStageMetadata(UsdStageWeakPtr stage);
695
696 USDIMAGINGGL_API
697 void _SetSceneGlobalsCurrentFrame(UsdTimeCode const &time);
698
699 USDIMAGINGGL_API
700 void _UpdateDomeLightCameraVisibility();
701
702 using BBoxVector = std::vector<GfBBox3d>;
703
704 USDIMAGINGGL_API
705 void _SetBBoxParams(
706 const BBoxVector& bboxes,
707 const GfVec4f& bboxLineColor,
708 float bboxLineDashSize);
709
710 // Create a hydra collection given root paths and render params.
711 // Returns true if the collection was updated.
712 USDIMAGINGGL_API
713 static bool _UpdateHydraCollection(HdRprimCollection *collection,
714 SdfPathVector const& roots,
715 UsdImagingGLRenderParams const& params);
716 USDIMAGINGGL_API
717 static HdxRenderTaskParams _MakeHydraUsdImagingGLRenderParams(
718 UsdImagingGLRenderParams const& params);
719 USDIMAGINGGL_API
720 static void _ComputeRenderTags(UsdImagingGLRenderParams const& params,
721 TfTokenVector *renderTags);
722
723 USDIMAGINGGL_API
724 void _InitializeHgiIfNecessary();
725
726 USDIMAGINGGL_API
727 void _SetRenderDelegateAndRestoreState(
729
730 USDIMAGINGGL_API
731 void _SetRenderDelegate(HdPluginRenderDelegateUniqueHandle &&);
732
733 USDIMAGINGGL_API
734 SdfPath _ComputeControllerPath(const HdPluginRenderDelegateUniqueHandle &);
735
736 USDIMAGINGGL_API
737 static TfToken _GetDefaultRendererPluginId();
738
744 USDIMAGINGGL_API
746
747 USDIMAGINGGL_API
748 HdEngine *_GetHdEngine();
749
750 USDIMAGINGGL_API
751 HdxTaskController *_GetTaskController() const;
752
753 USDIMAGINGGL_API
754 HdSelectionSharedPtr _GetSelection() const;
755
756protected:
757
758 // Note that any of the fields below might become private
759 // in the future and subclasses should use the above getters
760 // to access them instead.
761
762 HgiUniquePtr _hgi;
763 // Similar for HdDriver.
764 HdDriver _hgiDriver;
765
766 VtValue _userFramebuffer;
767
768protected:
769 bool _displayUnloadedPrimsWithBounds;
770 bool _gpuEnabled;
772 std::unique_ptr<HdRenderIndex> _renderIndex;
773
774 SdfPath const _sceneDelegateId;
775
776 std::unique_ptr<HdxTaskController> _taskController;
777 HdxTaskControllerSceneIndexRefPtr _taskControllerSceneIndex;
778
779 HdxSelectionTrackerSharedPtr _selTracker;
780 HdRprimCollection _renderCollection;
781 HdRprimCollection _intersectCollection;
782
783 GlfSimpleLightingContextRefPtr _lightingContextForOpenGLState;
784
785 // Data we want to live across render plugin switches:
786 GfVec4f _selectionColor;
787 bool _domeLightCameraVisibility;
788
789 SdfPath _rootPath;
790 SdfPathVector _excludedPrimPaths;
791 SdfPathVector _invisedPrimPaths;
792 bool _isPopulated;
793
794private:
795 // Registers app-managed scene indices with the scene index plugin registry.
796 // This needs to be called once *before* the render index is constructed.
797 static void _RegisterApplicationSceneIndices();
798
799 // Creates and returns the scene globals scene index. This callback is
800 // registered prior to render index construction and is invoked during
801 // render index construction via
802 // HdSceneIndexPluginRegistry::AppendSceneIndicesForRenderer(..).
803 static HdSceneIndexBaseRefPtr
804 _AppendSceneGlobalsSceneIndexCallback(
805 const std::string &renderInstanceId,
806 const HdSceneIndexBaseRefPtr &inputScene,
807 const HdContainerDataSourceHandle &inputArgs);
808
809 HdSceneIndexBaseRefPtr
810 _AppendOverridesSceneIndices(
811 const HdSceneIndexBaseRefPtr &inputScene);
812
813 UsdImagingGLEngine_Impl::_AppSceneIndicesSharedPtr _appSceneIndices;
814
815 void _DestroyHydraObjects();
816
817 // Note that we'll only ever use one of _sceneIndex/_sceneDelegate
818 // at a time.
819 UsdImagingStageSceneIndexRefPtr _stageSceneIndex;
820 UsdImagingSelectionSceneIndexRefPtr _selectionSceneIndex;
821 UsdImagingRootOverridesSceneIndexRefPtr _rootOverridesSceneIndex;
822 HdsiLegacyDisplayStyleOverrideSceneIndexRefPtr _displayStyleSceneIndex;
823 HdsiPrimTypePruningSceneIndexRefPtr _materialPruningSceneIndex;
824 HdsiPrimTypePruningSceneIndexRefPtr _lightPruningSceneIndex;
825 HdSceneIndexBaseRefPtr _sceneIndex;
826
827 std::unique_ptr<UsdImagingDelegate> _sceneDelegate;
828
829 std::unique_ptr<HdEngine> _engine;
830
831 bool _allowAsynchronousSceneProcessing = false;
832};
833
834
835PXR_NAMESPACE_CLOSE_SCOPE
836
837#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:48
A scene index overriding the legacy display style for each prim.
Scene Index that prunes prims of given type (e.g., material) and (optionally) bindings to that prim t...
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:94
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:80
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:92
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 void _Execute(const UsdImagingGLRenderParams &params, const HdTaskSharedPtrVector tasks)
USDIMAGINGGL_API bool PauseRenderer()
Pause the renderer.
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:96
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 ...
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:102
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:106
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:99
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:84
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:147
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