re-do border fog. make the sunlight get absorbed by the sky more (it gets more colorful). clean up the fog with clouds function

This commit is contained in:
Xonk
2023-12-27 15:04:36 -05:00
parent 2d64880893
commit 3d58394509
7 changed files with 62 additions and 88 deletions

View File

@ -119,26 +119,19 @@ void main() {
////////////////////////////////////////
vec2 planetSphere = vec2(0.0);
vec3 sky = vec3(0.0);
vec3 skyAbsorb = vec3(0.0);
float sunVis = clamp(sunElevation,0.0,0.05)/0.05*clamp(sunElevation,0.0,0.05)/0.05;
float moonVis = clamp(-sunElevation,0.0,0.05)/0.05*clamp(-sunElevation,0.0,0.05)/0.05;
// zenithColor = calculateAtmosphere(vec3(0.0), vec3(0.0,1.0,0.0), vec3(0.0,1.0,0.0), sunVec, -sunVec, planetSphere, skyAbsorb, 25,tempOffsets.x);
skyAbsorb = vec3(0.0);
vec3 absorb = vec3(0.0);
vec3 skyAbsorb = vec3(0.0);
sunColor = calculateAtmosphere(vec3(0.0), sunVec, vec3(0.0,1.0,0.0), sunVec, -sunVec, planetSphere, skyAbsorb, 25,0.0);
sunColor = sunColorBase/4000. * skyAbsorb;
skyAbsorb = vec3(1.0);
moonColor = calculateAtmosphere(vec3(0.0), -sunVec, vec3(0.0,1.0,0.0), sunVec, -sunVec, planetSphere, skyAbsorb, 25,0.5);
sunColor = sunColorBase/4000. * (skyAbsorb);
// skyAbsorb = vec3(1.0);
// moonColor = calculateAtmosphere(vec3(0.0), -sunVec, vec3(0.0,1.0,0.0), sunVec, -sunVec, planetSphere, skyAbsorb, 25,0.5);
moonColor = moonColorBase/4000.0;
lightSourceColor = sunVis >= 1e-5 ? sunColor * sunVis : moonColor * moonVis;
// WsunVec = ( float(sunElevation > 1e-5)*2-1. )*normalize(mat3(gbufferModelViewInverse) * sunPosition);
#endif
//////////////////////////////