Function computeScreenSpacePixelSpreadAngle

Synopsis

#include <Source/Falcor/Scene/Camera/Camera.h>

float computeScreenSpacePixelSpreadAngle(const uint32_t winHeightPixels) const

Description

Compute pixel spread in screen space - to be used with RayCones for texture level-of-detail.

Parameters:

[ in ] winHeightPixels - Window height in pixels

Return
the pixel spread angle in screen space

Source

Lines 292-297 in Source/Falcor/Scene/Camera/Camera.cpp. Line 192 in Source/Falcor/Scene/Camera/Camera.h.

float Camera::computeScreenSpacePixelSpreadAngle(const uint32_t winHeightPixels) const
{
    const float FOVrad = focalLengthToFovY(getFocalLength(), Camera::kDefaultFrameHeight);
    const float angle = std::atan(2.0f * std::tan(FOVrad * 0.5f) / winHeightPixels);
    return angle;
}





Add Discussion as Guest

Log in to DocsForge