Function addAABBHitGroup

Synopsis

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

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

Description

No description yet.

Source

Lines 108-136 in Source/Falcor/Raytracing/RtProgram/RtProgram.cpp. Line 89 in Source/Falcor/Raytracing/RtProgram/RtProgram.h.

RtProgram::Desc& RtProgram::Desc::addAABBHitGroup(uint32_t hitIndex, const std::string& closestHit, const std::string& anyHit /*= ""*/)
{
    if (hitIndex >= mAABBHitGroupEntryPoints.size())
    {
        mAABBHitGroupEntryPoints.resize(hitIndex + 1);
    }
    else
    {
        auto& group = mAABBHitGroupEntryPoints[hitIndex];
        if (group.closestHit != uint32_t(-1) || group.anyHit != uint32_t(-1))
        {
            throw std::exception(("There is already an AABB hit group defined at index " + std::to_string(hitIndex)).c_str());
        }
    }
    auto& group = mAABBHitGroupEntryPoints[hitIndex];
    if (!closestHit.empty())
    {
        group.closestHit = mBaseDesc.declareEntryPoint(ShaderType::ClosestHit, closestHit);
    }
    if (!anyHit.empty())
    {
        group.anyHit = mBaseDesc.declareEntryPoint(ShaderType::AnyHit, anyHit);
    }
    return *this;
}





Add Discussion as Guest

Log in