Toast Engine
Loading...
Searching...
No Matches
light_culling.hpp
Go to the documentation of this file.
1
4
5#pragma once
6
7#include <glm/glm.hpp>
8
9namespace renderer::light_culling {
10
11struct Sphere {
12 glm::vec3 center {0.0f};
13 float radius = 0.0f;
14};
15
16struct DepthRange {
17 float near_depth = 0.0f;
18 float far_depth = 0.0f;
19};
20
22[[nodiscard]]
23auto spotBounds(const glm::vec3& position, const glm::vec3& direction, float range, float outer_radians) -> Sphere;
24
26[[nodiscard]]
27auto importance(const glm::vec3& color, float intensity, float range, float camera_distance, float cone_fraction) -> float;
28
30[[nodiscard]]
31auto clusterDepthRange(float camera_near, float camera_far, float light_reach) -> DepthRange;
32
33}
auto importance(const glm::vec3 &color, float intensity, float range, float camera_distance, float cone_fraction) -> float
Only ranks lights against each other.
Definition light_culling.cpp:26
auto spotBounds(const glm::vec3 &position, const glm::vec3 &direction, float range, float outer_radians) -> Sphere
Smallest sphere around the cone of a spot light capped at its range.
Definition light_culling.cpp:15
auto clusterDepthRange(float camera_near, float camera_far, float light_reach) -> DepthRange
Ends at the farthest visible light so slices are not spent on empty depth.
Definition light_culling.cpp:36
Definition light_culling.hpp:16
Definition light_culling.hpp:11