Fog
Distance fog for a Camera3d (its fog), sharing the draw distance's fade band (Camera3d.drawDistanceFadeFraction). Off by default.
With a backdropHeight, the band of the screen from where the ground ends up to that height at the draw distance (or the horizon, if lower) is filled in color behind everything, so objects fading out fade into fog rather than the sky. Drawables with castsFogSilhouette set keep blocking the sky past the draw distance, in color, out to silhouetteReach times it: a model by its own outline (a pointed roof stays pointed, see silhouetteHulls), an image by its corners, level walls (BGE.DrawableWalls) as their real outline.
Fog fixes the draw distance: it doesn't change with the render quality level (see followsQuality).
Fields are read every frame, so they can be changed live.
Properties
enabled(boolean) — Nothing is drawn or worked out while this is falsecolor(integer) — RGB (0xRRGGBB), likeDrawable.colorbackdropHeight(float) — How high the backdrop reaches at the draw distance, in world units (0 for no backdrop). ItbackdropRegion(dynamic) — AnroRegionstretched over the backdrop, tinted withcolor(so draw it white), orsilhouetteHulls(boolean) — Outline each silhouette by its model's own points, split up its height (a tower on a nave,silhouetteReach(float) — Silhouettes reach this many times the draw distance (0 for none). 1 keeps the fog thatsilhouetteStartAlpha(float) — Fog makes up the opacity a fading object has lost, once its fade alpha drops below thissilhouetteOpacityLead(float) — How much faster a fading object's silhouette makes up the opacity it has lost: drawn atfollowsQuality(boolean) — With fog on, the draw distance stays atCamera3d.maxDrawDistanceat every render qualityqualityTransitionSeconds(float) — Seconds a draw distance change takes to ease in whilefollowsQualityis set, when longer
Example
camera.fog.enabled = true
camera.fog.color = &h1C2842
camera.fog.backdropHeight = 400
houseModel.castsFogSilhouette = trueConstructor
new Fog(): Fog