HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HdStRenderPassState Class Reference

#include <renderPassState.h>

+ Inheritance diagram for HdStRenderPassState:

Public Types

using AxisAlignedAffineTransform = GfVec4f
 
- Public Types inherited from HdRenderPassState
using ClipPlanesVector = std::vector< GfVec4d >
 Sets the camera. More...
 
enum  ColorMask { ColorMaskNone, ColorMaskRGB, ColorMaskRGBA }
 Set the attachments for this renderpass to render into. More...
 

Public Member Functions

HDST_API HdStRenderPassState ()
 
HDST_API HdStRenderPassState (HdStRenderPassShaderSharedPtr const &shader)
 
HDST_API ~HdStRenderPassState () override
 
HDST_API void Prepare (HdResourceRegistrySharedPtr const &resourceRegistry) override
 
HDST_API void Bind (HgiCapabilities const &hgiCapabilities)
 
HDST_API void Unbind (HgiCapabilities const &hgiCapabilities)
 
HDST_API void SetResolveAovMultiSample (bool state)
 
HDST_API bool GetResolveAovMultiSample () const
 
HDST_API void SetLightingShader (HdStLightingShaderSharedPtr const &lightingShader)
 Set lighting shader. More...
 
HdStLightingShaderSharedPtr const & GetLightingShader () const
 
HDST_API void SetRenderPassShader (HdStRenderPassShaderSharedPtr const &renderPassShader)
 renderpass shader More...
 
HdStRenderPassShaderSharedPtr
const & 
GetRenderPassShader () const
 
HDST_API void ApplyStateFromGeometricShader (HdSt_ResourceBinder const &binder, HdSt_GeometricShaderSharedPtr const &geometricShader)
 
HDST_API void ApplyStateFromCamera ()
 
HDST_API void SetUseSceneMaterials (bool state)
 scene materials More...
 
bool GetUseSceneMaterials () const
 
HDST_API
HdStShaderCodeSharedPtrVector 
GetShaders () const
 returns shaders (lighting/renderpass) More...
 
HDST_API size_t GetShaderHash () const
 
HDST_API void SetCameraFramingState (GfMatrix4d const &worldToViewMatrix, GfMatrix4d const &projectionMatrix, GfVec4d const &viewport, ClipPlanesVector const &clipPlanes)
 
GfMatrix4d GetCullMatrix () const
 
HDST_API GfMatrix4d GetWorldToViewMatrix () const override
 
HDST_API GfMatrix4d GetProjectionMatrix () const override
 
HDST_API ClipPlanesVector const & GetClipPlanes () const override
 
HDST_API GfVec4i ComputeViewport () const
 
HDST_API HgiGraphicsCmdsDesc MakeGraphicsCmdsDesc (HdRenderIndex const *renderIndex) const
 
HDST_API void InitGraphicsPipelineDesc (HgiGraphicsPipelineDesc *pipeDesc, HdSt_GeometricShaderSharedPtr const &geometricShader, bool firstDrawBatch) const
 
HDST_API uint64_t GetGraphicsPipelineHash (HdSt_GeometricShaderSharedPtr const &geometricShader, bool firstDrawBatch) const
 Generates the hash for the settings used to init the graphics pipeline. More...
 
HDST_API AxisAlignedAffineTransform ComputeImageToHorizontallyNormalizedFilmback () const
 
- Public Member Functions inherited from HdRenderPassState
HD_API HdRenderPassState ()
 
virtual HD_API ~HdRenderPassState ()
 
HD_API void SetOverrideColor (GfVec4f const &color)
 
const GfVec4fGetOverrideColor () const
 
HD_API void SetWireframeColor (GfVec4f const &color)
 
const GfVec4fGetWireframeColor () const
 
HD_API void SetMaskColor (GfVec4f const &color)
 
const GfVec4fGetMaskColor () const
 
HD_API void SetIndicatorColor (GfVec4f const &color)
 
const GfVec4fGetIndicatorColor () const
 
HD_API void SetPointColor (GfVec4f const &color)
 
const GfVec4fGetPointColor () const
 
HD_API void SetPointSize (float size)
 Set the point size for unselected points. More...
 
float GetPointSize () const
 
