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

Returns
the pixel spread angle in screen space

Source

Lines 296-301 in Source/Falcor/Scene/Camera/Camera.cpp. Line 193 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