22 std::array<Sample, MAX_KERNEL_SIZE>
samples{};
26 std::array<float, NOISE_SIZE * NOISE_SIZE * 4>
noiseData{};
31 std::uniform_real_distribution<float> dist(0.0f, 1.0f);
32 std::uniform_real_distribution<float> ndist(-1.0f, 1.0f);
34 for (uint32_t i = 0; i < kernelSize; ++i) {
41 float len = std::sqrt(x * x + y * y + z * z);
42 if (len < 0.0001f) len = 0.0001f;
48 float scale =
static_cast<float>(i) /
static_cast<float>(kernelSize);
49 scale = Lerp(0.1f, 1.0f, scale * scale);
67 static float Lerp(
float a,
float b,
float t) {
68 return a + t * (b - a);
constexpr T Lerp(const T &start, const T &end, float t)
Linear interpolation from start to end; t is clamped to [0,1].
Backend-facing rendering layer shared by the four graphics backends.
Root namespace for everything the engine exposes.
One hemisphere sample offset (w unused, kept for GPU alignment).
void Generate(uint32_t kernelSize=MAX_KERNEL_SIZE)
Fills samples[] and noiseData[] with a deterministic (seed 42) cosine-weighted kernel.
static constexpr uint32_t MAX_KERNEL_SIZE
std::array< Sample, MAX_KERNEL_SIZE > samples
static constexpr uint32_t NOISE_SIZE
std::array< float, NOISE_SIZE *NOISE_SIZE *4 > noiseData