HD_API void SetPointSelectedSize (float size)
 Set the point size for selected points. More...
 
float GetPointSelectedSize () const
 
HD_API void SetLightingEnabled (bool enabled)
 XXX: Hacky way of disabling lighting. More...
 
bool GetLightingEnabled () const
 
HD_API void SetClippingEnabled (bool enabled)
 
bool GetClippingEnabled () const
 
HD_API void SetCamera (const HdCamera *camera)
 Sets the camera. More...
 
HD_API void SetOverrideWindowPolicy (const std::optional< CameraUtilConformWindowPolicy > &overrideWindowPolicy)
 
HD_API void SetFraming (const CameraUtilFraming &framing)
 
HD_API void SetViewport (const GfVec4d &viewport)
 
HdCamera const * GetCamera () const
 Get camera. More...
 
const CameraUtilFramingGetFraming () const
 
const std::optional
< CameraUtilConformWindowPolicy > & 
GetOverrideWindowPolicy () const
 
HD_API
CameraUtilConformWindowPolicy 
GetWindowPolicy () const
 
GfVec4f const & GetViewport () const
 
HD_API GfMatrix4d GetImageToWorldMatrix () const
 
HD_API void SetAovBindings (HdRenderPassAovBindingVector const &aovBindings)
 Set the attachments for this renderpass to render into. More...
 
HD_API
HdRenderPassAovBindingVector
const & 
GetAovBindings () const
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetAovInputBindings (HdRenderPassAovBindingVector const &aovBindings)
 Set the AOVs that this renderpass needs to read from. More...
 
HD_API
HdRenderPassAovBindingVector
const & 
GetAovInputBindings () const
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetUseAovMultiSample (bool state)
 
HD_API bool GetUseAovMultiSample () const
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetCullStyle (HdCullStyle cullStyle)
 Set the attachments for this renderpass to render into. More...
 
HD_API HdCullStyle GetCullStyle () const
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetAlphaThreshold (float alphaThreshold)
 Set the attachments for this renderpass to render into. More...
 
float GetAlphaThreshold () const
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetTessLevel (float level)
 Set the attachments for this renderpass to render into. More...
 
float GetTessLevel () const
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetDrawingRange (GfVec2f const &drawRange)
 Set the attachments for this renderpass to render into. More...
 
GfVec2f GetDrawingRange () const
 Set the attachments for this renderpass to render into. More...
 
HD_API GfVec2f GetDrawingRangeNDC () const
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetDepthBiasUseDefault (bool useDefault)
 Set the attachments for this renderpass to render into. More...
 
bool GetDepthBiasUseDefault () const
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetDepthBiasEnabled (bool enabled)
 Set the attachments for this renderpass to render into. More...
 
bool GetDepthBiasEnabled () const
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetDepthBias (float constantFactor, float slopeFactor)
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetDepthFunc (HdCompareFunction depthFunc)
 Set the attachments for this renderpass to render into. More...
 
HdCompareFunction GetDepthFunc () const
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetEnableDepthMask (bool state)
 Set the attachments for this renderpass to render into. More...
 
HD_API bool GetEnableDepthMask () const
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetEnableDepthTest (bool enabled)
 Set the attachments for this renderpass to render into. More...
 
HD_API bool GetEnableDepthTest () const
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetEnableDepthClamp (bool enabled)
 Set the attachments for this renderpass to render into. More...
 
HD_API bool GetEnableDepthClamp () const
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetDepthRange (GfVec2f const &depthRange)
 Set the attachments for this renderpass to render into. More...
 
HD_API const GfVec2fGetDepthRange () const
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetStencil (HdCompareFunction func, int ref, int mask, HdStencilOp fail, HdStencilOp zfail, HdStencilOp zpass)
 Set the attachments for this renderpass to render into. More...
 
HdCompareFunction GetStencilFunc () const
 Set the attachments for this renderpass to render into. More...
 
int GetStencilRef () const
 Set the attachments for this renderpass to render into. More...
 
int GetStencilMask () const
 Set the attachments for this renderpass to render into. More...
 
HdStencilOp GetStencilFailOp () const
 Set the attachments for this renderpass to render into. More...
 
