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
23using HdStRenderPassStateSharedPtr
24 = std::shared_ptr<class HdStRenderPassState>;
25using HdStSimpleLightingShaderSharedPtr
26 = std::shared_ptr<class HdStSimpleLightingShader>;
32class HdxDrawTargetTask :
public HdTask
39 ~HdxDrawTargetTask()
override;
45 HdDirtyBits* dirtyBits)
override;
49 void Prepare(HdTaskContext* ctx,
54 void Execute(HdTaskContext* ctx)
override;
61 struct _RenderPassInfo;
63 using _RenderPassInfoVector = std::vector<_RenderPassInfo>;
65 static _RenderPassInfoVector _ComputeRenderPassInfos(
68 static _CameraInfo _ComputeCameraInfo(
71 static void _UpdateLightingContext(
72 const _CameraInfo &cameraInfo,
73 GlfSimpleLightingContextConstRefPtr
const &srcContext,
74 GlfSimpleLightingContextRefPtr
const &ctx);
75 void _UpdateRenderPassState(
77 const _CameraInfo &cameraInfo,
78 HdStSimpleLightingShaderSharedPtr
const &lightingShader,
80 HdStRenderPassStateSharedPtr
const &state)
const;
81 static void _UpdateRenderPass(
82 _RenderPassInfo *info);
84 unsigned _currentDrawTargetSetVersion;
85 _RenderPassInfoVector _renderPassesInfo;
95 float _alphaThreshold;
98 bool _depthBiasUseDefault;
99 bool _depthBiasEnable;
100 float _depthBiasConstantFactor;
101 float _depthBiasSlopeFactor;
103 HdCompareFunction _depthFunc;
106 HdCullStyle _cullStyle;
109 bool _enableSampleAlphaToCoverage;
112 HdxDrawTargetTask() =
delete;
113 HdxDrawTargetTask(
const HdxDrawTargetTask &) =
delete;
114 HdxDrawTargetTask &operator =(
const HdxDrawTargetTask &) =
delete;
117struct HdxDrawTargetTaskParams
119 HdxDrawTargetTaskParams()
121 , wireframeColor(0.0)
122 , enableLighting(false)
123 , alphaThreshold(0.0)
124 , depthBiasUseDefault(true)
125 , depthBiasEnable(false)
126 , depthBiasConstantFactor(0.0f)
127 , depthBiasSlopeFactor(1.0f)
128 , depthFunc(HdCmpFuncLEqual)
131 , enableAlphaToCoverage(true)
132 , cullStyle(HdCullStyleBackUnlessDoubleSided)
139 float alphaThreshold;
147 bool depthBiasUseDefault;
148 bool depthBiasEnable;
149 float depthBiasConstantFactor;
150 float depthBiasSlopeFactor;
152 HdCompareFunction depthFunc;
154 bool enableAlphaToCoverage;
157 HdCullStyle cullStyle;
162std::ostream&
operator<<(std::ostream& out,
const HdxDrawTargetTaskParams& pv);
165 const HdxDrawTargetTaskParams& lhs,
166 const HdxDrawTargetTaskParams& rhs);
169 const HdxDrawTargetTaskParams& lhs,
170 const HdxDrawTargetTaskParams& rhs);
172PXR_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.