mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-06-22 00:37:35 +08:00
fix cloud horizon line when sky ground is off
This commit is contained in:
@ -28,6 +28,7 @@ uniform vec3 sunVec;
|
||||
uniform float sunElevation;
|
||||
|
||||
// uniform float far;
|
||||
uniform float near;
|
||||
uniform float dhFarPlane;
|
||||
uniform float dhNearPlane;
|
||||
|
||||
@ -126,7 +127,9 @@ float linearizeDepthFast(const in float depth, const in float near, const in flo
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
float invLinZ (float lindepth){
|
||||
return -((2.0*near/lindepth)-far-near)/(far-near);
|
||||
}
|
||||
#ifdef OVERWORLD_SHADER
|
||||
const bool shadowHardwareFiltering = true;
|
||||
uniform sampler2DShadow shadow;
|
||||
|
@ -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;
|
||||
|
@ -35,6 +35,7 @@ uniform float sunElevation;
|
||||
// uniform float far;
|
||||
uniform float dhFarPlane;
|
||||
uniform float dhNearPlane;
|
||||
uniform float near;
|
||||
|
||||
uniform int frameCounter;
|
||||
uniform float frameTimeCounter;
|
||||
@ -64,7 +65,7 @@ uniform float caveDetection;
|
||||
#include "/lib/DistantHorizons_projections.glsl"
|
||||
|
||||
float DH_ld(float dist) {
|
||||
return (2.0 * dhNearPlane) / (dhFarPlane + dhNearPlane - dist * (dhFarPlane - dhNearPlane));
|
||||
return (2.0 * near) / (dhFarPlane + dhNearPlane - dist * (dhFarPlane - dhNearPlane));
|
||||
}
|
||||
float DH_inv_ld (float lindepth){
|
||||
return -((2.0*dhNearPlane/lindepth)-dhFarPlane-dhNearPlane)/(dhFarPlane-dhNearPlane);
|
||||
|
Reference in New Issue
Block a user