HdStencilOp GetStencilDepthFailOp () const
 Set the attachments for this renderpass to render into. More...
 
HdStencilOp GetStencilDepthPassOp () const
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetStencilEnabled (bool enabled)
 Set the attachments for this renderpass to render into. More...
 
HD_API bool GetStencilEnabled () const
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetLineWidth (float width)
 Set the attachments for this renderpass to render into. More...
 
float GetLineWidth () const
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetBlend (HdBlendOp colorOp, HdBlendFactor colorSrcFactor, HdBlendFactor colorDstFactor, HdBlendOp alphaOp, HdBlendFactor alphaSrcFactor, HdBlendFactor alphaDstFactor)
 Set the attachments for this renderpass to render into. More...
 
HdBlendOp GetBlendColorOp ()
 Set the attachments for this renderpass to render into. More...
 
HdBlendFactor GetBlendColorSrcFactor ()
 Set the attachments for this renderpass to render into. More...
 
HdBlendFactor GetBlendColorDstFactor ()
 Set the attachments for this renderpass to render into. More...
 
HdBlendOp GetBlendAlphaOp ()
 Set the attachments for this renderpass to render into. More...
 
HdBlendFactor GetBlendAlphaSrcFactor ()
 Set the attachments for this renderpass to render into. More...
 
HdBlendFactor GetBlendAlphaDstFactor ()
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetBlendConstantColor (GfVec4f const &color)
 Set the attachments for this renderpass to render into. More...
 
const GfVec4fGetBlendConstantColor () const
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetBlendEnabled (bool enabled)
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetAlphaToCoverageEnabled (bool enabled)
 Set the attachments for this renderpass to render into. More...
 
bool GetAlphaToCoverageEnabled () const
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetColorMaskUseDefault (bool useDefault)
 Set the attachments for this renderpass to render into. More...
 
bool GetColorMaskUseDefault () const
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetConservativeRasterizationEnabled (bool enabled)
 Set the attachments for this renderpass to render into. More...
 
bool GetConservativeRasterizationEnabled () const
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetVolumeRenderingConstants (float stepSize, float stepSizeLighting)
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetColorMasks (std::vector< ColorMask > const &masks)
 Set the attachments for this renderpass to render into. More...
 
std::vector< ColorMask > const & GetColorMasks () const
 Set the attachments for this renderpass to render into. More...
 
HD_API void SetMultiSampleEnabled (bool enabled)
 Set the attachments for this renderpass to render into. More...
 
bool GetMultiSampleEnabled () const
 Set the attachments for this renderpass to render into. More...
 

Detailed Description

A set of rendering parameters used among render passes.

Parameters are expressed as GL states, uniforms or shaders.

Definition at line 65 of file renderPassState.h.

Member Typedef Documentation

Constructor & Destructor Documentation

HDST_API HdStRenderPassState::HdStRenderPassState ( )
HDST_API HdStRenderPassState::HdStRenderPassState ( HdStRenderPassShaderSharedPtr const &  shader)
HDST_API HdStRenderPassState::~HdStRenderPassState ( )
override

Member Function Documentation

HDST_API void HdStRenderPassState::ApplyStateFromCamera ( )
HDST_API void HdStRenderPassState::ApplyStateFromGeometricShader ( HdSt_ResourceBinder const &  binder,
HdSt_GeometricShaderSharedPtr const &  geometricShader 
)
HDST_API void HdStRenderPassState::Bind ( HgiCapabilities const &  hgiCapabilities)

XXX: Bind and Unbind set./restore the following GL state. This will be reworked to use Hgi in the near future. Following states may be changed and restored to the GL default at Unbind(). glEnable(GL_BLEND); glEnable(GL_CULL_FACE); glEnable(GL_POLYGON_OFFSET_FILL) glEnable(GL_PROGRAM_POINT_SIZE); glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE) glEnable(GL_DEPTH_TEST); glEnable(GL_STENCIL_TEST); glPolygonOffset() glBlend*() glColorMask() glCullFace() glDepthFunc() glDepthMask() glLineWidth() glStencilFunc() glStencilOp()

HDST_API AxisAlignedAffineTransform HdStRenderPassState::ComputeImageToHorizontallyNormalizedFilmback ( ) const
HDST_API GfVec4i HdStRenderPassState::ComputeViewport ( ) const

