Skip to content

Support Fog in Mercator projection without Terrain3D #4337

Open
@birkskyum

Description

@birkskyum

Current, the fog is part of the hillshade/terrain shader, and thus only active on Terrain 3D mode.

Repro is to disable the terrain here
https://maplibre.org/maplibre-gl-js/docs/examples/sky-with-fog-and-terrain/

If would be great also to have the fog in 2D.

Below, I've taken the terrain3d shader and just passed it a 0 elevation, which will give a flat terrain with fog (and hillshade). I don't know if it's the best path to go to "always/default" run through the terrain shader.

The advantage is that we don't need conditional logic around 3d or not 3d, so positioning objects and tile handling might become easier / more consistent, also with globe mode. Disadvantage might be unwanted overhead in cases where none of it is needed, but maybe it's better to just opt-out there.

before
Screenshot 2024-06-27 at 16 03 55

after
Screenshot 2024-06-27 at 16 03 31

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions