test: validate particle camera wrap and ocean mask
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
layout (std140) uniform ParticleGpuValidationUBO {
|
||||
highp vec4 u_pass;
|
||||
highp vec4 u_marker;
|
||||
highp vec4 u_mask;
|
||||
highp mat4 u_matrix;
|
||||
};
|
||||
|
||||
uniform sampler2D u_previous;
|
||||
uniform sampler2D u_mask_texture;
|
||||
in vec2 v_uv;
|
||||
in vec2 v_world;
|
||||
|
||||
void main() {
|
||||
vec4 previous = texture(u_previous, v_uv);
|
||||
@@ -19,9 +23,20 @@ void main() {
|
||||
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 {
|
||||
// Main pass: composite the latest trail without hiding the validation map.
|
||||
// VALIDATION ONLY: canonical world-space pattern and shared mask.
|
||||
float intensity = max(previous.r, max(previous.g, previous.b));
|
||||
fragColor = vec4(previous.rgb * 0.72, min(intensity * 0.72, 0.72));
|
||||
float ocean = texture(u_mask_texture, v_world).a;
|
||||
if (u_pass.z > 0.5 && ocean < 0.5) discard;
|
||||
float stripe = 0.55 + 0.45 * sin((v_world.x + v_world.y) * 100.0 + u_pass.y * 0.07);
|
||||
// A=(0°,0°), B=(-90°,approximately 0°), C/D straddle ±180°.
|
||||
float anchors = 0.0;
|
||||
anchors = max(anchors, 1.0 - smoothstep(0.0, 0.008, distance(v_world, vec2(0.50, 0.50))));
|
||||
anchors = max(anchors, 1.0 - smoothstep(0.0, 0.008, distance(v_world, vec2(0.25, 0.50))));
|
||||
anchors = max(anchors, 1.0 - smoothstep(0.0, 0.008, distance(v_world, vec2(0.02, 0.50))));
|
||||
anchors = max(anchors, 1.0 - smoothstep(0.0, 0.008, distance(v_world, vec2(0.98, 0.50))));
|
||||
vec3 color = u_pass.w < 1.5 ? vec3(0.10, 0.70, 1.00) : vec3(0.35, 1.00, 0.45);
|
||||
fragColor = vec4(mix(color * stripe, vec3(1.00, 0.82, 0.15), anchors),
|
||||
0.28 + min(intensity, 0.35) * 0.35 + anchors * 0.35);
|
||||
}
|
||||
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
|
||||
Reference in New Issue
Block a user