Toast Engine
Loading...
Searching...
No Matches
shadow_constants.hpp File Reference

Mirrored by shadow_depth.slang and mesh.slang. More...

#include <algorithm>
#include <cstdint>
#include <toast/export.hpp>
Include dependency graph for shadow_constants.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

auto renderer::shadows::cascadeResolution () -> uint32_t
auto renderer::shadows::punctualResolution () -> uint32_t
auto renderer::shadows::shadowDistance () -> float
void renderer::shadows::setCascadeResolution (uint32_t resolution)
void renderer::shadows::setPunctualResolution (uint32_t resolution)
void renderer::shadows::setShadowDistance (float distance)
auto renderer::shadows::punctualShadowResolution (float camera_distance, float resolution_scale) -> uint32_t

Variables

constexpr uint32_t renderer::shadows::k_cascade_count = 4
constexpr uint32_t renderer::shadows::k_cascade_resolution = 1024
constexpr float renderer::shadows::k_shadow_distance = 150.0f
constexpr float renderer::shadows::k_cascade_split_lambda = 0.75f
constexpr uint32_t renderer::shadows::k_max_spot_shadows = 4
constexpr uint32_t renderer::shadows::k_max_point_shadows = 2
constexpr uint32_t renderer::shadows::k_cube_faces = 6
constexpr uint32_t renderer::shadows::k_punctual_resolution = 512
constexpr uint32_t renderer::shadows::k_min_punctual_resolution = 64
constexpr float renderer::shadows::k_punctual_full_resolution_distance = 10.0f
constexpr float renderer::shadows::k_punctual_min_resolution_distance = 60.0f
constexpr uint32_t renderer::shadows::k_spot_layer_base = 0
 Spots first then six faces per point light.
constexpr uint32_t renderer::shadows::k_point_layer_base = k_max_spot_shadows
constexpr uint32_t renderer::shadows::k_punctual_layer_count = k_max_spot_shadows + (k_max_point_shadows * k_cube_faces)
constexpr uint32_t renderer::shadows::k_max_shadow_views = k_cascade_count + k_punctual_layer_count
 Also sizes the shadow_depth.slang matrix array.
constexpr float renderer::shadows::k_punctual_near = 0.05f
constexpr float renderer::shadows::k_cube_face_guard_texels = 4.0f
 Must exceed the mesh.slang filter radius.

Detailed Description

Mirrored by shadow_depth.slang and mesh.slang.

Author
dario
Date
01/08/2026

Function Documentation

◆ cascadeResolution()

TOAST_API auto renderer::shadows::cascadeResolution ( ) -> uint32_t
Note
Set on the main thread before the passes are built