Files
MapLibreParticleLab/include/mln/shaders/particle_gpu_validation_ubo.hpp

41 lines
1.7 KiB
C++

#pragma once
#include <array>
namespace mln {
namespace shaders {
// VALIDATION ONLY: 30-02 State/Trail and 30-03 Camera/Mask proof parameters.
struct alignas(16) ParticleGpuValidationUBO {
std::array<float, 4> pass;
std::array<float, 4> marker;
std::array<float, 4> mask;
// Formal RasterParticle visual controls: particle opacity, canonical
// streak length, trail opacity, and Trail A/B fade multiplier.
std::array<float, 4> visual;
// west, north, east, south in normalized Web Mercator world coordinates.
// Field textures are regional; they must never be sampled as global UVs.
std::array<float, 4> fieldBounds;
// Preferred respawn domain. It is the expanded stable viewport intersected
// with fieldBounds, or fieldBounds when that intersection is unusable.
std::array<float, 4> respawnBounds;
// Per-texture signed vector decoding scales. WeatherColor also uses these
// for its explicitly selected generic scalar/value plane.
// z is viewportDensityActive for the formal validation path.
std::array<float, 4> fieldScale;
// x: Direction semantics flag; y: Direction-only advection scale;
// z: mixed-direction fail-closed epsilon; w: reserved.
std::array<float, 4> advection;
// Host-owned base colours. They are independent from WeatherColor stops.
std::array<float, 4> particleColor;
std::array<float, 4> trailColor;
std::array<std::array<float, 4>, 8> weatherStops;
std::array<std::array<float, 4>, 8> weatherColors;
std::array<float, 4> weatherRamp;
std::array<float, 16> matrix;
};
static_assert(sizeof(ParticleGpuValidationUBO) == 31 * 16);
} // namespace shaders
} // namespace mln