bevy/assets/models
Marco Buono 1a96d820fd Add Distance and Atmospheric Fog support (#6412)
<img width="1392" alt="image" src="https://user-images.githubusercontent.com/418473/203873533-44c029af-13b7-4740-8ea3-af96bd5867c9.png">
<img width="1392" alt="image" src="https://user-images.githubusercontent.com/418473/203873549-36be7a23-b341-42a2-8a9f-ceea8ac7a2b8.png">


# Objective

- Add support for the “classic” distance fog effect, as well as a more advanced atmospheric fog effect.

## Solution

This PR:

- Introduces a new `FogSettings` component that controls distance fog per-camera. 
- Adds support for three widely used “traditional” fog falloff modes: `Linear`, `Exponential` and `ExponentialSquared`, as well as a more advanced `Atmospheric` fog;
- Adds support for directional light influence over fog color;
- Extracts fog via `ExtractComponent`, then uses a prepare system that sets up a new dynamic uniform struct (`Fog`), similar to other mesh view types;
- Renders fog in PBR material shader, as a final adjustment to the `output_color`, after PBR is computed (but before tone mapping);
- Adds a new `StandardMaterial` flag to enable fog; (`fog_enabled`)
- Adds convenience methods for easier artistic control when creating non-linear fog types;
- Adds documentation around fog.

---

## Changelog

### Added

- Added support for distance-based fog effects for PBR materials, controllable per-camera via the new `FogSettings` component;
- Added `FogFalloff` enum for selecting between three widely used “traditional” fog falloff modes: `Linear`, `Exponential` and `ExponentialSquared`, as well as a more advanced `Atmospheric` fog;
2023-01-29 15:28:56 +00:00
..
AlienCake add an example using UI & states to create a game menu (#2960) 2022-01-14 19:09:42 +00:00
animated animation player (#4375) 2022-04-02 22:36:02 +00:00
cube Hot asset reloading 2020-05-16 20:18:30 -07:00
FlightHelmet Asset system rework and GLTF scene loading (#693) 2020-10-18 13:48:15 -07:00
monkey Asset system rework and GLTF scene loading (#693) 2020-10-18 13:48:15 -07:00
SimpleSkin Mesh Skinning. Attempt #3 (#4238) 2022-03-29 18:31:13 +00:00
sphere Hot asset reloading 2020-05-16 20:18:30 -07:00
terrain Add Distance and Atmospheric Fog support (#6412) 2023-01-29 15:28:56 +00:00
Box0.bin organize examples and add ecs guide 2020-05-01 13:12:47 -07:00