diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/camera/fog/FogManager.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/camera/fog/FogManager.kt index 1b1c3fd948..55b50fa099 100644 --- a/src/main/java/de/bixilon/minosoft/gui/rendering/camera/fog/FogManager.kt +++ b/src/main/java/de/bixilon/minosoft/gui/rendering/camera/fog/FogManager.kt @@ -94,13 +94,17 @@ class FogManager( val progress = delta / INTERPOLATE_DURATION.toFloat() state.start = interpolateLinear(progress, interpolation.start, options?.start ?: 0.0f) state.end = interpolateLinear(progress, interpolation.end, options?.end ?: 0.0f) - var color: RGBColor? = interpolateSine(progress, interpolation.color ?: Colors.TRANSPARENT, options?.color ?: Colors.TRANSPARENT) + + val sourceColor = interpolation.color ?: options?.color ?: Colors.TRANSPARENT + val targetColor = options?.color ?: RGBColor(sourceColor.red, sourceColor.green, sourceColor.blue, 0x00) + var color: RGBColor? = interpolateSine(progress, sourceColor, targetColor) if (color == Colors.TRANSPARENT) { color = null } state.color = color if (progress >= 1.0f) { interpolation.change = 1L // this avoid further interpolations with the same data + interpolation.color = options?.color } state.revision++ diff --git a/src/main/resources/assets/minosoft/rendering/shader/includes/fog.glsl b/src/main/resources/assets/minosoft/rendering/shader/includes/fog.glsl index ea46c6e9b2..6e88607ebc 100644 --- a/src/main/resources/assets/minosoft/rendering/shader/includes/fog.glsl +++ b/src/main/resources/assets/minosoft/rendering/shader/includes/fog.glsl @@ -60,7 +60,7 @@ void fog_mix_alpha(float alpha) { } void fog_mix_color(float alpha) { - foutColor.rgb = mix(uFogColor.rgb, foutColor.rgb, foutColor.a * alpha); + foutColor.rgb = mix(uFogColor.rgb, foutColor.rgb, foutColor.a * alpha);// uFogColor.a * foutColor.a = 1.0f; }