|
A set of rendering parameters used among render passes. More...
#include <renderPassState.h>
Public Types | |
using | AxisAlignedAffineTransform = GfVec4f |
Public Types inherited from HdRenderPassState | |
enum | ColorMask { ColorMaskNone , ColorMaskRGB , ColorMaskRGBA } |
using | ClipPlanesVector = std::vector< GfVec4d > |
Public Member Functions | |
HDST_API | HdStRenderPassState (HdStRenderPassShaderSharedPtr const &shader) |
HDST_API void | Prepare (HdResourceRegistrySharedPtr const &resourceRegistry) override |
Schedule to update renderPassState parameters. | |
HDST_API void | Bind (HgiCapabilities const &hgiCapabilities) |
XXX: Bind and Unbind set. | |
HDST_API void | Unbind (HgiCapabilities const &hgiCapabilities) |
HDST_API void | 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. | |
HDST_API bool | GetResolveAovMultiSample () const |
HDST_API void | SetLightingShader (HdStLightingShaderSharedPtr const &lightingShader) |
Set lighting shader. | |
HdStLightingShaderSharedPtr const & | GetLightingShader () const |
HDST_API void | SetRenderPassShader (HdStRenderPassShaderSharedPtr const &renderPassShader) |
renderpass shader | |
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 | |
bool | GetUseSceneMaterials () const |
HDST_API HdStShaderCodeSharedPtrVector | GetShaders () const |
returns shaders (lighting/renderpass) | |
HDST_API size_t | GetShaderHash () const |
HDST_API void | SetCameraFramingState (GfMatrix4d const &worldToViewMatrix, GfMatrix4d const &projectionMatrix, GfVec4d const &viewport, ClipPlanesVector const &clipPlanes) |
Camera setter API. | |
GfMatrix4d | GetCullMatrix () const |
HDST_API GfMatrix4d | GetWorldToViewMatrix () const override |
Overrides the case when no HdCamera is given. | |
HDST_API GfMatrix4d | GetProjectionMatrix () const override |
Overrides the case when no HdCamera is given. | |
HDST_API ClipPlanesVector const & | GetClipPlanes () const override |
Overrides the case when no HdCamera is given. | |
HDST_API GfVec4i | 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 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. | |
HDST_API AxisAlignedAffineTransform | ComputeImageToHorizontallyNormalizedFilmback () const |
Public Member Functions inherited from HdRenderPassState | |
virtual HD_API void | Prepare (HdResourceRegistrySharedPtr const &resourceRegistry) |
Schedule to update renderPassState parameters. | |
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 component is the blend value. | |
const GfVec4f & | GetOverrideColor () const |
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 component is the blend value. | |
const GfVec4f & | GetWireframeColor () const |
HD_API void | SetMaskColor (GfVec4f const &color) |
const GfVec4f & | GetMaskColor () const |
HD_API void | SetIndicatorColor (GfVec4f const &color) |
const GfVec4f & | GetIndicatorColor () const |
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 is the blend value. | |
const GfVec4f & | GetPointColor () const |
HD_API void | SetPointSize (float size) |
Set the point size for unselected points. | |
float | GetPointSize () const |
HD_API void | SetPointSelectedSize (float size) |
Set the point size for selected points. | |
float | GetPointSelectedSize () const |
HD_API void | SetLightingEnabled (bool enabled) |
XXX: Hacky way of disabling lighting. | |
bool | GetLightingEnabled () const |
HD_API void | SetClippingEnabled (bool enabled) |
bool | GetClippingEnabled () const |
HD_API void | SetAovBindings (HdRenderPassAovBindingVector const &aovBindings) |
Set the attachments for this renderpass to render into. | |
HD_API HdRenderPassAovBindingVector const & | GetAovBindings () const |
HD_API void | SetAovInputBindings (HdRenderPassAovBindingVector const &aovBindings) |
Set the AOVs that this renderpass needs to read from. | |
HD_API HdRenderPassAovBindingVector const & | GetAovInputBindings () const |
HD_API void | SetUseAovMultiSample (bool state) |
Returns true if the render pass wants to render into the multi-sample aovs. | |
HD_API bool | GetUseAovMultiSample () const |
HD_API void | SetCullStyle (HdCullStyle cullStyle) |
HD_API HdCullStyle | GetCullStyle () const |
HD_API void | SetAlphaThreshold (float alphaThreshold) |
float | GetAlphaThreshold () const |
HD_API void | SetTessLevel (float level) |
float | GetTessLevel () const |
HD_API void | SetDrawingRange (GfVec2f const &drawRange) |
GfVec2f | GetDrawingRange () const |
HD_API GfVec2f | GetDrawingRangeNDC () const |
HD_API void | SetDepthBiasUseDefault (bool useDefault) |
bool | GetDepthBiasUseDefault () const |
HD_API void | SetDepthBiasEnabled (bool enabled) |
bool | GetDepthBiasEnabled () const |
HD_API void | SetDepthBias (float constantFactor, float slopeFactor) |
HD_API void | SetDepthFunc (HdCompareFunction depthFunc) |
HdCompareFunction | GetDepthFunc () const |
HD_API void | SetEnableDepthMask (bool state) |
HD_API bool | GetEnableDepthMask () const |
HD_API void | SetEnableDepthTest (bool enabled) |
HD_API bool | GetEnableDepthTest () const |
HD_API void | SetEnableDepthClamp (bool enabled) |
HD_API bool | GetEnableDepthClamp () const |
HD_API void | SetDepthRange (GfVec2f const &depthRange) |
HD_API const GfVec2f & | GetDepthRange () const |
HD_API void | SetStencil (HdCompareFunction func, int ref, int mask, HdStencilOp fail, HdStencilOp zfail, HdStencilOp zpass) |
HdCompareFunction | GetStencilFunc () const |
int | GetStencilRef () const |
int | GetStencilMask () const |
HdStencilOp | GetStencilFailOp () const |
HdStencilOp | GetStencilDepthFailOp () const |
HdStencilOp | GetStencilDepthPassOp () const |
HD_API void | SetStencilEnabled (bool enabled) |
HD_API bool | GetStencilEnabled () const |
HD_API void | SetLineWidth (float width) |
float | GetLineWidth () const |
HD_API void | SetBlend (HdBlendOp colorOp, HdBlendFactor colorSrcFactor, HdBlendFactor colorDstFactor, HdBlendOp alphaOp, HdBlendFactor alphaSrcFactor, HdBlendFactor alphaDstFactor) |
HdBlendOp | GetBlendColorOp () |
HdBlendFactor | GetBlendColorSrcFactor () |
HdBlendFactor | GetBlendColorDstFactor () |
HdBlendOp | GetBlendAlphaOp () |
HdBlendFactor | GetBlendAlphaSrcFactor () |
HdBlendFactor | GetBlendAlphaDstFactor () |
HD_API void | SetBlendConstantColor (GfVec4f const &color) |
const GfVec4f & | GetBlendConstantColor () const |
HD_API void | SetBlendEnabled (bool enabled) |
HD_API void | SetAlphaToCoverageEnabled (bool enabled) |
bool | GetAlphaToCoverageEnabled () const |
HD_API void | SetColorMaskUseDefault (bool useDefault) |
bool | GetColorMaskUseDefault () const |
HD_API void | SetConservativeRasterizationEnabled (bool enabled) |
bool | GetConservativeRasterizationEnabled () const |
HD_API void | SetVolumeRenderingConstants (float stepSize, float stepSizeLighting) |
HD_API void | SetColorMasks (std::vector< ColorMask > const &masks) |
std::vector< ColorMask > const & | GetColorMasks () const |
HD_API void | SetMultiSampleEnabled (bool enabled) |
bool | GetMultiSampleEnabled () const |
HD_API void | SetCamera (const HdCamera *camera) |
Sets the camera. | |
HD_API void | SetOverrideWindowPolicy (const std::optional< CameraUtilConformWindowPolicy > &overrideWindowPolicy) |
Sets whether to override the window policy used to conform the camera if its aspect ratio is not matching the display window/viewport. | |
HD_API void | SetFraming (const CameraUtilFraming &framing) |
Sets the framing to show the camera. | |
HD_API void | SetViewport (const GfVec4d &viewport) |
Sets the viewport to show the camera. | |
HdCamera const * | GetCamera () const |
Get camera. | |
const CameraUtilFraming & | GetFraming () const |
Get framing information determining how the filmback plane maps to pixels. | |
const std::optional< CameraUtilConformWindowPolicy > & | GetOverrideWindowPolicy () const |
The override value for the window policy to conform the camera frustum that can be specified by the application. | |
HD_API CameraUtilConformWindowPolicy | GetWindowPolicy () const |
The resolved window policy to conform the camera frustum. | |
GfVec4f const & | GetViewport () const |
Only use when clients did not specify a camera framing. | |
HD_API GfMatrix4d | GetImageToWorldMatrix () const |
Compute a transform from window relative coordinates (x,y,z,1) to homogeneous world coordinates (x,y,z,w), using the HdCamera's attributes, framing, and viewport dimensions. | |
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.
using AxisAlignedAffineTransform = GfVec4f |
Definition at line 208 of file renderPassState.h.
HDST_API void 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 GfVec4i 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.
|
overridevirtual |
Overrides the case when no HdCamera is given.
In the case, uses clip planes specified by SetCameraFramingState.
Reimplemented from HdRenderPassState.
|
inline |
Definition at line 162 of file renderPassState.h.
HDST_API uint64_t GetGraphicsPipelineHash | ( | HdSt_GeometricShaderSharedPtr const & | geometricShader, |
bool | firstDrawBatch | ||
) | const |
Generates the hash for the settings used to init the graphics pipeline.
|
inline |
Definition at line 116 of file renderPassState.h.
|
overridevirtual |
Overrides the case when no HdCamera is given.
In the case, uses matrix specified by SetCameraFramingState.
Reimplemented from HdRenderPassState.
|
inline |
Definition at line 123 of file renderPassState.h.
HDST_API HdStShaderCodeSharedPtrVector GetShaders | ( | ) | const |
returns shaders (lighting/renderpass)
|
inline |
Definition at line 138 of file renderPassState.h.
|
overridevirtual |
Overrides the case when no HdCamera is given.
In the case, uses matrix specified by SetCameraFramingState.
Reimplemented from HdRenderPassState.
|
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 SetCameraFramingState | ( | GfMatrix4d const & | worldToViewMatrix, |
GfMatrix4d const & | projectionMatrix, | ||
GfVec4d const & | viewport, | ||
ClipPlanesVector const & | clipPlanes | ||
) |
HDST_API void SetLightingShader | ( | HdStLightingShaderSharedPtr const & | lightingShader | ) |
Set lighting shader.
HDST_API void SetRenderPassShader | ( | HdStRenderPassShaderSharedPtr const & | renderPassShader | ) |
renderpass shader
HDST_API void 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 SetUseSceneMaterials | ( | bool | state | ) |
scene materials