is there a better fog than Godot's fog

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By umma

I have a 3d scene with Godots’s fog. The problem is, the fog is only visible when you look at the map and you can clearly see where it stops. Is there a way to let the fog be visible in the sky?

here is a picture:

:bust_in_silhouette: Reply From: Calinou

Fog does not affect the sky in Godot 3.x, but it will in Godot 4.0.

As a workaround, make sure the sky is colored in a way similar to the fog. The best way to ensure this is to use a plain color for the sky (instead of a PanoramaSky), and make the sky color be the exact same color as the fog.

Alternatively, you can edit your panorama sky image to add a “fog dome” (a linear gradient that stretches across the panorama) with a color similar to the fog. The same thing can be achieved in a ProceduralSky by changing the colors of its various ground and horizon properties.

:bust_in_silhouette: Reply From: DaddyMonster

I’ll preface this by saying that you should probably do as Calinou suggested. But, I have a glass of red, a few ideas and I’ll keep it short.

First approach is just a spatial material and a proximity fade. The big drawback is that it doesn’t work when you’re inside it but you can easily code if you manage distance cleverly in the local frame. Would be fiddly but could work. Docs:

This can be done in shader code. Tbh, an explanation would make this comment about as long as War & Peace. You’d have to have decent experience with shader coding. If you decide on this option, let me know and we can discuss.

I will try calinou’s method, I plan to do shaders in the future, thanks for helping.

umma | 2022-01-20 02:26

:bust_in_silhouette: Reply From: reapersremorse

I use the Volumetrics-Plugin (its on the assetlib)

it allows you to make shapes of fox and such, its really nice for fox effects.

demo of the plugin

Volumetric fog (especially with this plugin) is very expensive. I wouldn’t recommend using it if you just need fog to match the background.

Calinou | 2022-01-20 19:17