Explanation for the 'classic' fog example (#19196)
This is a bit of a test case in writing the [explanation](https://bevyengine.org/learn/contribute/helping-out/explaining-examples/) for an example whose subject (`DistanceFog` as a component on cameras) is the focus, but isn't that complicated either. Not certain if this could be an exception or something more common. Putting the controls below the explanation, as they're more of a fall-back for the on-screen info (also that's where they were before).
This commit is contained in:
parent
efd17f133d
commit
d7594a4f3c
@ -1,5 +1,12 @@
|
||||
//! This interactive example shows how to use distance fog,
|
||||
//! and allows playing around with different fog settings.
|
||||
//! Distance-based fog visual effects are used in many games to give a soft falloff of visibility to the player for performance and/or visual design reasons. The further away something in a 3D world is from the camera, the more it's mixed or completely overwritten by a given color.
|
||||
//!
|
||||
//! In Bevy we can add the [`DistanceFog`] component to the same entity as our [`Camera3d`] to apply a distance fog effect. It has fields for color, directional light parameters, and how the fog falls off over distance. And that's it! The distance fog is now applied to the camera.
|
||||
//!
|
||||
//! The [`FogFalloff`] field controls most of the behavior of the fog through different descriptions of fog "curves". I.e. [`FogFalloff::Linear`] lets us define a start and end distance where up until the start distance none of the fog color is mixed in and by the end distance the fog color is as mixed in as it can be. [`FogFalloff::Exponential`] on the other hand uses an exponential curve to drive how "visible" things are with a density value.
|
||||
//!
|
||||
//! [Atmospheric fog](https://bevyengine.org/examples/3d-rendering/atmospheric-fog/) is another fog type that uses this same method of setup, but isn't covered here as it is a kind of fog that is most often used to imply distance and size in clear weather, while the ones shown off here are much more "dense".
|
||||
//!
|
||||
//! The bulk of this example is spent building a scene that suites showing off that the fog is working as intended by creating a pyramid (a 3D structure with clear delineations), a light source, input handling to modify fog settings, and UI to show what the current fog settings are.
|
||||
//!
|
||||
//! ## Controls
|
||||
//!
|
||||
|
Loading…
Reference in New Issue
Block a user