make all cloud, fog, and weather related effects transition slowly over time.

This commit is contained in:
Xonk
2026-06-27 21:49:26 -04:00
parent ce4b4be2c0
commit d6ffeda2fc
+16 -9
View File
@@ -203,12 +203,21 @@ float HG_phase(float x, float g){
return (gg * -0.25 + 0.25) * pow(-2.0 * (g * x) + (gg + 1.0), -1.5) / 3.14;
}
vec3 doPixelTimer(in vec3 targetValue, in vec3 prevFrameValue){
vec3 polarity = floor(clamp((targetValue - prevFrameValue)*65000.0,-1.0,1.0));
prevFrameValue += polarity * (frameTime/(15.0 * (1.0/clamp(targetValue,0.1,1.0))));
return prevFrameValue;
}
void main() {
/* RENDERTARGETS:4 */
gl_FragData[0] = vec4(0.0);
//Temporally accumulate sky and light values
vec3 frameHistory = texelFetch(colortex4,ivec2(gl_FragCoord.xy),0).rgb;
float mixhistory = 0.06;
@@ -220,9 +229,11 @@ float mixhistory = 0.06;
// the idea is to store the 8 values, coverage + density of 3 cloud layers and 2 fog density values.
if (gl_FragCoord.x > 1 && gl_FragCoord.x < 4 && gl_FragCoord.y > 1 && gl_FragCoord.y < 4){
mixhistory = 10.0 * frameTime;
gl_FragData[0].rgb = writeSceneControllerParameters(gl_FragCoord.xy, parameters.smallCumulus, parameters.largeCumulus, parameters.altostratus, parameters.fog, parameters.localFog, parameters.localFogColor);
mixhistory = 1.0; // doing custom interpolation on these pixels. turn blending off
vec3 targetParameterValues = writeSceneControllerParameters(gl_FragCoord.xy, parameters.smallCumulus, parameters.largeCumulus, parameters.altostratus, parameters.fog, parameters.localFog, parameters.localFogColor);
gl_FragData[0].rgb = doPixelTimer(targetParameterValues, frameHistory/150.0);
}
///////////////////////////////
@@ -447,14 +458,10 @@ if (gl_FragCoord.x > 18.+257. && gl_FragCoord.y > 1. && gl_FragCoord.x < 18+257+
}
#endif
//
//Temporally accumulate sky and light values
vec3 frameHistory = texelFetch(colortex4,ivec2(gl_FragCoord.xy),0).rgb;
vec3 currentFrame = gl_FragData[0].rgb*150.;
vec3 currentFrame = gl_FragData[0].rgb*150.0;
gl_FragData[0].rgb = clamp(mix(frameHistory, currentFrame, clamp(mixhistory,0.0,1.0)),0.0,65000.);
gl_FragData[0].rgb = clamp(mix(frameHistory, currentFrame, clamp(mixhistory,0.0,1.0)),0.0,65000.0);
//Exposure values
if (gl_FragCoord.x > 10. && gl_FragCoord.x < 11. && gl_FragCoord.y > 19.+18. && gl_FragCoord.y < 19.+18.+1 )