fix cloud tearing

This commit is contained in:
Isse 2023-04-19 22:41:44 +02:00
parent 1442dd29f1
commit 1494d93fc8

View File

@ -58,12 +58,7 @@ vec3 wpos_at(vec2 uv) {
vec4 clip_space = vec4((uv * 2.0 - 1.0) * vec2(1, -1), buf_depth, 1.0);
vec4 view_space = all_mat_inv * clip_space;
view_space /= view_space.w;
if (buf_depth == 0.0) {
vec3 direction = normalize(view_space.xyz);
return direction.xyz * 524288.0625;
} else {
return view_space.xyz;
}
return view_space.xyz;
}
float depth_at(vec2 uv) {