24#ifndef PXR_IMAGING_HDX_DRAW_TARGET_TASK_H
25#define PXR_IMAGING_HDX_DRAW_TARGET_TASK_H
28#include "pxr/imaging/hdx/api.h"
29#include "pxr/imaging/hdx/version.h"
31#include "pxr/imaging/hd/task.h"
36PXR_NAMESPACE_OPEN_SCOPE
40using HdStRenderPassStateSharedPtr
41 = std::shared_ptr<class HdStRenderPassState>;
42using HdStSimpleLightingShaderSharedPtr
43 = std::shared_ptr<class HdStSimpleLightingShader>;
49class HdxDrawTargetTask :
public HdTask
56 ~HdxDrawTargetTask()
override;
62 HdDirtyBits* dirtyBits)
override;
66 void Prepare(HdTaskContext* ctx,
71 void Execute(HdTaskContext* ctx)
override;
78 struct _RenderPassInfo;
80 using _RenderPassInfoVector = std::vector<_RenderPassInfo>;
82 static _RenderPassInfoVector _ComputeRenderPassInfos(
85 static _CameraInfo _ComputeCameraInfo(
88 static void _UpdateLightingContext(
89 const _CameraInfo &cameraInfo,
90 GlfSimpleLightingContextConstRefPtr
const &srcContext,
91 GlfSimpleLightingContextRefPtr
const &ctx);
92 void _UpdateRenderPassState(
94 const _CameraInfo &cameraInfo,
95 HdStSimpleLightingShaderSharedPtr
const &lightingShader,
97 HdStRenderPassStateSharedPtr
const &state)
const;
98 static void _UpdateRenderPass(
99 _RenderPassInfo *info);
101 unsigned _currentDrawTargetSetVersion;
102 _RenderPassInfoVector _renderPassesInfo;
111 bool _enableLighting;
112 float _alphaThreshold;
115 bool _depthBiasUseDefault;
116 bool _depthBiasEnable;
117 float _depthBiasConstantFactor;
118 float _depthBiasSlopeFactor;
120 HdCompareFunction _depthFunc;
123 HdCullStyle _cullStyle;
126 bool _enableSampleAlphaToCoverage;
129 HdxDrawTargetTask() =
delete;
130 HdxDrawTargetTask(
const HdxDrawTargetTask &) =
delete;
131 HdxDrawTargetTask &operator =(
const HdxDrawTargetTask &) =
delete;
134struct HdxDrawTargetTaskParams
136 HdxDrawTargetTaskParams()
138 , wireframeColor(0.0)
139 , enableLighting(false)
140 , alphaThreshold(0.0)
141 , depthBiasUseDefault(true)
142 , depthBiasEnable(false)
143 , depthBiasConstantFactor(0.0f)
144 , depthBiasSlopeFactor(1.0f)
145 , depthFunc(HdCmpFuncLEqual)
148 , enableAlphaToCoverage(true)
149 , cullStyle(HdCullStyleBackUnlessDoubleSided)
156 float alphaThreshold;
164 bool depthBiasUseDefault;
165 bool depthBiasEnable;
166 float depthBiasConstantFactor;
167 float depthBiasSlopeFactor;
169 HdCompareFunction depthFunc;
171 bool enableAlphaToCoverage;
174 HdCullStyle cullStyle;
179std::ostream&
operator<<(std::ostream& out,
const HdxDrawTargetTaskParams& pv);
182 const HdxDrawTargetTaskParams& lhs,
183 const HdxDrawTargetTaskParams& rhs);
186 const HdxDrawTargetTaskParams& lhs,
187 const HdxDrawTargetTaskParams& rhs);
189PXR_NAMESPACE_CLOSE_SCOPE
Basic type for a vector of 4 float components.
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.
Represents an render to texture render pass.
Represents common non-gl context specific render pass state for a draw target.
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.