What is the exact formula for non-volumetric fog in godot?

Godot Version

4.2.2

Question

In the description for the fog density parameter, it says it uses some kind of exponential function to calculate the fog, but what exactly is that? I want to replicate the standard godot fog in a shader, so i need an exact formula that determines the fog opacity based on the distance from the camera and the density parameter.

nevermind i managed to find the formula, it’s 1.0 - 1.0 / exp(dist * density)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.