Helper to compute and get the y-up Viewport This is either using the modern camera framing, which is always y-down, or the legacy viewport.

HDST_API ClipPlanesVector const& HdStRenderPassState::GetClipPlanes ( ) const
overridevirtual

Overrides the case when no HdCamera is given. In the case, uses clip planes specified by SetCameraFramingState.

Reimplemented from HdRenderPassState.

GfMatrix4d HdStRenderPassState::GetCullMatrix ( ) const
inline

Definition at line 162 of file renderPassState.h.

HDST_API uint64_t HdStRenderPassState::GetGraphicsPipelineHash ( HdSt_GeometricShaderSharedPtr const &  geometricShader,
bool  firstDrawBatch 
) const

Generates the hash for the settings used to init the graphics pipeline.

HdStLightingShaderSharedPtr const& HdStRenderPassState::GetLightingShader ( ) const
inline

Definition at line 116 of file renderPassState.h.

HDST_API GfMatrix4d HdStRenderPassState::GetProjectionMatrix ( ) const
overridevirtual

Overrides the case when no HdCamera is given. In the case, uses matrix specified by SetCameraFramingState.

Reimplemented from HdRenderPassState.

HdStRenderPassShaderSharedPtr const& HdStRenderPassState::GetRenderPassShader ( ) const
inline

Definition at line 123 of file renderPassState.h.

HDST_API bool HdStRenderPassState::GetResolveAovMultiSample ( ) const
HDST_API size_t HdStRenderPassState::GetShaderHash ( ) const
HDST_API HdStShaderCodeSharedPtrVector HdStRenderPassState::GetShaders ( ) const

returns shaders (lighting/renderpass)

bool HdStRenderPassState::GetUseSceneMaterials ( ) const
inline

Definition at line 138 of file renderPassState.h.

HDST_API GfMatrix4d HdStRenderPassState::GetWorldToViewMatrix ( ) const
overridevirtual

Overrides the case when no HdCamera is given. In the case, uses matrix specified by SetCameraFramingState.

Reimplemented from HdRenderPassState.

HDST_API void HdStRenderPassState::InitGraphicsPipelineDesc ( HgiGraphicsPipelineDesc pipeDesc,
HdSt_GeometricShaderSharedPtr const &  geometricShader,
bool  firstDrawBatch 
) const
HDST_API HgiGraphicsCmdsDesc HdStRenderPassState::MakeGraphicsCmdsDesc ( HdRenderIndex const *  renderIndex) const
HDST_API void HdStRenderPassState::Prepare ( HdResourceRegistrySharedPtr const &  resourceRegistry)
overridevirtual

Schedule to update renderPassState parameters. e.g. camera matrix, override color, id blend factor. Prepare, called once per frame after the sync phase, but prior to the commit phase.

Reimplemented from HdRenderPassState.

HDST_API void HdStRenderPassState::SetCameraFramingState ( GfMatrix4d const &  worldToViewMatrix,
GfMatrix4d const &  projectionMatrix,
GfVec4d const &  viewport,
ClipPlanesVector const &  clipPlanes 
)

Camera setter API

Set matrices, viewport and clipping planes explicitly that are used when there is no HdCamera in the render pass state.

This is used by render pass that do not have an associated HdCamera such as the shadow render pass.

HDST_API void HdStRenderPassState::SetLightingShader ( HdStLightingShaderSharedPtr const &  lightingShader)

Set lighting shader.

HDST_API void HdStRenderPassState::SetRenderPassShader ( HdStRenderPassShaderSharedPtr const &  renderPassShader)

renderpass shader

HDST_API void HdStRenderPassState::SetResolveAovMultiSample ( bool  state)

If set to true (default) and the render pass is rendering into a multi-sampled aovs, the aovs will be resolved at the end of the render pass. If false or the aov is not multi-sampled or the render pass is not rendering into the multi-sampled aov, no resolution takes place.

HDST_API void HdStRenderPassState::SetUseSceneMaterials ( bool  state)

scene materials

HDST_API void HdStRenderPassState::Unbind ( HgiCapabilities const &  hgiCapabilities)

The documentation for this class was generated from the following file: