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);
66
67using UsdStageWeakPtr = TfWeakPtr<class UsdStage>;
68
69namespace UsdImagingGLEngine_Impl
70{
71 using _AppSceneIndicesSharedPtr = std::shared_ptr<struct _AppSceneIndices>;
72}
73
79{
80public:
83 {
85 SdfPathVector excludedPaths;
86 SdfPathVector invisedPaths;
87 SdfPath sceneDelegateID = SdfPath::AbsoluteRootPath();
98 bool gpuEnabled = true;
106 };
107
108 // ---------------------------------------------------------------------
111 // ---------------------------------------------------------------------
112
113 USDIMAGINGGL_API
114 UsdImagingGLEngine(const Parameters &params);
115
124 USDIMAGINGGL_API
126 const TfToken& rendererPluginId = TfToken(),
127 bool gpuEnabled = true);
128
129 USDIMAGINGGL_API
130 UsdImagingGLEngine(const SdfPath& rootPath,
131 const SdfPathVector& excludedPaths,
132 const SdfPathVector& invisedPaths = SdfPathVector(),
133 const SdfPath& sceneDelegateID =
135 const HdDriver& driver = HdDriver(),
136 const TfToken& rendererPluginId = TfToken(),
137 bool gpuEnabled = true,
138 bool displayUnloadedPrimsWithBounds = false,
139 bool allowAsynchronousSceneProcessing = false);
140
141 // Disallow copies
142 UsdImagingGLEngine(const UsdImagingGLEngine&) = delete;
143 UsdImagingGLEngine& operator=(const UsdImagingGLEngine&) = delete;
144
145 USDIMAGINGGL_API
147
149
150 // ---------------------------------------------------------------------
153 // ---------------------------------------------------------------------
154
156 USDIMAGINGGL_API
157 void PrepareBatch(const UsdPrim& root,
158 const UsdImagingGLRenderParams& params);
159 USDIMAGINGGL_API
160 void RenderBatch(const SdfPathVector& paths,
161 const UsdImagingGLRenderParams& params);
162
164 USDIMAGINGGL_API
165 void Render(const UsdPrim& root,
166 const UsdImagingGLRenderParams &params);
167
170 USDIMAGINGGL_API
171 bool IsConverged() const;
172
174
175 // ---------------------------------------------------------------------
178 // ---------------------------------------------------------------------
179
181 USDIMAGINGGL_API
183
185 USDIMAGINGGL_API
186 void SetRootVisibility(bool isVisible);
187
189
190 // ---------------------------------------------------------------------
193 // ---------------------------------------------------------------------
194
197 USDIMAGINGGL_API
198 void SetCameraPath(SdfPath const& id);
199
203 USDIMAGINGGL_API
204 void SetFraming(CameraUtilFraming const& framing);
205
215 USDIMAGINGGL_API
217 const std::optional<CameraUtilConformWindowPolicy> &policy);
218
222 USDIMAGINGGL_API
223 void SetRenderBufferSize(GfVec2i const& size);
224
230 USDIMAGINGGL_API
231 void SetRenderViewport(GfVec4d const& viewport);
232
236 USDIMAGINGGL_API
237 void SetWindowPolicy(CameraUtilConformWindowPolicy policy);
238
243 USDIMAGINGGL_API
244 void SetCameraState(const GfMatrix4d& viewMatrix,
245 const GfMatrix4d& projectionMatrix);
246
248
249 // ---------------------------------------------------------------------
252 // ---------------------------------------------------------------------
253
255 USDIMAGINGGL_API
256 void SetLightingState(GlfSimpleLightingContextPtr const &src);
257
262 USDIMAGINGGL_API
263 void SetLightingState(GlfSimpleLightVector const &lights,
264 GlfSimpleMaterial const &material,
265 GfVec4f const &sceneAmbient);
266
268
269 // ---------------------------------------------------------------------
272 // ---------------------------------------------------------------------
273
277 USDIMAGINGGL_API
278 void SetSelected(SdfPathVector const& paths);
279
282 USDIMAGINGGL_API
284
288 USDIMAGINGGL_API
289 void AddSelected(SdfPath const &path, int instanceIndex);
290
292 USDIMAGINGGL_API
293 void SetSelectionColor(GfVec4f const& color);
294
296
297 // ---------------------------------------------------------------------
300 // ---------------------------------------------------------------------
301
321 USDIMAGINGGL_API
323 const GfMatrix4d &viewMatrix,
324 const GfMatrix4d &projectionMatrix,
325 const UsdPrim& root,
326 const UsdImagingGLRenderParams &params,
327 GfVec3d *outHitPoint,
328 GfVec3d *outHitNormal,
329 SdfPath *outHitPrimPath = NULL,
330 SdfPath *outHitInstancerPath = NULL,
331 int *outHitInstanceIndex = NULL,
332 HdInstancerContext *outInstancerContext = NULL);
333
334 // Pick result
335 struct IntersectionResult
336 {
337 GfVec3d hitPoint;
338 GfVec3d hitNormal;
339 SdfPath hitPrimPath;
340 SdfPath hitInstancerPath;
341 int hitInstanceIndex;
342 HdInstancerContext instancerContext;
343 };
344
345 typedef std::vector<struct IntersectionResult> IntersectionResultVector;
346
347 // Pick params
348 struct PickParams
349 {
350 TfToken resolveMode;
351 };
352
372 USDIMAGINGGL_API
374 const PickParams& pickParams,
375 const GfMatrix4d& viewMatrix,
376 const GfMatrix4d& projectionMatrix,
377 const UsdPrim& root,
378 const UsdImagingGLRenderParams& params,
379 IntersectionResultVector* outResults);
380
383 USDIMAGINGGL_API
385 unsigned char const primIdColor[4],
386 unsigned char const instanceIdColor[4],
387 SdfPath *outHitPrimPath = NULL,
388 SdfPath *outHitInstancerPath = NULL,
389 int *outHitInstanceIndex = NULL,
390 HdInstancerContext *outInstancerContext = NULL);
391
393
394 // ---------------------------------------------------------------------
397 // ---------------------------------------------------------------------
398
400 USDIMAGINGGL_API
402
404 USDIMAGINGGL_API
405 static std::string GetRendererDisplayName(TfToken const &id);
406
408 USDIMAGINGGL_API
409 bool GetGPUEnabled() const;
410
412 USDIMAGINGGL_API
414
417 USDIMAGINGGL_API
418 bool SetRendererPlugin(TfToken const &id);
419
421
422 // ---------------------------------------------------------------------
425 // ---------------------------------------------------------------------
426
428 USDIMAGINGGL_API
430
432 USDIMAGINGGL_API
433 bool SetRendererAov(TfToken const& id);
434
436 USDIMAGINGGL_API
438
440 USDIMAGINGGL_API
442
443 // ---------------------------------------------------------------------
446 // ---------------------------------------------------------------------
447
449 USDIMAGINGGL_API
450 UsdImagingGLRendererSettingsList GetRendererSettingsList() const;
451
453 USDIMAGINGGL_API
455
457 USDIMAGINGGL_API
459 VtValue const& value);
460
462
463 // ---------------------------------------------------------------------
467 // ---------------------------------------------------------------------
468
470 USDIMAGINGGL_API
472
474 USDIMAGINGGL_API
476
478 USDIMAGINGGL_API
479 static SdfPathVector
481
483
484 // ---------------------------------------------------------------------
487 // ---------------------------------------------------------------------
488
492 USDIMAGINGGL_API
493 void SetEnablePresentation(bool enabled);
494
500 USDIMAGINGGL_API
501 void SetPresentationOutput(TfToken const &api, VtValue const &framebuffer);
502
504
505 // ---------------------------------------------------------------------
508 // ---------------------------------------------------------------------
509
513 USDIMAGINGGL_API
514 HdCommandDescriptors GetRendererCommandDescriptors() const;
515
521 USDIMAGINGGL_API
523 const TfToken &command,
524 const HdCommandArgs &args = HdCommandArgs()) const;
525
526 // ---------------------------------------------------------------------
529 // ---------------------------------------------------------------------
530
532 USDIMAGINGGL_API
534
538 USDIMAGINGGL_API
540
544 USDIMAGINGGL_API
546
548 USDIMAGINGGL_API
550
554 USDIMAGINGGL_API
556
560 USDIMAGINGGL_API
562
564
565 // ---------------------------------------------------------------------
568 // ---------------------------------------------------------------------
569
584 USDIMAGINGGL_API
586 TfToken const& ccType,
587 TfToken const& ocioDisplay = {},
588 TfToken const& ocioView = {},
589 TfToken const& ocioColorSpace = {},
590 TfToken const& ocioLook = {});
591
593
595 USDIMAGINGGL_API
597
598 // ---------------------------------------------------------------------
601 // ---------------------------------------------------------------------
602
608 USDIMAGINGGL_API
610
612
613 // ---------------------------------------------------------------------
616 // ---------------------------------------------------------------------
617
620 USDIMAGINGGL_API
622
624
625 // ---------------------------------------------------------------------
628 // ---------------------------------------------------------------------
629
636 USDIMAGINGGL_API
638
640
641protected:
642
644 friend class UsdImagingGL_UnitTestGLDrawing;
645
648 USDIMAGINGGL_API
650
651 USDIMAGINGGL_API
652 void _Execute(const UsdImagingGLRenderParams &params,
653 HdTaskSharedPtrVector tasks);
654
655 USDIMAGINGGL_API
656 bool _CanPrepare(const UsdPrim& root);
657 USDIMAGINGGL_API
658 void _PreSetTime(const UsdImagingGLRenderParams& params);
659 USDIMAGINGGL_API
660 void _PostSetTime(const UsdImagingGLRenderParams& params);
661
662 USDIMAGINGGL_API
663 void _PrepareRender(const UsdImagingGLRenderParams& params);
664
665 USDIMAGINGGL_API
666 void _SetActiveRenderSettingsPrimFromStageMetadata(UsdStageWeakPtr stage);
667
668 USDIMAGINGGL_API
669 void _SetSceneGlobalsCurrentFrame(UsdTimeCode const &time);
670
671 USDIMAGINGGL_API
672 void _UpdateDomeLightCameraVisibility();
673
674 using BBoxVector = std::vector<GfBBox3d>;
675
676 USDIMAGINGGL_API
677 void _SetBBoxParams(
678 const BBoxVector& bboxes,
679 const GfVec4f& bboxLineColor,
680 float bboxLineDashSize);
681
682 // Create a hydra collection given root paths and render params.
683 // Returns true if the collection was updated.
684 USDIMAGINGGL_API
685 static bool _UpdateHydraCollection(HdRprimCollection *collection,
686 SdfPathVector const& roots,
687 UsdImagingGLRenderParams const& params);
688 USDIMAGINGGL_API
689 static HdxRenderTaskParams _MakeHydraUsdImagingGLRenderParams(
690 UsdImagingGLRenderParams const& params);
691 USDIMAGINGGL_API
692 static void _ComputeRenderTags(UsdImagingGLRenderParams const& params,
693 TfTokenVector *renderTags);
694
695 USDIMAGINGGL_API
696 void _InitializeHgiIfNecessary();
697
698 USDIMAGINGGL_API
699 void _SetRenderDelegateAndRestoreState(
701
702 USDIMAGINGGL_API
703 void _SetRenderDelegate(HdPluginRenderDelegateUniqueHandle &&);
704
705 USDIMAGINGGL_API
706 SdfPath _ComputeControllerPath(const HdPluginRenderDelegateUniqueHandle &);
707
708 USDIMAGINGGL_API
709 static TfToken _GetDefaultRendererPluginId();
710
716 USDIMAGINGGL_API
718
719 USDIMAGINGGL_API
720 HdEngine *_GetHdEngine();
721
722 USDIMAGINGGL_API
723 HdxTaskController *_GetTaskController() const;
724
725 USDIMAGINGGL_API
726 HdSelectionSharedPtr _GetSelection() const;
727
728protected:
729
730 // Note that any of the fields below might become private
731 // in the future and subclasses should use the above getters
732 // to access them instead.
733
734 HgiUniquePtr _hgi;
735 // Similar for HdDriver.
736 HdDriver _hgiDriver;
737
738 VtValue _userFramebuffer;
739
740protected:
741 bool _displayUnloadedPrimsWithBounds;
742 bool _gpuEnabled;
744 std::unique_ptr<HdRenderIndex> _renderIndex;
745
746 SdfPath const _sceneDelegateId;
747
748 std::unique_ptr<HdxTaskController> _taskController;
749
750 HdxSelectionTrackerSharedPtr _selTracker;
751 HdRprimCollection _renderCollection;
752 HdRprimCollection _intersectCollection;
753
754 GlfSimpleLightingContextRefPtr _lightingContextForOpenGLState;
755
756 // Data we want to live across render plugin switches:
757 GfVec4f _selectionColor;
758 bool _domeLightCameraVisibility;
759
760 SdfPath _rootPath;
761 SdfPathVector _excludedPrimPaths;
762 SdfPathVector _invisedPrimPaths;
763 bool _isPopulated;
764
765private:
766 // Registers app-managed scene indices with the scene index plugin registry.
767 // This needs to be called once *before* the render index is constructed.
768 static void _RegisterApplicationSceneIndices();
769
770 // Creates and returns the scene globals scene index. This callback is
771 // registered prior to render index construction and is invoked during
772 // render index construction via
773 // HdSceneIndexPluginRegistry::AppendSceneIndicesForRenderer(..).
774 static HdSceneIndexBaseRefPtr
775 _AppendSceneGlobalsSceneIndexCallback(
776 const std::string &renderInstanceId,
777 const HdSceneIndexBaseRefPtr &inputScene,
778 const HdContainerDataSourceHandle &inputArgs);
779
780 HdSceneIndexBaseRefPtr
781 _AppendOverridesSceneIndices(
782 const HdSceneIndexBaseRefPtr &inputScene);
783
784 UsdImagingGLEngine_Impl::_AppSceneIndicesSharedPtr _appSceneIndices;
785
786 void _DestroyHydraObjects();
787
788 // Note that we'll only ever use one of _sceneIndex/_sceneDelegate
789 // at a time.
790 UsdImagingStageSceneIndexRefPtr _stageSceneIndex;
791 UsdImagingSelectionSceneIndexRefPtr _selectionSceneIndex;
792 UsdImagingRootOverridesSceneIndexRefPtr _rootOverridesSceneIndex;
793 HdsiLegacyDisplayStyleOverrideSceneIndexRefPtr _displayStyleSceneIndex;
794 HdsiPrimTypePruningSceneIndexRefPtr _materialPruningSceneIndex;
795 HdsiPrimTypePruningSceneIndexRefPtr _lightPruningSceneIndex;
796 HdSceneIndexBaseRefPtr _sceneIndex;
797
798 std::unique_ptr<UsdImagingDelegate> _sceneDelegate;
799
800 std::unique_ptr<HdEngine> _engine;
801
802 bool _allowAsynchronousSceneProcessing = false;
803};
804
805
806PXR_NAMESPACE_CLOSE_SCOPE
807
808#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:104
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 a "sceneGlobals" data source as modeled by HdSceneGlobalsSchema and provid...
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:79
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 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:91
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 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:95
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:101
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.
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 description 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:105
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 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:98
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:83
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:67
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