24 #ifndef PXR_IMAGING_HD_RENDER_PASS_STATE_H 25 #define PXR_IMAGING_HD_RENDER_PASS_STATE_H 28 #include "pxr/imaging/hd/api.h" 29 #include "pxr/imaging/hd/aov.h" 30 #include "pxr/imaging/hd/version.h" 31 #include "pxr/imaging/hd/enums.h" 33 #include "pxr/imaging/cameraUtil/framing.h" 35 #include "pxr/usd/sdf/path.h" 38 #include "pxr/base/vt/value.h" 46 PXR_NAMESPACE_OPEN_SCOPE
49 using HdRenderPassStateSharedPtr = std::shared_ptr<class HdRenderPassState>;
50 using HdResourceRegistrySharedPtr = std::shared_ptr<class HdResourceRegistry>;
73 virtual void Prepare(HdResourceRegistrySharedPtr
const &resourceRegistry);
79 using ClipPlanesVector = std::vector<GfVec4d>;
94 const std::pair<bool, CameraUtilConformWindowPolicy> &
95 overrideWindowPolicy);
108 const std::pair<bool, CameraUtilConformWindowPolicy> &
115 CameraUtilConformWindowPolicy
162 const GfVec4f& GetOverrideColor()
const {
return _overrideColor; }
168 const GfVec4f& GetWireframeColor()
const {
return _wireframeColor; }
171 void SetMaskColor(
GfVec4f const &color);
172 const GfVec4f& GetMaskColor()
const {
return _maskColor; }
175 void SetIndicatorColor(
GfVec4f const &color);
176 const GfVec4f& GetIndicatorColor()
const {
return _indicatorColor; }
182 const GfVec4f& GetPointColor()
const {
return _pointColor; }
187 float GetPointSize()
const {
return _pointSize; }
192 float GetPointSelectedSize()
const {
return _pointSelectedSize; }
197 bool GetLightingEnabled()
const {
return _lightingEnabled; }
200 void SetClippingEnabled(
bool enabled);
201 bool GetClippingEnabled()
const {
return _clippingEnabled; }
209 void SetAovBindings(HdRenderPassAovBindingVector
const &aovBindings);
211 HdRenderPassAovBindingVector
const& GetAovBindings()
const;
217 HdRenderPassAovBindingVector
const& GetAovInputBindings()
const;
224 bool GetUseAovMultiSample()
const;
227 void SetCullStyle(HdCullStyle cullStyle);
229 HdCullStyle GetCullStyle()
const {
return _cullStyle; }
232 void SetAlphaThreshold(
float alphaThreshold);
233 float GetAlphaThreshold()
const {
return _alphaThreshold; }
236 void SetTessLevel(
float level);
237 float GetTessLevel()
const {
return _tessLevel; }
240 void SetDrawingRange(
GfVec2f const &drawRange);
241 GfVec2f GetDrawingRange()
const {
return _drawRange; }
243 GfVec2f GetDrawingRangeNDC()
const;
246 void SetDepthBiasUseDefault(
bool useDefault);
247 bool GetDepthBiasUseDefault()
const {
return _depthBiasUseDefault; }
250 void SetDepthBiasEnabled(
bool enabled);
251 bool GetDepthBiasEnabled()
const {
return _depthBiasEnabled; }
254 void SetDepthBias(
float constantFactor,
float slopeFactor);
257 void SetDepthFunc(HdCompareFunction depthFunc);
258 HdCompareFunction GetDepthFunc()
const {
return _depthFunc; }
261 void SetEnableDepthMask(
bool state);
263 bool GetEnableDepthMask()
const;
266 void SetEnableDepthTest(
bool enabled);
268 bool GetEnableDepthTest()
const;
271 void SetEnableDepthClamp(
bool enabled);
273 bool GetEnableDepthClamp()
const;
276 void SetDepthRange(
GfVec2f const &depthRange);
278 const GfVec2f& GetDepthRange()
const;
281 void SetStencil(HdCompareFunction func,
int ref,
int mask,
282 HdStencilOp fail, HdStencilOp zfail, HdStencilOp zpass);
283 HdCompareFunction GetStencilFunc()
const {
return _stencilFunc; }
284 int GetStencilRef()
const {
return _stencilRef; }
285 int GetStencilMask()
const {
return _stencilMask; }
286 HdStencilOp GetStencilFailOp()
const {
return _stencilFailOp; }
287 HdStencilOp GetStencilDepthFailOp()
const {
return _stencilZFailOp; }
288 HdStencilOp GetStencilDepthPassOp()
const {
return _stencilZPassOp; }
290 void SetStencilEnabled(
bool enabled);
292 bool GetStencilEnabled()
const;
295 void SetLineWidth(
float width);
296 float GetLineWidth()
const {
return _lineWidth; }
299 void SetBlend(HdBlendOp colorOp,
300 HdBlendFactor colorSrcFactor,
301 HdBlendFactor colorDstFactor,
303 HdBlendFactor alphaSrcFactor,
304 HdBlendFactor alphaDstFactor);
305 HdBlendOp GetBlendColorOp() {
return _blendColorOp; }
306 HdBlendFactor GetBlendColorSrcFactor() {
return _blendColorSrcFactor; }
307 HdBlendFactor GetBlendColorDstFactor() {
return _blendColorDstFactor; }
308 HdBlendOp GetBlendAlphaOp() {
return _blendAlphaOp; }
309 HdBlendFactor GetBlendAlphaSrcFactor() {
return _blendAlphaSrcFactor; }
310 HdBlendFactor GetBlendAlphaDstFactor() {
return _blendAlphaDstFactor; }
312 void SetBlendConstantColor(
GfVec4f const & color);
313 const GfVec4f& GetBlendConstantColor()
const {
return _blendConstantColor; }
315 void SetBlendEnabled(
bool enabled);
318 void SetAlphaToCoverageEnabled(
bool enabled);
319 bool GetAlphaToCoverageEnabled()
const {
return _alphaToCoverageEnabled; }
322 void SetColorMaskUseDefault(
bool useDefault);
323 bool GetColorMaskUseDefault()
const {
return _colorMaskUseDefault;}
326 void SetConservativeRasterizationEnabled(
bool enabled);
327 bool GetConservativeRasterizationEnabled()
const {
328 return _conservativeRasterizationEnabled;
332 void SetVolumeRenderingConstants(
float stepSize,
float stepSizeLighting);
341 void SetColorMasks(std::vector<ColorMask>
const& masks);
342 std::vector<ColorMask>
const& GetColorMasks()
const {
return _colorMasks; }
345 void SetMultiSampleEnabled(
bool enabled);
346 bool GetMultiSampleEnabled()
const {
return _multiSampleEnabled; }
355 std::pair<bool, CameraUtilConformWindowPolicy> _overrideWindowPolicy;
364 bool _lightingEnabled;
365 bool _clippingEnabled;
369 float _pointSelectedSize;
374 float _alphaThreshold;
378 bool _depthBiasUseDefault;
379 bool _depthBiasEnabled;
380 float _depthBiasConstantFactor;
381 float _depthBiasSlopeFactor;
382 HdCompareFunction _depthFunc;
383 bool _depthMaskEnabled;
384 bool _depthTestEnabled;
385 bool _depthClampEnabled;
388 HdCullStyle _cullStyle;
391 HdCompareFunction _stencilFunc;
394 HdStencilOp _stencilFailOp;
395 HdStencilOp _stencilZFailOp;
396 HdStencilOp _stencilZPassOp;
397 bool _stencilEnabled;
403 HdBlendOp _blendColorOp;
404 HdBlendFactor _blendColorSrcFactor;
405 HdBlendFactor _blendColorDstFactor;
406 HdBlendOp _blendAlphaOp;
407 HdBlendFactor _blendAlphaSrcFactor;
408 HdBlendFactor _blendAlphaDstFactor;
413 bool _alphaToCoverageEnabled;
415 bool _colorMaskUseDefault;
416 std::vector<ColorMask> _colorMasks;
418 HdRenderPassAovBindingVector _aovBindings;
419 HdRenderPassAovBindingVector _aovInputBindings;
420 bool _useMultiSampleAov;
422 bool _conservativeRasterizationEnabled;
425 float _stepSizeLighting;
427 bool _multiSampleEnabled;
430 PXR_NAMESPACE_CLOSE_SCOPE
432 #endif // PXR_IMAGING_HD_RENDER_PASS_STATE_H HD_API void SetUseAovMultiSample(bool state)
Returns true if the render pass wants to render into the multi-sample aovs.
const CameraUtilFraming & GetFraming() const
Get framing information determining how the filmback plane maps to pixels.
HD_API void SetOverrideColor(GfVec4f const &color)
Set an override color for rendering where the R, G and B components are the color and the alpha compo...
const std::pair< bool, CameraUtilConformWindowPolicy > & GetOverrideWindowPolicy() const
The override value for the window policy to conform the camera frustum that can be specified by the a...
HD_API void SetLightingEnabled(bool enabled)
XXX: Hacky way of disabling lighting.
HD_API void SetCameraAndFraming(HdCamera const *camera, CameraUtilFraming const &framing, const std::pair< bool, CameraUtilConformWindowPolicy > &overrideWindowPolicy)
Camera setter API.
HD_API CameraUtilConformWindowPolicy GetWindowPolicy() const
The resolved window policy to conform the camera frustum.
HD_API void SetWireframeColor(GfVec4f const &color)
Set a wireframe color for rendering where the R, G and B components are the color and the alpha compo...
Hydra schema for a camera that pulls the params (see above) during Sync.
Basic type for a vector of 4 double components.
A set of rendering parameters used among render passes.
HD_API void SetPointSize(float size)
Set the point size for unselected points.
Stores a 4x4 matrix of double elements.
GfVec4f const & GetViewport() const
Only use when clients did not specify a camera framing.
virtual HD_API ClipPlanesVector const & GetClipPlanes() const
Returns HdCamera's clip planes.
HdCamera const * GetCamera() const
Get camera.
HD_API void SetPointSelectedSize(float size)
Set the point size for selected points.
Basic type for a vector of 4 float components.
HD_API void SetAovInputBindings(HdRenderPassAovBindingVector const &aovBindings)
Set the AOVs that this renderpass needs to read from.
virtual HD_API GfMatrix4d GetWorldToViewMatrix() const
Camera getter API.
Basic type for a vector of 2 float components.
HD_API void SetAovBindings(HdRenderPassAovBindingVector const &aovBindings)
Set the attachments for this renderpass to render into.
HD_API void SetPointColor(GfVec4f const &color)
Set a point color for rendering where the R, G and B components are the color and the alpha component...
HD_API GfMatrix4d GetImageToWorldMatrix() const
Compute a transform from window relative coordinates (x,y,z,1) to homogeneous world coordinates (x,...
HD_API void SetCameraAndViewport(HdCamera const *camera, GfVec4d const &viewport)
Camera setter API The view, projection and clipping plane info of the camera will be used.
virtual HD_API GfMatrix4d GetProjectionMatrix() const
Compute projection matrix using physical attributes of an HdCamera.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
virtual HD_API void Prepare(HdResourceRegistrySharedPtr const &resourceRegistry)
Schedule to update renderPassState parameters.