mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-06-21 00:07:50 +08:00
tweak shadow bias to handle low resolutions better
This commit is contained in:
parent
56ad3b059d
commit
60e807cfce
@ -1,4 +1,5 @@
|
|||||||
option.SHADER_VERSION_LABEL = Bliss In-Dev Commit Number
|
option.SHADER_VERSION_LABEL = Bliss In-Dev Version
|
||||||
|
prefix.SHADER_VERSION_LABEL = COMMIT #
|
||||||
|
|
||||||
# if you're here to translate, this is a joke, these don't do what they say
|
# if you're here to translate, this is a joke, these don't do what they say
|
||||||
profile.QUALITY=Quality
|
profile.QUALITY=Quality
|
||||||
|
@ -7,15 +7,15 @@ void GriAndEminShadowFix(
|
|||||||
float VanillaAO,
|
float VanillaAO,
|
||||||
float SkyLightmap
|
float SkyLightmap
|
||||||
){
|
){
|
||||||
// #ifdef DISTANT_HORIZONS_SHADOWMAP
|
|
||||||
// float minimumValue = 0.3;
|
|
||||||
// #else
|
|
||||||
float minimumValue = 0.05;
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
float DistanceOffset = max(length(WorldPos) * 0.005, minimumValue);
|
float MinimumValue = 0.05;
|
||||||
|
|
||||||
vec3 Bias = FlatNormal * DistanceOffset;
|
// give a tiny boost to the distance mulitplier when shadowmap resolution is below 2048.0
|
||||||
|
float ResMultiplier = 1.0 + (shadowDistance/8.0)*(1.0 - min(shadowMapResolution,2048.0)/2048.0)*0.3;
|
||||||
|
|
||||||
|
float DistanceMultiplier = max(1.0 - max(1.0 - length(WorldPos) / shadowDistance, 0.0), MinimumValue) * ResMultiplier;
|
||||||
|
|
||||||
|
vec3 Bias = FlatNormal * DistanceMultiplier;
|
||||||
|
|
||||||
// stop lightleaking by zooming up, centered on blocks
|
// stop lightleaking by zooming up, centered on blocks
|
||||||
vec2 scale = vec2(0.5); scale.y *= 0.5;
|
vec2 scale = vec2(0.5); scale.y *= 0.5;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#define SHADER_VERSION_LABEL 439 // [439]
|
#define SHADER_VERSION_LABEL 458 // [439]
|
||||||
|
|
||||||
#define saturate(x) clamp(x,0.0,1.0)
|
#define saturate(x) clamp(x,0.0,1.0)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user