diff --git a/client/shaders/fog.gdshader b/client/shaders/fog.gdshader index 99dcb17a4..1505d3268 100644 --- a/client/shaders/fog.gdshader +++ b/client/shaders/fog.gdshader @@ -63,56 +63,55 @@ void fragment() { vec2 tex_uv = (tile - map_offset) / map_size; // Outside known map -> unexplored + // Note: no early return — fragment() in OpenGL3 compat doesn't support return. if (tex_uv.x < 0.0 || tex_uv.x > 1.0 || tex_uv.y < 0.0 || tex_uv.y > 1.0) { COLOR = vec4(UNEXPLORED_COLOR, 1.0); - return; - } // Debug mode: render raw exploration texture (bypass fog rendering). // Green = EXP_VISIBLE (255), blue = EXP_EXPLORED (128), red = EXP_UNEXPLORED (0). - if (debug_exploration) { - float explored = texture(exploration_tex, tex_uv).r; - if (explored > 0.9) { - COLOR = vec4(0.0, explored, 0.0, 0.8); // Green: currently visible - } else if (explored > 0.1) { - COLOR = vec4(0.0, 0.0, explored * 2.0, 0.8); // Blue: explored + } else if (debug_exploration) { + float explored_dbg = texture(exploration_tex, tex_uv).r; + if (explored_dbg > 0.9) { + COLOR = vec4(0.0, explored_dbg, 0.0, 0.8); // Green: currently visible + } else if (explored_dbg > 0.1) { + COLOR = vec4(0.0, 0.0, explored_dbg * 2.0, 0.8); // Blue: explored } else { - COLOR = vec4(0.5, 0.0, 0.0, 0.8); // Red: unexplored + COLOR = vec4(0.5, 0.0, 0.0, 0.8); // Red: unexplored } - return; - } - float vis_raw = texture(visibility_tex, tex_uv).r; - float vis = sample_visibility(tex_uv); - float explored_raw = texture(exploration_tex, tex_uv).r; - float explored = sample_exploration(tex_uv); - - // Prevent gradient bleed into never-explored tiles (use raw, unblurred value) - if (explored_raw < 0.01 && vis_raw < 0.01) { - vis = 0.0; - } - - if (explored < 0.01 && vis < 0.01) { - // Unexplored: solid near-black — information zero - COLOR = vec4(UNEXPLORED_COLOR, 1.0); } else { - // Fog noise — 8-10s breathe cycle, ±0.05 symmetric around baseline - float noise_val = texture(noise_tex, tile * 0.03 + vec2(time * 0.11, time * 0.07)).r; - float fog_alpha = 0.30 + (noise_val * 2.0 - 1.0) * 0.05; // 0.25-0.35 + float vis_raw = texture(visibility_tex, tex_uv).r; + float vis = sample_visibility(tex_uv); + float explored_raw = texture(exploration_tex, tex_uv).r; + float explored = sample_exploration(tex_uv); - // Zone temperature tint (D-046/D-077): subtle warm/cool/neutral per zone - vec3 zone_tint = texture(zone_tint_tex, tex_uv).rgb; + // Prevent gradient bleed into never-explored tiles (use raw, unblurred value) + if (explored_raw < 0.01 && vis_raw < 0.01) { + vis = 0.0; + } - // Clarity ramp: transparent inside cone, light fog at edges and beyond - float clarity = smoothstep(0.0, 0.85, vis); - float alpha = mix(fog_alpha, 0.0, clarity); - vec3 color = mix(zone_tint, vec3(0.0), clarity); + if (explored < 0.01 && vis < 0.01) { + // Unexplored: solid near-black — information zero + COLOR = vec4(UNEXPLORED_COLOR, 1.0); + } else { + // Fog noise — 8-10s breathe cycle, ±0.05 symmetric around baseline + float noise_val = texture(noise_tex, tile * 0.03 + vec2(time * 0.11, time * 0.07)).r; + float fog_alpha = 0.30 + (noise_val * 2.0 - 1.0) * 0.05; // 0.25-0.35 - // Soft edge between explored and unexplored (blurred to avoid staircase) - float exp_fade = smoothstep(0.0, 0.3, explored); - alpha = mix(1.0, alpha, exp_fade); - color = mix(UNEXPLORED_COLOR, color, exp_fade); + // Zone temperature tint (D-046/D-077): subtle warm/cool/neutral per zone + vec3 zone_tint = texture(zone_tint_tex, tex_uv).rgb; - COLOR = vec4(color, alpha); + // Clarity ramp: transparent inside cone, light fog at edges and beyond + float clarity = smoothstep(0.0, 0.85, vis); + float alpha = mix(fog_alpha, 0.0, clarity); + vec3 color = mix(zone_tint, vec3(0.0), clarity); + + // Soft edge between explored and unexplored (blurred to avoid staircase) + float exp_fade = smoothstep(0.0, 0.3, explored); + alpha = mix(1.0, alpha, exp_fade); + color = mix(UNEXPLORED_COLOR, color, exp_fade); + + COLOR = vec4(color, alpha); + } } } diff --git a/client/tests/golden/visual/cursor_menu.png b/client/tests/golden/visual/cursor_menu.png new file mode 100644 index 000000000..5d403fd90 Binary files /dev/null and b/client/tests/golden/visual/cursor_menu.png differ diff --git a/client/tests/golden/visual/dialogue_open.png b/client/tests/golden/visual/dialogue_open.png new file mode 100644 index 000000000..57a77426e Binary files /dev/null and b/client/tests/golden/visual/dialogue_open.png differ diff --git a/client/tests/golden/visual/dialogue_with_monologue.png b/client/tests/golden/visual/dialogue_with_monologue.png new file mode 100644 index 000000000..7140a3edd Binary files /dev/null and b/client/tests/golden/visual/dialogue_with_monologue.png differ diff --git a/client/tests/golden/visual/fog_3state.png b/client/tests/golden/visual/fog_3state.png new file mode 100644 index 000000000..752ebef08 Binary files /dev/null and b/client/tests/golden/visual/fog_3state.png differ diff --git a/client/tests/golden/visual/fog_boundary.png b/client/tests/golden/visual/fog_boundary.png new file mode 100644 index 000000000..534ab85fd Binary files /dev/null and b/client/tests/golden/visual/fog_boundary.png differ diff --git a/client/tests/golden/visual/fog_debug.png b/client/tests/golden/visual/fog_debug.png new file mode 100644 index 000000000..050a5604b Binary files /dev/null and b/client/tests/golden/visual/fog_debug.png differ diff --git a/client/tests/golden/visual/fog_diagonal.png b/client/tests/golden/visual/fog_diagonal.png new file mode 100644 index 000000000..d7442dc6a Binary files /dev/null and b/client/tests/golden/visual/fog_diagonal.png differ diff --git a/client/tests/golden/visual/fog_zone_tint.png b/client/tests/golden/visual/fog_zone_tint.png new file mode 100644 index 000000000..ac4ad7515 Binary files /dev/null and b/client/tests/golden/visual/fog_zone_tint.png differ diff --git a/client/tests/golden/visual/hud_default.png b/client/tests/golden/visual/hud_default.png new file mode 100644 index 000000000..bbe799534 Binary files /dev/null and b/client/tests/golden/visual/hud_default.png differ diff --git a/client/tests/golden/visual/minimap_stance.png b/client/tests/golden/visual/minimap_stance.png new file mode 100644 index 000000000..77839577a Binary files /dev/null and b/client/tests/golden/visual/minimap_stance.png differ diff --git a/client/tests/golden/visual/npc_in_fog.png b/client/tests/golden/visual/npc_in_fog.png new file mode 100644 index 000000000..3754bfc5e Binary files /dev/null and b/client/tests/golden/visual/npc_in_fog.png differ