Design Proposal: Ambient occlusion for fill-extrusion layer.
Motivation
MapLibre has no ambient occlusion feature for fill-extrusion layer today. This helps to make 3D features look more realistic. Although, there is an open-sourced implementation for GL JS. But I am not sure, if we can translate similar approach to Native one. Moreover, there is an opened issue for supporting ambient occlusion out of box for GL JS version.
Proposed Change
The proposed changes covers MapLibre Native implementation details, things could be changed for GL JS map.
The effect could be computed as a part of existing building geometry processing step, thats a place where the map has the wall geometry for each building's footprint. It makes more sense to me rather then implementing a new render pass.
API Modifications
At the high level, we can introduce two style properties to support following feature:
- An intensity property (number for a given range [0;1], default value is 0).
- A radius property (number, default chosen to give a reasonable).
Maybe anything more if we would like to allow customize for end-users.
Migration Plan and Compatibility
The changes are additive. The default values of style properties make the feature disabled.
Rejected Alternatives
This section covers the state of Native project. I might miss anything, feel free to add! π
- We could implement similar behavior using MLNCustomStyleLayer/MLNPluginStyleLayer for Darwin platforms and keep this feature at consumer app level. But why I don't think thats an option: both types of layers with no access to another layer's geometry. To get building geometry we have either query rendered/visible features and then apply ambient occlusion for a given geometry. It impacts performance from my tests.
- Maybe we can consider using cxx plugins system to support this feature for native projects, but I am afraid that It might have similar problems as option 1.
Design Proposal: Ambient occlusion for fill-extrusion layer.
Motivation
MapLibre has no ambient occlusion feature for
fill-extrusionlayer today. This helps to make 3D features look more realistic. Although, there is an open-sourced implementation for GL JS. But I am not sure, if we can translate similar approach to Native one. Moreover, there is an opened issue for supporting ambient occlusion out of box for GL JS version.Proposed Change
The effect could be computed as a part of existing building geometry processing step, thats a place where the map has the wall geometry for each building's footprint. It makes more sense to me rather then implementing a new render pass.
API Modifications
At the high level, we can introduce two style properties to support following feature:
Maybe anything more if we would like to allow customize for end-users.
Migration Plan and Compatibility
The changes are additive. The default values of style properties make the feature disabled.
Rejected Alternatives
This section covers the state of Native project. I might miss anything, feel free to add! π