mirror of
https://github.com/Merlin1809/Eclipse-Shader.git
synced 2026-10-10 04:53:07 +08:00
Slightly improve performance, reduce cloud light leaking around edges
This commit is contained in:
@@ -487,7 +487,7 @@ vec2 SSRT_Shadows(vec3 viewPos, bool depthCheck, vec3 lightDir, float noise, boo
|
||||
float dist = abs(linearSampledDepth - linearCurrentPos) / linearCurrentPos;
|
||||
|
||||
// if (dist < 0.035){
|
||||
if (dist < 0.035/(1.0+linearCurrentPos) && (sampleDepth < newPos.z )) shadows = 0.0;
|
||||
if (dist < 0.035/(1.0+linearCurrentPos)) shadows = 0.0;
|
||||
|
||||
// if (dist < 0.3/(1.0+linearCurrentPos)) SSS += distanceScale2;
|
||||
if (dist < SSSdistanceScale) SSS += distanceScale2;
|
||||
|
||||
@@ -504,17 +504,19 @@ void main() {
|
||||
vec2 r2_sequence = R2_samples(seed).xy;
|
||||
vec2 BN = fract(r2_sequence + bnoise);
|
||||
|
||||
// vec2 tc = floor(gl_FragCoord.xy)/VL_RENDER_RESOLUTION*texelSize + texelSize*0.5;
|
||||
vec2 tc = (gl_FragCoord.xy - 0.5)/VL_RENDER_RESOLUTION*texelSize;
|
||||
vec2 tc = floor(gl_FragCoord.xy)/VL_RENDER_RESOLUTION*texelSize + texelSize*0.5;
|
||||
// vec2 tc = (gl_FragCoord.xy - 0.5)/VL_RENDER_RESOLUTION*texelSize;
|
||||
|
||||
bool iswater = texture2D(colortex7,tc).a > 0.99;
|
||||
// bool iswater = texture2D(colortex7,tc).a > 0.99;
|
||||
|
||||
float depth = texelFetch2D(depthtex0, ivec2(tc/texelSize),0).x;
|
||||
ivec2 texcoord = ivec2(tc/texelSize);
|
||||
|
||||
float depth = texelFetch2D(depthtex0, texcoord,0).x;
|
||||
|
||||
float z0 = depth < 0.56 ? convertHandDepth(depth) : depth;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
float DH_z0 = texelFetch2D(dhDepthTex, ivec2(tc/texelSize),0).x;
|
||||
float DH_z0 = texelFetch2D(dhDepthTex, texcoord,0).x;
|
||||
#else
|
||||
float DH_z0 = 0.0;
|
||||
#endif
|
||||
|
||||
@@ -278,7 +278,7 @@ void main() {
|
||||
|
||||
|
||||
bool iswater = alpha > 0.99;
|
||||
bool isLightning = alpha < 0.51 || alpha > 0.49;
|
||||
bool isLightning = alpha < 0.51 && alpha > 0.49;
|
||||
//////////////////////////////////////////////////////////
|
||||
///////////////// BEHIND OF TRANSLUCENTS /////////////////
|
||||
//////////////////////////////////////////////////////////
|
||||
@@ -288,19 +288,21 @@ void main() {
|
||||
float noise_1 = R2_dither();
|
||||
float noise_2 = blueNoise();
|
||||
|
||||
float z0 = texelFetch2D(depthtex0, ivec2((floor(gl_FragCoord.xy - 0.5)/VL_RENDER_RESOLUTION*texelSize)/texelSize), 0 ).x;
|
||||
ivec2 texcoord = ivec2(tc/texelSize);
|
||||
|
||||
float z0 = texelFetch2D(depthtex0, texcoord, 0 ).x;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
float DH_z0 = texelFetch2D(dhDepthTex, ivec2((floor(gl_FragCoord.xy - 0.5)/VL_RENDER_RESOLUTION*texelSize)/texelSize), 0 ).x;//texture2D(dhDepthTex,tc).x;
|
||||
float DH_z0 = texelFetch2D(dhDepthTex, texcoord, 0 ).x;//texture2D(dhDepthTex,tc).x;
|
||||
#else
|
||||
float DH_z0 = 0.0;
|
||||
#endif
|
||||
|
||||
float z = texelFetch2D(depthtex1, ivec2((floor(gl_FragCoord.xy - 0.5)/VL_RENDER_RESOLUTION*texelSize)/texelSize), 0 ).x;
|
||||
float z = texelFetch2D(depthtex1, texcoord, 0 ).x;
|
||||
|
||||
#ifdef DISTANT_HORIZONS
|
||||
// float DH_z = texture2D(dhDepthTex1,tc).x;
|
||||
float DH_z = texelFetch2D(dhDepthTex1, ivec2((floor(gl_FragCoord.xy - 0.5)/VL_RENDER_RESOLUTION*texelSize)/texelSize), 0 ).x;//texture2D(dhDepthTex,tc).x;
|
||||
float DH_z = texelFetch2D(dhDepthTex1, texcoord, 0 ).x;//texture2D(dhDepthTex,tc).x;
|
||||
#else
|
||||
float DH_z = 0.0;
|
||||
#endif
|
||||
|
||||
@@ -124,7 +124,7 @@ void main() {
|
||||
|
||||
// Pressure damping to prevent it from building up forever.
|
||||
float distFade = smoothstep(0.49*resolution.x, 0.4*resolution.x, dist);
|
||||
pressure *= 0.992 * distFade;
|
||||
pressure *= 0.985 * distFade;
|
||||
pVel *= distFade;
|
||||
|
||||
if (onWaterSurface) {
|
||||
|
||||
@@ -111,7 +111,7 @@ void main() {
|
||||
|
||||
// Pressure damping to prevent it from building up forever.
|
||||
float distFade = smoothstep(0.49*resolution.x, 0.4*resolution.x, dist);
|
||||
pressure *= 0.992 * distFade;
|
||||
pressure *= 0.985 * distFade;
|
||||
pVel *= distFade;
|
||||
|
||||
if (onWaterSurface) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
option.SHADER_VERSION_LABEL = §dECLIPSE§r - A Bliss Edit
|
||||
prefix.SHADER_VERSION_LABEL = V
|
||||
value.SHADER_VERSION_LABEL.482 = 2.1.1
|
||||
value.SHADER_VERSION_LABEL.482 = 2.1.2
|
||||
|
||||
# if you're here to translate, this is not a joke, these do what they say
|
||||
profile.POTATO=§4Potato
|
||||
|
||||
Reference in New Issue
Block a user