Skip to main content

PROBE_TYPES

Constant PROBE_TYPES 

Source
pub const PROBE_TYPES: &str = "// Reflection-probe records, spliced into a shader at its PROBE_TYPES marker\n// (see slang_source.rs). Declares no resource and no entry point, so it is not\n// a standalone program; it exists because the probe set is bound at a different\n// slot by every pass that reads it, while the record layout is one CPU struct.\n//\n// Splices in two halves on purpose: the records have to be declared before a\n// shader\'s resource bindings (a binding names ProbeSet) and the sampling\n// helpers after them (they read the bound set through PROBE_SET). Nothing here\n// may spell either marker -- the splice would reintroduce it.\n//\n// MAX_PROBES is the probe-array length the host binds, injected as a define.\n\n// Fraction of a probe box\'s smallest half-extent over which its blend weight\n// ramps from 0 to 1 across the box surface.\nstatic const float PROBE_BLEND_MARGIN = 0.2;\n\nstruct ProbeUniforms\n{\n    float4 box_min;   // xyz = influence-box min, w = enabled\n    float4 box_max;   // xyz = influence-box max\n    float4 probe_pos; // xyz = capture position\n};\n\n// Mirror of `metal::uniforms::ProbeSet` / the forward global set\'s ProbeBlock:\n// `count` is padded with THREE scalar uints rather than a uint3, which would be\n// 16-byte aligned and push `probes` to offset 32.\nstruct ProbeSet\n{\n    uint count;\n    uint _pad0;\n    uint _pad1;\n    uint _pad2;\n    ProbeUniforms probes[MAX_PROBES];\n};\n";
Expand description

probe_types.slang.