Skip to content

Commit

Permalink
Merge pull request #6305 from Calinou/volumetric-fog-use-for-lighting
Browse files Browse the repository at this point in the history
Document using volumetric fog as a volumetric lighting solution
  • Loading branch information
mhilbrunner authored Oct 14, 2022
2 parents b098da2 + 93aca65 commit 742b2b1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
Binary file added tutorials/3d/img/volumetric_fog_comparison.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tutorials/3d/img/volumetric_fog_lighting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 24 additions & 1 deletion tutorials/3d/volumetric_fog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ On this page, you'll learn:
The Godot demo projects repository contains a
`volumetric fog demo <https://github.com/godotengine/godot-demo-projects/tree/4.0-dev/3d/volumetric_fog>`__.

Here is a comparison between traditional fog (which does not interact with lighting)
and volumetric fog, which is able to interact with lighting:

.. image:: img/volumetric_fog_comparison.png

Volumetric fog properties
-------------------------

Expand Down Expand Up @@ -94,7 +99,25 @@ shadows on a light will also make those shadows visible on volumetric fog.

If fog light interaction is not desired for artistic reasons, this can be
globally disabled by setting **Volumetric Fog > Albedo** to a pure black color
in the Environment resource.
in the Environment resource. Fog light interaction can also be disabled for
specific lights by setting its **Volumetric Fog Energy** to ``0``. Doing so will
also improve performance slightly by excluding the light from volumetric fog
computations.

Using volumetric fog as a volumetric lighting solution
------------------------------------------------------

While not physically accurate, it is possible to tune volumetric fog's settings
to work as volumetric *lighting* solution. This means that unlit parts of the
environment will not be darkened anymore by fog, but light will still be able to
make fog brighter in specific areas.

This can be done by setting volumetric fog density to the lowest permitted value
*greater than zero* (``0.0001``), then increasing the **Volumetric Fog Energy**
property on lights to much higher values than the default to compensate. Values
between ``10000`` and ``100000`` usually work well for this.

.. image:: img/volumetric_fog_lighting.png

Balancing performance and quality
---------------------------------
Expand Down

0 comments on commit 742b2b1

Please sign in to comment.