7#ifndef PXR_IMAGING_HDX_SIMPLE_LIGHT_TASK_H
8#define PXR_IMAGING_HDX_SIMPLE_LIGHT_TASK_H
11#include "pxr/imaging/hdx/api.h"
12#include "pxr/imaging/hdx/version.h"
14#include "pxr/imaging/hd/task.h"
19#include "pxr/imaging/cameraUtil/framing.h"
26PXR_NAMESPACE_OPEN_SCOPE
32using HdRenderPassSharedPtr = std::shared_ptr<class HdRenderPass>;
33using HdStSimpleLightingShaderSharedPtr =
34 std::shared_ptr<class HdStSimpleLightingShader>;
35using HdxShadowMatrixComputationSharedPtr =
36 std::shared_ptr<class HdxShadowMatrixComputation>;
41class HdxSimpleLightTask :
public HdTask
48 ~HdxSimpleLightTask()
override;
54 HdDirtyBits* dirtyBits)
override;
58 void Prepare(HdTaskContext* ctx,
63 void Execute(HdTaskContext* ctx)
override;
66 std::vector<GfMatrix4d> _ComputeShadowMatrices(
68 HdxShadowMatrixComputationSharedPtr
const &computation)
const;
71 std::map<TfToken, SdfPathVector> _lightIds;
72 SdfPathVector _lightIncludePaths;
73 SdfPathVector _lightExcludePaths;
76 unsigned _sprimIndexVersion;
77 unsigned _settingsVersion;
80 HdStSimpleLightingShaderSharedPtr _lightingShader;
84 std::pair<bool, CameraUtilConformWindowPolicy> _overrideWindowPolicy;
88 GlfSimpleMaterial _material;
93 GlfSimpleLightVector _glfSimpleLights;
95 HdBufferArrayRangeSharedPtr _lightingBar;
96 HdBufferArrayRangeSharedPtr _lightSourcesBar;
97 HdBufferArrayRangeSharedPtr _shadowsBar;
98 HdBufferArrayRangeSharedPtr _materialBar;
100 bool _rebuildLightingBufferSources;
101 bool _rebuildLightAndShadowBufferSources;
102 bool _rebuildMaterialBufferSources;
106 SdfPathVector
const &lightIncludePaths,
107 SdfPathVector
const &lightExcludePaths,
108 std::map<TfToken, SdfPathVector> *lights);
110 HdxSimpleLightTask() =
delete;
111 HdxSimpleLightTask(
const HdxSimpleLightTask &) =
delete;
112 HdxSimpleLightTask &operator =(
const HdxSimpleLightTask &) =
delete;
115struct HdxSimpleLightTaskParams {
116 HdxSimpleLightTaskParams()
118 , lightIncludePaths(1,
SdfPath::AbsoluteRootPath())
119 , lightExcludePaths()
120 , enableShadows(false)
122 , overrideWindowPolicy{false, CameraUtilFit}
128 SdfPathVector lightIncludePaths;
129 SdfPathVector lightExcludePaths;
133 std::pair<bool, CameraUtilConformWindowPolicy> overrideWindowPolicy;
137 GlfSimpleMaterial material;
143std::ostream&
operator<<(std::ostream& out,
const HdxSimpleLightTaskParams& pv);
146 const HdxSimpleLightTaskParams& lhs,
147 const HdxSimpleLightTaskParams& rhs);
150 const HdxSimpleLightTaskParams& lhs,
151 const HdxSimpleLightTaskParams& rhs);
153struct HdxShadowParams {
162 HdxShadowMatrixComputationSharedPtr shadowMatrix;
171std::ostream&
operator<<(std::ostream& out,
const HdxShadowParams& pv);
173bool operator==(
const HdxShadowParams& lhs,
const HdxShadowParams& rhs);
175bool operator!=(
const HdxShadowParams& lhs,
const HdxShadowParams& rhs);
178PXR_NAMESPACE_CLOSE_SCOPE
Basic type for a vector of 4 float components.
Hydra schema for a camera that pulls the params (see above) during Sync.
The Hydra render index is a flattened representation of the client scene graph, which may be composed...
Adapter class providing data exchange with the client scene graph.
A path value used to locate objects in layers or scenegraphs.
Standard pointer typedefs.
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
std::vector< TfToken > TfTokenVector
Convenience types.