Toast Engine
Toggle main menu visibility
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
9
namespace
renderer::light_culling {
10
11
struct
Sphere
{
12
glm::vec3 center {0.0f};
13
float
radius = 0.0f;
14
};
15
16
struct
DepthRange
{
17
float
near_depth = 0.0f;
18
float
far_depth = 0.0f;
19
};
20
22
[[nodiscard]]
23
auto
spotBounds
(
const
glm::vec3& position,
const
glm::vec3& direction,
float
range,
float
outer_radians) ->
Sphere
;
24
26
[[nodiscard]]
27
auto
importance
(
const
glm::vec3& color,
float
intensity,
float
range,
float
camera_distance,
float
cone_fraction) -> float;
28
30
[[nodiscard]]
31
auto
clusterDepthRange
(
float
camera_near,
float
camera_far,
float
light_reach) ->
DepthRange
;
32
33
}
renderer::light_culling::importance
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
renderer::light_culling::spotBounds
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
renderer::light_culling::clusterDepthRange
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
renderer::light_culling::DepthRange
Definition
light_culling.hpp:16
renderer::light_culling::Sphere
Definition
light_culling.hpp:11
engine
src
toast
renderer
light_culling.hpp
Generated by
1.17.0