1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! The reflection-probe set the forward, SSR and ray-traced resolves all read.
//! Matches `ProbeUniforms` / `ProbeSet` in `shaders/probe_types.slang`, whose
//! `MAX_PROBES` is baked in from the constant below.
/// Maximum reflection probes a frame can bind. The shader's `MAX_PROBES` define
/// is injected from this value, so the two cannot drift.
pub const MAX_PROBES: usize = 8;
// Every automatically seeded probe has to fit in the bound set.
const _: = assert!;
/// One reflection probe's parallax box. The specular IBL term box-projects the
/// reflection vector against [box_min, box_max] (the probe's influence volume)
/// and re-anchors the cube sample at the box hit relative to `probe_pos` (the
/// capture point), so a static captured cube tracks a moving first-person
/// camera. Three float4s keep every field 16-byte aligned. `box_min.w` is the
/// enabled flag: 0 disables parallax (and signals no baked probe), so the shader
/// samples the raw reflection vector.
/// The full set of reflection probes. `count` is how many of `probes` are live;
/// the fragment shader blends every probe whose influence box covers the surface
/// (a partition-of-unity weight by signed box distance), falling back to the
/// nearest when the surface is outside all boxes, and samples those slices of
/// the probe cube array. Slices beyond `count` hold the sky fallback cube and a
/// `DISABLED` box.