fix cloud horizon line when sky ground is off

This commit is contained in:
Xonk
2024-06-28 16:31:31 -04:00
parent dd35c0cb9d
commit 0ccec1e817
5 changed files with 20 additions and 11 deletions

View File

@ -84,6 +84,7 @@ vec3 toScreenSpace(vec3 p) {
return viewPos.xyz / viewPos.w;
}
uniform float near;
uniform float dhFarPlane;
uniform float dhNearPlane;
@ -117,6 +118,9 @@ float DH_inv_ld (float lindepth){
float linearizeDepthFast(const in float depth, const in float near, const in float far) {
return (near * far) / (depth * (near - far) + far);
}
float invLinZ (float lindepth){
return -((2.0*near/lindepth)-far-near)/(far-near);
}
#ifdef OVERWORLD_SHADER
// uniform sampler2D colortex12;