Function setStencilOp

Synopsis

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

Desc & setStencilOp(Face face, StencilOp stencilFail, StencilOp depthFail, StencilOp depthStencilPass)

Description

Set the stencil operation

Parameters

face - Chooses the face to apply the operation to

stencilFail - Stencil operation in case stencil test fails

depthFail - Stencil operation in case stencil test passes but depth test fails

depthStencilPass - Stencil operation in case stencil and depth tests pass

Source

Lines 65-79 in Source/Falcor/Core/API/DepthStencilState.cpp. Line 120 in Source/Falcor/Core/API/DepthStencilState.h.

DepthStencilState::Desc& DepthStencilState::Desc::setStencilOp(Face face, StencilOp stencilFail, StencilOp depthFail, StencilOp depthStencilPass)
{
    if(face == Face::FrontAndBack)
    {
        setStencilOp(Face::Front, stencilFail, depthFail, depthStencilPass);
        setStencilOp(Face::Back, stencilFail, depthFail, depthStencilPass);
        return *this;
    }
    StencilDesc& Desc = (face == Face::Front) ? mStencilFront : mStencilBack;
    Desc.stencilFailOp = stencilFail;
    Desc.depthFailOp = depthFail;
    Desc.depthStencilPassOp = depthStencilPass;
    return *this;
}





Add Discussion as Guest

Log in