Loading...
Searching...
No Matches
engine.h
Go to the documentation of this file.
1//
2// Copyright 2016 Pixar
3//
4// Licensed under the Apache License, Version 2.0 (the "Apache License")
5// with the following modification; you may not use this file except in
6// compliance with the Apache License and the following modification to it:
7// Section 6. Trademarks. is deleted and replaced with:
8//
9// 6. Trademarks. This License does not grant permission to use the trade
10// names, trademarks, service marks, or product names of the Licensor
11// and its affiliates, except as required to comply with Section 4(c) of
12// the License and to reproduce the content of the NOTICE file.
13//
14// You may obtain a copy of the Apache License at
15//
16// http://www.apache.org/licenses/LICENSE-2.0
17//
18// Unless required by applicable law or agreed to in writing, software
19// distributed under the Apache License with the above modification is
20// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21// KIND, either express or implied. See the Apache License for the specific
22// language governing permissions and limitations under the Apache License.
23//
24
26
27#ifndef PXR_USD_IMAGING_USD_IMAGING_GL_ENGINE_H
28#define PXR_USD_IMAGING_USD_IMAGING_GL_ENGINE_H
29
30#include "pxr/pxr.h"
31#include "pxr/usdImaging/usdImagingGL/api.h"
32#include "pxr/usdImaging/usdImagingGL/version.h"
33#include "pxr/usdImaging/usdImaging/version.h"
34
36#include "pxr/usdImaging/usdImagingGL/rendererSettings.h"
37
38#include "pxr/imaging/cameraUtil/conformWindow.h"
39
40#include "pxr/imaging/hd/driver.h"
41#include "pxr/imaging/hd/engine.h"
42#include "pxr/imaging/hd/rprimCollection.h"
43#include "pxr/imaging/hd/pluginRenderDelegateUniqueHandle.h"
44
45#include "pxr/imaging/hdx/selectionTracker.h"
46#include "pxr/imaging/hdx/renderSetupTask.h"
47
48#include "pxr/imaging/hgi/hgi.h"
49
52
53#include "pxr/imaging/hgi/hgi.h"
54
55#include "pxr/usd/sdf/path.h"
56#include "pxr/usd/usd/timeCode.h"
57
58#include "pxr/base/gf/frustum.h"
60#include "pxr/base/gf/vec4d.h"
61#include "pxr/base/gf/vec4f.h"
62#include "pxr/base/gf/vec4i.h"
63
65
67
68PXR_NAMESPACE_OPEN_SCOPE
69
70class UsdPrim;
71class HdRenderIndex;
72class HdxTaskController;
74
75TF_DECLARE_WEAK_AND_REF_PTRS(GlfSimpleLightingContext);
76TF_DECLARE_REF_PTRS(UsdImagingStageSceneIndex);
83
84using UsdStageWeakPtr = TfWeakPtr<class UsdStage>;
85
86namespace UsdImagingGLEngine_Impl
87{
88 using _AppSceneIndicesSharedPtr = std::shared_ptr<struct _AppSceneIndices>;
89}
90
96{
97public:
100 {
102 SdfPathVector excludedPaths;
103 SdfPathVector invisedPaths;
104 SdfPath sceneDelegateID = SdfPath::AbsoluteRootPath();
115 bool gpuEnabled = true;
123 };
124
125 // ---------------------------------------------------------------------
128 // ---------------------------------------------------------------------
129
130 USDIMAGINGGL_API
131 UsdImagingGLEngine(const Parameters &params);
132
141 USDIMAGINGGL_API
143 const TfToken& rendererPluginId = TfToken(),
144 bool gpuEnabled = true);
145
146 USDIMAGINGGL_API
147 UsdImagingGLEngine(const SdfPath& rootPath,
148 const SdfPathVector& excludedPaths,
149 const SdfPathVector& invisedPaths = SdfPathVector(),
150 const SdfPath& sceneDelegateID =
152 const HdDriver& driver = HdDriver(),
153 const TfToken& rendererPluginId = TfToken(),
154 bool gpuEnabled = true,
155 bool displayUnloadedPrimsWithBounds = false,
156 bool allowAsynchronousSceneProcessing = false);
157
158 // Disallow copies
159 UsdImagingGLEngine(const UsdImagingGLEngine&) = delete;
160 UsdImagingGLEngine& operator=(const UsdImagingGLEngine&) = delete;
161
162 USDIMAGINGGL_API
164
166
167 // ---------------------------------------------------------------------
170 // ---------------------------------------------------------------------
171
173 USDIMAGINGGL_API
174 void PrepareBatch(const UsdPrim& root,
175 const UsdImagingGLRenderParams& params);
176 USDIMAGINGGL_API
177 void RenderBatch(const SdfPathVector& paths,
178 const UsdImagingGLRenderParams& params);
179
181 USDIMAGINGGL_API
182 void Render(const UsdPrim& root,
183 const UsdImagingGLRenderParams &params);
184
187 USDIMAGINGGL_API
188 bool IsConverged() const;
189
191
192 // ---------------------------------------------------------------------
195 // ---------------------------------------------------------------------
196
198 USDIMAGINGGL_API
200
202 USDIMAGINGGL_API
203 void SetRootVisibility(bool isVisible);
204
206
207 // ---------------------------------------------------------------------
210 // ---------------------------------------------------------------------
211
214 USDIMAGINGGL_API
215 void SetCameraPath(SdfPath const& id);
216
220 USDIMAGINGGL_API
221 void SetFraming(CameraUtilFraming const& framing);
222
232 USDIMAGINGGL_API
234 const std::optional<CameraUtilConformWindowPolicy> &policy);
235
239 USDIMAGINGGL_API
240 void SetRenderBufferSize(GfVec2i const& size);
241
247 USDIMAGINGGL_API
248 void SetRenderViewport(GfVec4d const& viewport);
249
253 USDIMAGINGGL_API
254 void SetWindowPolicy(CameraUtilConformWindowPolicy policy);
255
260 USDIMAGINGGL_API
261 void SetCameraState(const GfMatrix4d& viewMatrix,
262 const GfMatrix4d& projectionMatrix);
263
265
266 // ---------------------------------------------------------------------
269 // ---------------------------------------------------------------------
270
272 USDIMAGINGGL_API
273 void SetLightingState(GlfSimpleLightingContextPtr const &src);
274
279 USDIMAGINGGL_API
280 void SetLightingState(GlfSimpleLightVector const &lights,
281 GlfSimpleMaterial const &material,
282 GfVec4f const &sceneAmbient);
283
285
286 // ---------------------------------------------------------------------
289 // ---------------------------------------------------------------------
290
294 USDIMAGINGGL_API
295 void SetSelected(SdfPathVector const& paths);
296
299 USDIMAGINGGL_API
301
305 USDIMAGINGGL_API
306 void AddSelected(SdfPath const &path, int instanceIndex);
307
309 USDIMAGINGGL_API
310 void SetSelectionColor(GfVec4f const& color);
311
313
314 // ---------------------------------------------------------------------
317 // ---------------------------------------------------------------------
318
336 USDIMAGINGGL_API
338 const GfMatrix4d &viewMatrix,
339 const GfMatrix4d &projectionMatrix,
340 const UsdPrim& root,
341 const UsdImagingGLRenderParams &params,
342 GfVec3d *outHitPoint,
343 GfVec3d *outHitNormal,
344 SdfPath *outHitPrimPath = NULL,
345 SdfPath *outHitInstancerPath = NULL,
346 int *outHitInstanceIndex = NULL,
347 HdInstancerContext *outInstancerContext = NULL);
348
351 USDIMAGINGGL_API
353 unsigned char const primIdColor[4],
354 unsigned char const instanceIdColor[4],
355 SdfPath *outHitPrimPath = NULL,
356 SdfPath *outHitInstancerPath = NULL,
357 int *outHitInstanceIndex = NULL,
358 HdInstancerContext *outInstancerContext = NULL);
359
361
362 // ---------------------------------------------------------------------
365 // ---------------------------------------------------------------------
366
368 USDIMAGINGGL_API
370
372 USDIMAGINGGL_API
373 static std::string GetRendererDisplayName(TfToken const &id);
374
376 USDIMAGINGGL_API
377 bool GetGPUEnabled() const;
378
380 USDIMAGINGGL_API
382
385 USDIMAGINGGL_API
386 bool SetRendererPlugin(TfToken const &id);
387
389
390 // ---------------------------------------------------------------------
393 // ---------------------------------------------------------------------
394
396 USDIMAGINGGL_API
398
400 USDIMAGINGGL_API
401 bool SetRendererAov(TfToken const& id);
402
404 USDIMAGINGGL_API
406
408 USDIMAGINGGL_API
410
411 // ---------------------------------------------------------------------
414 // ---------------------------------------------------------------------
415
417 USDIMAGINGGL_API
418 UsdImagingGLRendererSettingsList GetRendererSettingsList() const;
419
421 USDIMAGINGGL_API
423
425 USDIMAGINGGL_API
427 VtValue const& value);
428
430
431 // ---------------------------------------------------------------------
435 // ---------------------------------------------------------------------
436
438 USDIMAGINGGL_API
440
442 USDIMAGINGGL_API
443 static SdfPathVector
445
447
448 // ---------------------------------------------------------------------
451 // ---------------------------------------------------------------------
452
456 USDIMAGINGGL_API
457 void SetEnablePresentation(bool enabled);
458
464 USDIMAGINGGL_API
465 void SetPresentationOutput(TfToken const &api, VtValue const &framebuffer);
466
468
469 // ---------------------------------------------------------------------
472 // ---------------------------------------------------------------------
473
477 USDIMAGINGGL_API
478 HdCommandDescriptors GetRendererCommandDescriptors() const;
479
485 USDIMAGINGGL_API
487 const TfToken &command,
488 const HdCommandArgs &args = HdCommandArgs()) const;
489
490 // ---------------------------------------------------------------------
493 // ---------------------------------------------------------------------
494
496 USDIMAGINGGL_API
498
502 USDIMAGINGGL_API
504
508 USDIMAGINGGL_API
510
512 USDIMAGINGGL_API
514
518 USDIMAGINGGL_API
520
524 USDIMAGINGGL_API
526
528
529 // ---------------------------------------------------------------------
532 // ---------------------------------------------------------------------
533
548 USDIMAGINGGL_API
550 TfToken const& ccType,
551 TfToken const& ocioDisplay = {},
552 TfToken const& ocioView = {},
553 TfToken const& ocioColorSpace = {},
554 TfToken const& ocioLook = {});
555
557
559 USDIMAGINGGL_API
561
562 // ---------------------------------------------------------------------
565 // ---------------------------------------------------------------------
566
572 USDIMAGINGGL_API
574
576
577 // ---------------------------------------------------------------------
580 // ---------------------------------------------------------------------
581
584 USDIMAGINGGL_API
586
588
589 // ---------------------------------------------------------------------
592 // ---------------------------------------------------------------------
593
600 USDIMAGINGGL_API
602
604
605protected:
606
608 friend class UsdImagingGL_UnitTestGLDrawing;
609
612 USDIMAGINGGL_API
614
615 USDIMAGINGGL_API
616 void _Execute(const UsdImagingGLRenderParams &params,
617 HdTaskSharedPtrVector tasks);
618
619 USDIMAGINGGL_API
620 bool _CanPrepare(const UsdPrim& root);
621 USDIMAGINGGL_API
622 void _PreSetTime(const UsdImagingGLRenderParams& params);
623 USDIMAGINGGL_API
624 void _PostSetTime(const UsdImagingGLRenderParams& params);
625
626 USDIMAGINGGL_API
627 void _PrepareRender(const UsdImagingGLRenderParams& params);
628
629 USDIMAGINGGL_API
630 void _SetActiveRenderSettingsPrimFromStageMetadata(UsdStageWeakPtr stage);
631
632 USDIMAGINGGL_API
633 void _UpdateDomeLightCameraVisibility();
634
635 using BBoxVector = std::vector<GfBBox3d>;
636
637 USDIMAGINGGL_API
638 void _SetBBoxParams(
639 const BBoxVector& bboxes,
640 const GfVec4f& bboxLineColor,
641 float bboxLineDashSize);
642
643 // Create a hydra collection given root paths and render params.
644 // Returns true if the collection was updated.
645 USDIMAGINGGL_API
646 static bool _UpdateHydraCollection(HdRprimCollection *collection,
647 SdfPathVector const& roots,
648 UsdImagingGLRenderParams const& params);
649 USDIMAGINGGL_API
650 static HdxRenderTaskParams _MakeHydraUsdImagingGLRenderParams(
651 UsdImagingGLRenderParams const& params);
652 USDIMAGINGGL_API
653 static void _ComputeRenderTags(UsdImagingGLRenderParams const& params,
654 TfTokenVector *renderTags);
655
656 USDIMAGINGGL_API
657 void _InitializeHgiIfNecessary();
658
659 USDIMAGINGGL_API
660 void _SetRenderDelegateAndRestoreState(
662
663 USDIMAGINGGL_API
664 void _SetRenderDelegate(HdPluginRenderDelegateUniqueHandle &&);
665
666 USDIMAGINGGL_API
667 SdfPath _ComputeControllerPath(const HdPluginRenderDelegateUniqueHandle &);
668
669 USDIMAGINGGL_API
670 static TfToken _GetDefaultRendererPluginId();
671
677 USDIMAGINGGL_API
679
680 USDIMAGINGGL_API
681 HdEngine *_GetHdEngine();
682
683 USDIMAGINGGL_API
684 HdxTaskController *_GetTaskController() const;
685
686 USDIMAGINGGL_API
687 HdSelectionSharedPtr _GetSelection() const;
688
689protected:
690
691 // Note that any of the fields below might become private
692 // in the future and subclasses should use the above getters
693 // to access them instead.
694
695 HgiUniquePtr _hgi;
696 // Similar for HdDriver.
697 HdDriver _hgiDriver;
698
699 VtValue _userFramebuffer;
700
701protected:
702 bool _displayUnloadedPrimsWithBounds;
703 bool _gpuEnabled;
705 std::unique_ptr<HdRenderIndex> _renderIndex;
706
707 SdfPath const _sceneDelegateId;
708
709 std::unique_ptr<HdxTaskController> _taskController;
710
711 HdxSelectionTrackerSharedPtr _selTracker;
712 HdRprimCollection _renderCollection;
713 HdRprimCollection _intersectCollection;
714
715 GlfSimpleLightingContextRefPtr _lightingContextForOpenGLState;
716
717 // Data we want to live across render plugin switches:
718 GfVec4f _selectionColor;
719 bool _domeLightCameraVisibility;
720
721 SdfPath _rootPath;
722 SdfPathVector _excludedPrimPaths;
723 SdfPathVector _invisedPrimPaths;
724 bool _isPopulated;
725
726private:
727 // Registers app-managed scene indices with the scene index plugin registry.
728 // This needs to be called once *before* the render index is constructed.
729 static void _RegisterApplicationSceneIndices();
730
731 // Creates and returns the scene globals scene index. This callback is
732 // registered prior to render index construction and is invoked during
733 // render index construction via
734 // HdSceneIndexPluginRegistry::AppendSceneIndicesForRenderer(..).
735 static HdSceneIndexBaseRefPtr
736 _AppendSceneGlobalsSceneIndexCallback(
737 const std::string &renderInstanceId,
738 const HdSceneIndexBaseRefPtr &inputScene,
739 const HdContainerDataSourceHandle &inputArgs);
740
741 HdSceneIndexBaseRefPtr
742 _AppendOverridesSceneIndices(
743 const HdSceneIndexBaseRefPtr &inputScene);
744
745 UsdImagingGLEngine_Impl::_AppSceneIndicesSharedPtr _appSceneIndices;
746
747 void _DestroyHydraObjects();
748
749 // Note that we'll only ever use one of _sceneIndex/_sceneDelegate
750 // at a time.
751 UsdImagingStageSceneIndexRefPtr _stageSceneIndex;
752 UsdImagingSelectionSceneIndexRefPtr _selectionSceneIndex;
753 UsdImagingRootOverridesSceneIndexRefPtr _rootOverridesSceneIndex;
754 HdsiLegacyDisplayStyleOverrideSceneIndexRefPtr _displayStyleSceneIndex;
755 HdsiPrimTypePruningSceneIndexRefPtr _materialPruningSceneIndex;
756 HdsiPrimTypePruningSceneIndexRefPtr _lightPruningSceneIndex;
757 HdSceneIndexBaseRefPtr _sceneIndex;
758
759 std::unique_ptr<UsdImagingDelegate> _sceneDelegate;
760
761 std::unique_ptr<HdEngine> _engine;
762
763 bool _allowAsynchronousSceneProcessing = false;
764};
765
766
767PXR_NAMESPACE_CLOSE_SCOPE
768
769#endif // PXR_USD_IMAGING_USD_IMAGING_GL_ENGINE_H
Framing information.
Definition: framing.h:80
Stores a 4x4 matrix of double elements.
Definition: matrix4d.h:88
Basic type for a vector of 2 int components.
Definition: vec2i.h:61
Basic type for a vector of 3 double components.
Definition: vec3d.h:63
Basic type for a vector of 4 double components.
Definition: vec4d.h:63
Basic type for a vector of 4 float components.
Definition: vec4f.h:63
HdDriver represents a device object, commonly a render device, that is owned by the application and p...
Definition: driver.h:40
The application-facing entry point top-level entry point for accessing Hydra.
Definition: engine.h:48
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:50
The Hydra render index is a flattened representation of the client scene graph, which may be composed...
Definition: renderIndex.h:121
A named, semantic collection of objects.
Abstract interface to scene data.
Definition: sceneIndex.h:65
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:111
A path value used to locate objects in layers or scenegraphs.
Definition: path.h:291
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:88
Pointer storage with deletion detection.
Definition: weakPtr.h:145
The primary translation layer between the Hydra (Hd) core and the Usd scene graph.
Definition: delegate.h:84
The UsdImagingGLEngine is the main entry point API for rendering USD scenes.
Definition: engine.h:96
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 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:108
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:112
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:118
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:122
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:115
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:100
Used as an arguments class for various methods in UsdImagingGLEngine.
Definition: renderParams.h:74
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:134
A map with string keys and VtValue values.
Definition: dictionary.h:60
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:165
Standard pointer typedefs.
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
Definition: declarePtrs.h:75
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
Definition: declarePtrs.h:89
RenderTask parameters (renderpass state).
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:457