7#ifndef PXR_IMAGING_HDX_DRAW_TARGET_TASK_H
8#define PXR_IMAGING_HDX_DRAW_TARGET_TASK_H
11#include "pxr/imaging/hdx/api.h"
12#include "pxr/imaging/hdx/version.h"
14#include "pxr/imaging/hd/task.h"
19PXR_NAMESPACE_OPEN_SCOPE
23struct HdxDrawTargetTaskParams;
24using HdStRenderPassStateSharedPtr
25 = std::shared_ptr<class HdStRenderPassState>;
26using HdStSimpleLightingShaderSharedPtr
27 = std::shared_ptr<class HdStSimpleLightingShader>;
33class HdxDrawTargetTask :
public HdTask
36 using TaskParams = HdxDrawTargetTaskParams;
42 ~HdxDrawTargetTask()
override;
48 HdDirtyBits* dirtyBits)
override;
52 void Prepare(HdTaskContext* ctx,
57 void Execute(HdTaskContext* ctx)
override;
64 struct _RenderPassInfo;
66 using _RenderPassInfoVector = std::vector<_RenderPassInfo>;
68 static _RenderPassInfoVector _ComputeRenderPassInfos(
71 static _CameraInfo _ComputeCameraInfo(
74 static void _UpdateLightingContext(
75 const _CameraInfo &cameraInfo,
76 GlfSimpleLightingContextConstRefPtr
const &srcContext,
77 GlfSimpleLightingContextRefPtr
const &ctx);
78 void _UpdateRenderPassState(
80 const _CameraInfo &cameraInfo,
81 HdStSimpleLightingShaderSharedPtr
const &lightingShader,
83 HdStRenderPassStateSharedPtr
const &state)
const;
84 static void _UpdateRenderPass(
85 _RenderPassInfo *info);
87 unsigned _currentDrawTargetSetVersion;
88 _RenderPassInfoVector _renderPassesInfo;
98 float _alphaThreshold;
101 bool _depthBiasUseDefault;
102 bool _depthBiasEnable;
103 float _depthBiasConstantFactor;
104 float _depthBiasSlopeFactor;
106 HdCompareFunction _depthFunc;
109 HdCullStyle _cullStyle;
112 bool _enableSampleAlphaToCoverage;
115 HdxDrawTargetTask() =
delete;
116 HdxDrawTargetTask(
const HdxDrawTargetTask &) =
delete;
117 HdxDrawTargetTask &operator =(
const HdxDrawTargetTask &) =
delete;
120struct HdxDrawTargetTaskParams
122 HdxDrawTargetTaskParams()
124 , wireframeColor(0.0)
125 , enableLighting(false)
126 , alphaThreshold(0.0)
127 , depthBiasUseDefault(true)
128 , depthBiasEnable(false)
129 , depthBiasConstantFactor(0.0f)
130 , depthBiasSlopeFactor(1.0f)
131 , depthFunc(HdCmpFuncLEqual)
134 , enableAlphaToCoverage(true)
135 , cullStyle(HdCullStyleBackUnlessDoubleSided)
142 float alphaThreshold;
150 bool depthBiasUseDefault;
151 bool depthBiasEnable;
152 float depthBiasConstantFactor;
153 float depthBiasSlopeFactor;
155 HdCompareFunction depthFunc;
157 bool enableAlphaToCoverage;
160 HdCullStyle cullStyle;
165std::ostream&
operator<<(std::ostream& out,
const HdxDrawTargetTaskParams& pv);
168 const HdxDrawTargetTaskParams& lhs,
169 const HdxDrawTargetTaskParams& rhs);
172 const HdxDrawTargetTaskParams& lhs,
173 const HdxDrawTargetTaskParams& rhs);
175PXR_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.
HdTask represents a unit of work to perform during a Hydra render.
virtual void Execute(HdTaskContext *ctx)=0
Execute Phase: Runs the task.
virtual HD_API const TfTokenVector & GetRenderTags() const
Render Tag Gather.
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.