mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-06-22 00:37:35 +08:00
FIX DOF and exposure. tweak fog phase. make cloud shadows not go crazy at low sun angles. adjust bloomy fog default value.
This commit is contained in:
@ -1,7 +1,4 @@
|
||||
float phaseRayleigh(float cosTheta) {
|
||||
const vec2 mul_add = vec2(0.1, 0.28) /acos(-1.0);
|
||||
return cosTheta * mul_add.x + mul_add.y; // optimized version from [Elek09], divided by 4 pi for energy conservation
|
||||
}
|
||||
|
||||
|
||||
uniform float noPuddleAreas;
|
||||
float densityAtPosFog(in vec3 pos){
|
||||
@ -48,7 +45,22 @@ float cloudVol(in vec3 pos){
|
||||
return CloudyFog + UniformFog + RainFog;
|
||||
}
|
||||
|
||||
uniform bool inSpecialBiome;
|
||||
float phaseRayleigh(float cosTheta) {
|
||||
const vec2 mul_add = vec2(0.1, 0.28) / acos(-1.0);
|
||||
return cosTheta * mul_add.x + mul_add.y; // optimized version from [Elek09], divided by 4 pi for energy conservation
|
||||
}
|
||||
float fogPhase(float lightPoint){
|
||||
float linear = 1.0 - clamp(lightPoint*0.5+0.5,0.0,1.0);
|
||||
float linear2 = 1.0 - clamp(lightPoint,0.0,1.0);
|
||||
|
||||
float exponential = exp2(pow(linear,0.3) * -15.0 ) * 1.5;
|
||||
exponential += sqrt(exp2(sqrt(linear) * -12.5));
|
||||
|
||||
return exponential;
|
||||
}
|
||||
|
||||
|
||||
// uniform bool inSpecialBiome;
|
||||
vec4 GetVolumetricFog(
|
||||
vec3 viewPosition,
|
||||
float dither,
|
||||
@ -90,7 +102,8 @@ vec4 GetVolumetricFog(
|
||||
float dL = length(dVWorld);
|
||||
|
||||
//Mie phase + somewhat simulates multiple scattering (Horizon zero down cloud approx)
|
||||
float mie = phaseg(SdotV,0.7)*5.0 + 0.1;
|
||||
// float mie = phaseg(SdotV,0.7)*5.0 + 0.1;
|
||||
float mie = fogPhase(SdotV) * 5.0;
|
||||
float rayL = phaseRayleigh(SdotV);
|
||||
|
||||
vec3 rC = vec3(fog_coefficientRayleighR*1e-6, fog_coefficientRayleighG*1e-5, fog_coefficientRayleighB*1e-5);
|
||||
@ -178,7 +191,8 @@ vec4 GetVolumetricFog(
|
||||
vec3 AtmosphericFog = skyCol0 * (rL*3.0 + m);// + (LightSourceColor * sh) * (rayL*rL*3.0 + m*mie);
|
||||
|
||||
vec3 vL0 = (AtmosphericFog + AmbientLight + DirectLight + Lightning) * lightleakfix;
|
||||
// vec3 vL0 = DirectLight;
|
||||
|
||||
// vL0 = DirectLight;
|
||||
|
||||
// #if defined Cave_fog && defined TEST
|
||||
// vL0 += cavefogCol;
|
||||
|
@ -164,7 +164,7 @@ const float sunPathRotation = -35; //[-90 -89 -88 -87 -86 -85 -84 -83 -82 -81 -8
|
||||
|
||||
#define RainFog_amount 3 // [0 1 2 3 4 5 6 7 8 9 10 15 20 25]
|
||||
|
||||
#define BLOOMY_FOG 2.0 // [0.0 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0 3.0 4.0 6.0 10.0 15.0 20.0]
|
||||
#define BLOOMY_FOG 1.0 // [0.0 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0 3.0 4.0 6.0 10.0 15.0 20.0]
|
||||
#define BLOOM_STRENGTH 4.0 // [0.0 0.25 0.5 0.75 1.0 1.25 1.5 1.75 2.0 3.0 4.0]
|
||||
|
||||
#define Cave_fog
|
||||
|
@ -380,12 +380,13 @@ float GetCloudShadow(vec3 feetPlayerPos){
|
||||
|
||||
// assume a flat layer of cloud, and stretch the sampled density along the sunvector, starting from some vertical layer in the cloud.
|
||||
#ifdef Cumulus
|
||||
vec3 lowShadowStart = playerPos + WsunVec/abs(WsunVec.y) * max((MaxCumulusHeight - 70) - playerPos.y,0.0) ;
|
||||
|
||||
vec3 lowShadowStart = playerPos + (WsunVec / max(abs(WsunVec.y),0.2)) * max((MaxCumulusHeight - 70) - playerPos.y,0.0) ;
|
||||
shadow += GetCumulusDensity(lowShadowStart, 1)*Cumulus_density;
|
||||
#endif
|
||||
|
||||
#ifdef Altostratus
|
||||
vec3 highShadowStart = playerPos + WsunVec/abs(WsunVec.y) * max(AltostratusHeight - playerPos.y,0.0);
|
||||
vec3 highShadowStart = playerPos + (WsunVec / max(abs(WsunVec.y),0.2)) * max(AltostratusHeight - playerPos.y,0.0);
|
||||
shadow += GetAltostratusDensity(highShadowStart) * 0.5;
|
||||
#endif
|
||||
|
||||
@ -403,15 +404,14 @@ float GetCloudShadow(vec3 feetPlayerPos){
|
||||
float GetCloudShadow_VLFOG(vec3 WorldPos, vec3 WorldSpace_sunVec){
|
||||
#ifdef CLOUDS_SHADOWS
|
||||
float shadow = 0.0;
|
||||
|
||||
// assume a flat layer of cloud, and stretch the sampled density along the sunvector, starting from some vertical layer in the cloud.
|
||||
#ifdef Cumulus
|
||||
vec3 lowShadowStart = WorldPos + WorldSpace_sunVec/abs(WorldSpace_sunVec.y) * max((MaxCumulusHeight - 60) - WorldPos.y,0.0) ;
|
||||
shadow += max(GetCumulusDensity(lowShadowStart, 0) , 0.0)*Cumulus_density;
|
||||
vec3 lowShadowStart = WorldPos + (WorldSpace_sunVec / max(abs(WorldSpace_sunVec.y),0.2)) * max((MaxCumulusHeight - 60) - WorldPos.y,0.0) ;
|
||||
shadow += max(GetCumulusDensity(lowShadowStart, 0), 0.0)*Cumulus_density;
|
||||
#endif
|
||||
|
||||
#ifdef Altostratus
|
||||
vec3 highShadowStart = WorldPos + WorldSpace_sunVec/abs(WorldSpace_sunVec.y) * max(AltostratusHeight - WorldPos.y,0.0);
|
||||
vec3 highShadowStart = WorldPos + (WorldSpace_sunVec / max(abs(WorldSpace_sunVec.y),0.2)) * max(AltostratusHeight - WorldPos.y,0.0);
|
||||
shadow += GetAltostratusDensity(highShadowStart)*0.5;
|
||||
#endif
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
|
||||
|
||||
float getWaterHeightmap(vec2 posxz, float waveM, float waveZ, float iswater) { // water waves
|
||||
vec2 movement = vec2(frameTimeCounter*0.05);
|
||||
vec2 pos = posxz ;
|
||||
@ -27,6 +29,8 @@ float getWaterHeightmap(vec2 posxz, float waveM, float waveZ, float iswater) { /
|
||||
}
|
||||
return ((3.0-caustic) * weightSum / (30.0 * 3.0));
|
||||
}
|
||||
|
||||
|
||||
// float getWaterHeightmap(vec2 posxz, float waveM, float waveZ, float iswater) { // water waves
|
||||
// vec2 movement = vec2(frameTimeCounter*0.025);
|
||||
// vec2 pos = posxz ;
|
||||
|
Reference in New Issue
Block a user