mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-01-03 16:13:30 +08:00
temporary solution to the "render clouds as fog" cloud plane curvature seperation.
This commit is contained in:
parent
f47e212d86
commit
24f546b8fa
@ -95,7 +95,7 @@ vec3 sky_transmittance(vec3 position, vec3 direction, const float steps) {
|
||||
vec3 calculateAtmosphere(vec3 background, vec3 viewVector, vec3 upVector, vec3 sunVector, vec3 moonVector, out vec2 pid, out vec3 transmittance, const int iSteps, float noise) {
|
||||
const int jSteps = 4;
|
||||
|
||||
float planetGround = exp(-100 * pow(max(-viewVector.y*5,0.0),2)); // darken the ground in the sky.
|
||||
float planetGround = exp(-100 * pow(max(-viewVector.y*5 +0.2,0.0),2)); // darken the ground in the sky.
|
||||
float GroundDarkening = max(planetGround * 0.7+0.3,clamp(sunVector.y*2.0,0.0,1.0));
|
||||
|
||||
vec3 viewPos = (sky_planetRadius + eyeAltitude) * upVector;
|
||||
|
@ -240,10 +240,10 @@ vec4 renderClouds(
|
||||
maxIT_clouds = int(clamp(maxIT_clouds / sqrt(exp2(viewPos.y)),0.0, maxIT));
|
||||
maxIT_clouds = 30;
|
||||
|
||||
|
||||
vec3 dV_view = normalize(viewPos.xyz);
|
||||
|
||||
dV_view.y += 0.05 * heightRelativeToClouds;
|
||||
|
||||
// this is the cloud curvature.
|
||||
// dV_view.y += 0.05 * heightRelativeToClouds;
|
||||
|
||||
dV_view *= 300/abs(dV_view.y)/maxIT_clouds;
|
||||
|
||||
@ -270,9 +270,9 @@ vec4 renderClouds(
|
||||
float atmosphere = exp(abs(forg.y) * -5.0);
|
||||
vec3 scatter = exp(-10000.0 * rC * atmosphere) * distantfog;
|
||||
|
||||
directScattering *= scatter;
|
||||
directMultiScattering *= scatter;
|
||||
sunIndirectScattering *= scatter;
|
||||
directScattering *= distantfog;
|
||||
directMultiScattering *= distantfog;
|
||||
sunIndirectScattering *= distantfog;
|
||||
|
||||
#ifdef Cumulus
|
||||
for(int i = 0; i < maxIT_clouds; i++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user