24#ifndef PXR_IMAGING_HDX_SIMPLE_LIGHT_TASK_H
25#define PXR_IMAGING_HDX_SIMPLE_LIGHT_TASK_H
28#include "pxr/imaging/hdx/api.h"
29#include "pxr/imaging/hdx/version.h"
31#include "pxr/imaging/hd/task.h"
36#include "pxr/imaging/cameraUtil/framing.h"
43PXR_NAMESPACE_OPEN_SCOPE
49using HdRenderPassSharedPtr = std::shared_ptr<class HdRenderPass>;
50using HdStSimpleLightingShaderSharedPtr =
51 std::shared_ptr<class HdStSimpleLightingShader>;
52using HdxShadowMatrixComputationSharedPtr =
53 std::shared_ptr<class HdxShadowMatrixComputation>;
58class HdxSimpleLightTask :
public HdTask
65 ~HdxSimpleLightTask()
override;
71 HdDirtyBits* dirtyBits)
override;
75 void Prepare(HdTaskContext* ctx,
80 void Execute(HdTaskContext* ctx)
override;
83 std::vector<GfMatrix4d> _ComputeShadowMatrices(
85 HdxShadowMatrixComputationSharedPtr
const &computation)
const;
88 std::map<TfToken, SdfPathVector> _lightIds;
89 SdfPathVector _lightIncludePaths;
90 SdfPathVector _lightExcludePaths;
93 unsigned _sprimIndexVersion;
94 unsigned _settingsVersion;
97 HdStSimpleLightingShaderSharedPtr _lightingShader;
101 std::pair<bool, CameraUtilConformWindowPolicy> _overrideWindowPolicy;
105 GlfSimpleMaterial _material;
110 GlfSimpleLightVector _glfSimpleLights;
112 HdBufferArrayRangeSharedPtr _lightingBar;
113 HdBufferArrayRangeSharedPtr _lightSourcesBar;
114 HdBufferArrayRangeSharedPtr _shadowsBar;
115 HdBufferArrayRangeSharedPtr _materialBar;
117 bool _rebuildLightingBufferSources;
118 bool _rebuildLightAndShadowBufferSources;
119 bool _rebuildMaterialBufferSources;
123 SdfPathVector
const &lightIncludePaths,
124 SdfPathVector
const &lightExcludePaths,
125 std::map<TfToken, SdfPathVector> *lights);
127 HdxSimpleLightTask() =
delete;
128 HdxSimpleLightTask(
const HdxSimpleLightTask &) =
delete;
129 HdxSimpleLightTask &operator =(
const HdxSimpleLightTask &) =
delete;
132struct HdxSimpleLightTaskParams {
133 HdxSimpleLightTaskParams()
135 , lightIncludePaths(1,
SdfPath::AbsoluteRootPath())
136 , lightExcludePaths()
137 , enableShadows(false)
139 , overrideWindowPolicy{false, CameraUtilFit}
145 SdfPathVector lightIncludePaths;
146 SdfPathVector lightExcludePaths;
150 std::pair<bool, CameraUtilConformWindowPolicy> overrideWindowPolicy;
154 GlfSimpleMaterial material;
160std::ostream&
operator<<(std::ostream& out,
const HdxSimpleLightTaskParams& pv);
163 const HdxSimpleLightTaskParams& lhs,
164 const HdxSimpleLightTaskParams& rhs);
167 const HdxSimpleLightTaskParams& lhs,
168 const HdxSimpleLightTaskParams& rhs);
170struct HdxShadowParams {
179 HdxShadowMatrixComputationSharedPtr shadowMatrix;
188std::ostream&
operator<<(std::ostream& out,
const HdxShadowParams& pv);
190bool operator==(
const HdxShadowParams& lhs,
const HdxShadowParams& rhs);
192bool operator!=(
const HdxShadowParams& lhs,
const HdxShadowParams& rhs);
195PXR_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.