feat: draw all raster particle states
Some checks failed
validate-scripts / validate-scripts (push) Has been cancelled
Some checks failed
validate-scripts / validate-scripts (push) Has been cancelled
This commit is contained in:
@@ -40,8 +40,15 @@ void main() {
|
||||
if (any(isnan(velocity))) position = v_uv;
|
||||
fragColor = vec4(position, fract(previous.b + 0.03125 * u_pass.y), 1.0);
|
||||
} else if (mode < 1.5) {
|
||||
// The trail consumes State B/A written by the real field-sampling pass.
|
||||
// Four deterministic texels are enough for the Stage A visual proof.
|
||||
// Formal Trail first fades the previous target. Its full-particle point
|
||||
// draw follows in the same target and consumes every State texel.
|
||||
if (u_mask.z > 0.5) {
|
||||
fragColor = vec4(previous.rgb * u_marker.w, 1.0);
|
||||
return;
|
||||
}
|
||||
|
||||
// LEGACY VALIDATION DISPLAY: retain the original four deterministic
|
||||
// samples for the historical ParticleValidationLayer only.
|
||||
float marker = 0.0;
|
||||
marker = max(marker, 1.0 - smoothstep(0.0, u_marker.z, distance(v_uv, texture(u_state_texture, vec2(0.125, 0.125)).rg)));
|
||||
marker = max(marker, 1.0 - smoothstep(0.0, u_marker.z, distance(v_uv, texture(u_state_texture, vec2(0.375, 0.375)).rg)));
|
||||
@@ -49,6 +56,11 @@ void main() {
|
||||
marker = max(marker, 1.0 - smoothstep(0.0, u_marker.z, distance(v_uv, texture(u_state_texture, vec2(0.875, 0.875)).rg)));
|
||||
vec3 color = previous.rgb * u_marker.w + marker * vec3(0.08, 0.55, 1.0);
|
||||
fragColor = vec4(min(color, vec3(1.0)), 1.0);
|
||||
} else if (mode > 3.5) {
|
||||
// The vertex shader fetched this particle's State texel directly from
|
||||
// the current State write texture. Every point contributes one formal
|
||||
// particle draw; no CPU position data is involved per frame.
|
||||
fragColor = vec4(0.08, 0.55, 1.0, 1.0);
|
||||
} else {
|
||||
// The formal RasterParticle layer displays the Trail texture written by
|
||||
// the current State -> Trail pass. Legacy ParticleValidation keeps its
|
||||
|
||||
@@ -10,11 +10,22 @@ layout (std140) uniform ParticleGpuValidationUBO {
|
||||
highp mat4 u_matrix;
|
||||
};
|
||||
|
||||
uniform sampler2D u_state_texture;
|
||||
|
||||
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 if (u_pass.x > 3.5) {
|
||||
// 40-03: a_pos is a static State texel index generated only when the
|
||||
// particle capacity changes. The position itself remains GPU-owned.
|
||||
vec2 stateUV = (a_pos + vec2(0.5)) / u_mask.xy;
|
||||
vec2 position = texture(u_state_texture, stateUV).rg;
|
||||
v_uv = position;
|
||||
v_world = position;
|
||||
gl_PointSize = 3.0;
|
||||
gl_Position = vec4(position * 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.
|
||||
|
||||
Reference in New Issue
Block a user