Files
MapLibreParticleLab/shaders/particle_gpu_validation.vertex.glsl
2026-08-30 10:27:24 +08:00

24 lines
605 B
GLSL

layout (location = 0) in vec2 a_pos;
out vec2 v_uv;
out vec2 v_world;
layout (std140) uniform ParticleGpuValidationUBO {
highp vec4 u_pass;
highp vec4 u_marker;
highp vec4 u_mask;
highp mat4 u_matrix;
};
void main() {
v_uv = a_pos;
v_world = a_pos;
if (u_pass.x < 1.5) {
gl_Position = vec4(a_pos * 2.0 - 1.0, 0.0, 1.0);
} else {
// VALIDATION ONLY: a_pos is canonical z0 world geometry; u_matrix is
// PaintParameters::matrixForTile() for the selected MapLibre world copy.
gl_Position = u_matrix * vec4(a_pos * 8192.0, 0.0, 1.0);
}
}