Taper fog density at edge with a small gradient #1889
+125
−65
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Introduce the
fogGradientshader keyword as suggested in #1795 (comment), which can be used to configure a gradient for fog density that tapers to 0 at the edge of the fog. The density of the fog is scaled by a factor of1 - exp(-k * t)where t is the distance under the fog plane and k a configurable constant.fogGradient expFalloff <dist>configures the exponential falloff such that the density is at 50% of the maximum at<dist>qu from the fog plane.fogGradient constdoes the same thing as the current default - no gradient; hard-edged fog.Change the default to
fogGradient expFalloff 5instead of the current constant density. Before/after comparisons: