Merge reflections on horizontal border

This commit is contained in:
Joshua Barretto 2022-12-30 16:30:29 +00:00
parent 78fbaa82b3
commit 9098abc3d2

View File

@ -186,7 +186,7 @@ void main() {
float new_dist = distance(new_wpos, cam_pos.xyz);
float merge = min(
// Off-screen merge factor
clamp((1.0 - abs(new_uv.y - 0.5) * 2) * 3.0, 0, 1),
clamp((1.0 - max(abs(new_uv.y - 0.5), abs(new_uv.x - 0.5)) * 2) * 3.0, 0, 1),
// Depth merge factor
clamp((new_dist - dist * 0.5) / (dist * 0.5), 0.0, 1.0)
);