mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'isse/shader-fixes' into 'master'
Two small shader fixes See merge request veloren/veloren!3889
This commit is contained in:
commit
77785faeec
@ -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 + cam_pos.xyz;
|
||||
} else {
|
||||
return view_space.xyz;
|
||||
}
|
||||
return view_space.xyz;
|
||||
}
|
||||
|
||||
float depth_at(vec2 uv) {
|
||||
|
@ -18,7 +18,7 @@ void apply_point_glow_light(Light L, vec3 wpos, vec3 dir, float max_dist, inout
|
||||
#if (CLOUD_MODE >= CLOUD_MODE_HIGH)
|
||||
vec3 _unused;
|
||||
float unused2;
|
||||
float spread = 1.0 / (1.0 + sqrt(cloud_at(nearest, 0.0, _unused, unused2).z) * 0.01);
|
||||
float spread = 1.0 / (1.0 + sqrt(max(cloud_at(nearest, 0.0, _unused, unused2).z, 0.0)) * 0.01);
|
||||
#else
|
||||
const float spread = 1.0;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user