Function setRtParams

Synopsis

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

Desc & setRtParams(uint32_t rtIndex, BlendOp rgbOp, BlendOp alphaOp, BlendFunc srcRgbFunc, BlendFunc dstRgbFunc, BlendFunc srcAlphaFunc, BlendFunc dstAlphaFunc)

Description

Set the blend parameters

Parameters:

[ in ] rtIndex - The RT index to set the parameters into. If independent blending is disabled, only the index 0 is used.

[ in ] rgbOp - Blend operation for the RGB channels

[ in ] alphaOp - Blend operation for the alpha channels

[ in ] srcRgbFunc - Blend function for the fragment-shader output RGB channels

[ in ] dstRgbFunc - Blend function for the render-target RGB channels

[ in ] srcAlphaFunc - Blend function for the fragment-shader output alpha channel

[ in ] dstAlphaFunc - Blend function for the render-target alpha channel

Source

Lines 46-60 in Source/Falcor/Core/API/BlendState.cpp. Line 101 in Source/Falcor/Core/API/BlendState.h.

BlendState::Desc& BlendState::Desc::setRtParams(uint32_t rtIndex, BlendOp rgbOp, BlendOp alphaOp, BlendFunc srcRgbFunc, BlendFunc dstRgbFunc, BlendFunc srcAlphaFunc, BlendFunc dstAlphaFunc)
{
    if(rtIndex >= mRtDesc.size())
    {
        logError("Error when setting blend state RT parameters. Invalid render-target index " + std::to_string(rtIndex) + ". Must be smaller than " + std::to_string(mRtDesc.size()) + ".");
        return *this;
    }
    mRtDesc[rtIndex].rgbBlendOp = rgbOp;
    mRtDesc[rtIndex].alphaBlendOp = alphaOp;
    mRtDesc[rtIndex].srcRgbFunc = srcRgbFunc;
    mRtDesc[rtIndex].dstRgbFunc = dstRgbFunc;
    mRtDesc[rtIndex].srcAlphaFunc = srcAlphaFunc;
    mRtDesc[rtIndex].dstAlphaFunc = dstAlphaFunc;
    return *this;
}





Add Discussion as Guest

Log in to DocsForge