Function addHitGroup

Synopsis

#include <Source/Falcor/Raytracing/RtProgram/RtProgram.h>

Desc & addHitGroup(uint32_t hitIndex, const std::string &closestHit, const std::string &anyHit="")

Description

No description yet.

Source

Lines 82-106 in Source/Falcor/Raytracing/RtProgram/RtProgram.cpp. Line 87 in Source/Falcor/Raytracing/RtProgram/RtProgram.h.

RtProgram::Desc& RtProgram::Desc::addHitGroup(uint32_t hitIndex, const std::string& closestHit, const std::string& anyHit)
{
    if (hitIndex >= mHitGroups.size())
    {
        mHitGroups.resize(hitIndex + 1);
    }
    else if (mHitGroups[hitIndex].groupIndex >= 0)
    {
        logError("already have a hit group at that index");
    }
    mBaseDesc.beginEntryPointGroup();
    if (closestHit.length())
    {
        mBaseDesc.entryPoint(ShaderType::ClosestHit, closestHit);
    }
    if (anyHit.length())
    {
        mBaseDesc.entryPoint(ShaderType::AnyHit, anyHit);
    }
    DescExtra::GroupInfo info = { mBaseDesc.mActiveGroup };
    mHitGroups[hitIndex] = info;
    return *this;
}





Add Discussion as Guest

Log in