Class Desc

Synopsis

#include <Source/Falcor/Core/API/RasterizerState.h>

class dlldecl Desc

Description

Rasterizer state descriptor

Mentioned in

Methods

setConservativeRasterizationEnable/disable conservative rasterization
setCullModeSet the cull mode
setDepthBiasSet the depth-bias
setDepthClampDetermines weather to clip or cull the vertices based on depth
setFillModeSet the fill mode
setForcedSampleCountSet the forced sample count
setFrontCounterCWDetermines how to interpret triangle direction.
setLineAntiAliasingEnable/disable anti-aliased lines
setScissorTestEnable/disable scissor test

Source

Lines 59-117 in Source/Falcor/Core/API/RasterizerState.h.

class dlldecl Desc
{
public:
    friend class RasterizerState;
    /** Set the cull mode
    */
    Desc& setCullMode(CullMode mode) { mCullMode = mode; return *this; }
    /** Set the fill mode
    */
    Desc& setFillMode(FillMode mode) { mFillMode = mode; return *this; }
    /** Determines how to interpret triangle direction.
        \param isFrontCCW If true, a triangle is front-facing if is vertices are counter-clockwise. If false, the opposite.
    */
    Desc& setFrontCounterCW(bool isFrontCCW) { mIsFrontCcw = isFrontCCW; return *this; }
    /** Set the depth-bias. The depth bias is calculated as
        \code
        bias = (float)depthBias * r + slopeScaledBias * maxDepthSlope
        \endcode
        where r is the minimum representable value in the depth buffer and maxDepthSlope is the maximum of the horizontal and vertical slopes of the depth value in the pixel.\n
        See <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/cc308048%28v=vs.85%29.aspx">the DX documentation</a> for depth bias explanation.
    */
    Desc& setDepthBias(int32_t depthBias, float slopeScaledBias) { mSlopeScaledDepthBias = slopeScaledBias; mDepthBias = depthBias; return *this; }
    /** Determines weather to clip or cull the vertices based on depth
        \param clampDepth If true, clamp depth value to the viewport extent. If false, clip primitives to near/far Z-planes
    */
    Desc& setDepthClamp(bool clampDepth) { mClampDepth = clampDepth; return *this; }
    /** Enable/disable anti-aliased lines. Actual anti-aliasing algorithm is implementation dependent, but usually uses quadrilateral lines.
    */
    Desc& setLineAntiAliasing(bool enableLineAA) { mEnableLinesAA = enableLineAA; return *this; };
    /** Enable/disable scissor test
    */
    Desc& setScissorTest(bool enabled) {mScissorEnabled = enabled ; return *this;}
    /** Enable/disable conservative rasterization
    */
    Desc& setConservativeRasterization(bool enabled) { mConservativeRaster = enabled; return *this; }
    /** Set the forced sample count. Useful when using UAV
    */
    Desc& setForcedSampleCount(uint32_t samples) { mForcedSampleCount = samples; return *this; }
protected:
    CullMode mCullMode = CullMode::Back;
    FillMode mFillMode = FillMode::Solid;
    bool     mIsFrontCcw = true;
    float    mSlopeScaledDepthBias = 0;
    int32_t  mDepthBias = 0;
    bool     mClampDepth = false;
    bool     mScissorEnabled = false;
    bool     mEnableLinesAA = true;
    uint32_t mForcedSampleCount = 0;
    bool     mConservativeRaster = false;
};





Add Discussion as Guest

Log in to DocsForge