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
31struct HdxSimpleLightTaskParams;
33using HdRenderPassSharedPtr = std::shared_ptr<class HdRenderPass>;
34using HdStSimpleLightingShaderSharedPtr =
35 std::shared_ptr<class HdStSimpleLightingShader>;
36using HdxShadowMatrixComputationSharedPtr =
37 std::shared_ptr<class HdxShadowMatrixComputation>;
42class HdxSimpleLightTask :
public HdTask
45 using TaskParams = HdxSimpleLightTaskParams;
51 ~HdxSimpleLightTask()
override;
57 HdDirtyBits* dirtyBits)
override;
61 void Prepare(HdTaskContext* ctx,
66 void Execute(HdTaskContext* ctx)
override;
69 std::vector<GfMatrix4d> _ComputeShadowMatrices(
71 HdxShadowMatrixComputationSharedPtr
const &computation)
const;
74 std::map<TfToken, SdfPathVector> _lightIds;
75 SdfPathVector _lightIncludePaths;
76 SdfPathVector _lightExcludePaths;
79 unsigned _sprimIndexVersion;
80 unsigned _settingsVersion;
83 HdStSimpleLightingShaderSharedPtr _lightingShader;
87 std::pair<bool, CameraUtilConformWindowPolicy> _overrideWindowPolicy;
91 GlfSimpleMaterial _material;
96 GlfSimpleLightVector _glfSimpleLights;
98 HdBufferArrayRangeSharedPtr _lightingBar;
99 HdBufferArrayRangeSharedPtr _lightSourcesBar;
100 HdBufferArrayRangeSharedPtr _shadowsBar;
101 HdBufferArrayRangeSharedPtr _materialBar;
103 bool _rebuildLightingBufferSources;
104 bool _rebuildLightAndShadowBufferSources;
105 bool _rebuildMaterialBufferSources;
109 SdfPathVector
const &lightIncludePaths,
110 SdfPathVector
const &lightExcludePaths,
111 std::map<TfToken, SdfPathVector> *lights);
113 HdxSimpleLightTask() =
delete;
114 HdxSimpleLightTask(
const HdxSimpleLightTask &) =
delete;
115 HdxSimpleLightTask &operator =(
const HdxSimpleLightTask &) =
delete;
118struct HdxSimpleLightTaskParams
120 HdxSimpleLightTaskParams()
122 , lightIncludePaths(1,
SdfPath::AbsoluteRootPath())
123 , lightExcludePaths()
124 , enableShadows(false)
126 , overrideWindowPolicy{false, CameraUtilFit}
132 SdfPathVector lightIncludePaths;
133 SdfPathVector lightExcludePaths;
137 std::pair<bool, CameraUtilConformWindowPolicy> overrideWindowPolicy;
141 GlfSimpleMaterial material;
147std::ostream&
operator<<(std::ostream& out,
const HdxSimpleLightTaskParams& pv);
150 const HdxSimpleLightTaskParams& lhs,
151 const HdxSimpleLightTaskParams& rhs);
154 const HdxSimpleLightTaskParams& lhs,
155 const HdxSimpleLightTaskParams& rhs);
157struct HdxShadowParams {
166 HdxShadowMatrixComputationSharedPtr shadowMatrix;
175std::ostream&
operator<<(std::ostream& out,
const HdxShadowParams& pv);
177bool operator==(
const HdxShadowParams& lhs,
const HdxShadowParams& rhs);
179bool operator!=(
const HdxShadowParams& lhs,
const HdxShadowParams& rhs);
182PXR_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.
HdTask represents a unit of work to perform during a Hydra render.
virtual void Execute(HdTaskContext *ctx)=0
Execute Phase: Runs the task.
virtual void Prepare(HdTaskContext *ctx, HdRenderIndex *renderIndex)=0
Prepare Phase: Resolve bindings and manage resources.
virtual void Sync(HdSceneDelegate *delegate, HdTaskContext *ctx, HdDirtyBits *dirtyBits)=0
Sync Phase: Obtain task state from Scene delegate based on change processing.
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.