Skip to content

Commit fb55bd1

Browse files
mapbox-github-ci-writer-4[bot]ibesoraactions-user
authored andcommitted
[EXT] Add new property: model-allow-density-reduction (#8488)
This PR fixes the merge conflicts found in mapbox/mapbox-gl-js#13433 which I couldn't address directly there (I suppose due to branch protections on the original reporter branch), adds a new render test to cover this behaviour and marks `model-allow-density-reduction` as `experimental`. All credit goes to @JoshuaJMoore who did the initial implementation Closes [MAPS3D-2107](https://mapbox.atlassian.net/browse/MAPS3D-2107) and [GLJS-1561](https://mapbox.atlassian.net/browse/GLJS-1561) ## Launch Checklist - [ ] Make sure the PR title is descriptive and preferably reflects the change from the user's perspective. - [ ] Add additional detail and context in the PR description (with screenshots/videos if there are visual changes). - [ ] Manually test the debug page. - [ ] Write tests for all new functionality and make sure the CI checks pass. - [ ] Document any changes to public APIs. - [ ] Post benchmark scores if the change could affect performance. - [ ] Tag `@mapbox/map-design-team` `@mapbox/static-apis` if this PR includes style spec API or visual changes. - [ ] Tag `@mapbox/gl-native` if this PR includes shader changes or needs a native port. - [ ] Tag `@mapbox/gl-native` if this PR disables any test because it also needs to be disabled on their side. - [ ] Create a ticket for `gl-native` to groom in the [MAPSNAT JIRA queue](https://mapbox.atlassian.net/jira/software/c/projects/MAPSNAT/list) if this PR includes shader changes or features not present in the native side or if it disables a test that's not disabled there. -- > [!NOTE] > This PR was imported from the public repo and closes: mapbox/mapbox-gl-js#13595 > ``` > <public>Add new property: `model-allow-density-reduction` (h/t @JoshuaJMoore) (public-13595)</public> > ``` Author: Isaac Besora Vilardaga <isaac.besora@gmail.com> cc @mapbox/gl-js [MAPS3D-2107]: https://mapbox.atlassian.net/browse/MAPS3D-2107?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [GLJS-1561]: https://mapbox.atlassian.net/browse/GLJS-1561?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ cc @mapbox/maps-android cc @mapbox/maps-ios cc @mapbox/sdk-ci --------- Co-authored-by: Isaac Besora Vilardaga <isaac.besora@gmail.com> Co-authored-by: Changelog autocreator bot <actions@github.com> GitOrigin-RevId: 64bb4e75904e023db952a4054f4a575a9628c196
1 parent 0ba1a33 commit fb55bd1

File tree

9 files changed

+286
-0
lines changed

9 files changed

+286
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Mapbox welcomes participation and contributions from everyone.
88

99
## Breaking changes ⚠️
1010
* Remove line-cutout-width and change line-cutout-opacity default to 1.0
11+
* Add `ModelLayer.modelAllowDensityReduction` property to disable density reduction in model layers.
1112

1213
## Features ✨ and improvements 🏁
1314
* Add Standard Style color and 3D configuration options: `colorBuildings`, `colorCommercial`, `colorEducation`, `colorIndustrial`, `colorLand`, `colorMedical`, `show3dBuildings`, `show3dFacades`, `show3dLandmarks`, and `show3dTrees`.

extension-compose/api/Release/metalava.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3252,6 +3252,7 @@ package com.mapbox.maps.extension.compose.style.layers.generated {
32523252
method public com.mapbox.maps.extension.compose.style.layers.LayerInteractionsState getInteractionsState();
32533253
method public com.mapbox.maps.extension.compose.style.LongValue getMaxZoom();
32543254
method public com.mapbox.maps.extension.compose.style.LongValue getMinZoom();
3255+
method public com.mapbox.maps.extension.compose.style.BooleanValue getModelAllowDensityReduction();
32553256
method public com.mapbox.maps.extension.compose.style.DoubleValue getModelAmbientOcclusionIntensity();
32563257
method public com.mapbox.maps.extension.compose.style.Transition getModelAmbientOcclusionIntensityTransition();
32573258
method public com.mapbox.maps.extension.compose.style.BooleanValue getModelCastShadows();
@@ -3286,6 +3287,7 @@ package com.mapbox.maps.extension.compose.style.layers.generated {
32863287
method public void setInteractionsState(com.mapbox.maps.extension.compose.style.layers.LayerInteractionsState);
32873288
method public void setMaxZoom(com.mapbox.maps.extension.compose.style.LongValue);
32883289
method public void setMinZoom(com.mapbox.maps.extension.compose.style.LongValue);
3290+
method public void setModelAllowDensityReduction(com.mapbox.maps.extension.compose.style.BooleanValue);
32893291
method public void setModelAmbientOcclusionIntensity(com.mapbox.maps.extension.compose.style.DoubleValue);
32903292
method public void setModelAmbientOcclusionIntensityTransition(com.mapbox.maps.extension.compose.style.Transition);
32913293
method public void setModelCastShadows(com.mapbox.maps.extension.compose.style.BooleanValue);
@@ -3320,6 +3322,7 @@ package com.mapbox.maps.extension.compose.style.layers.generated {
33203322
property public final com.mapbox.maps.extension.compose.style.layers.LayerInteractionsState interactionsState;
33213323
property public final com.mapbox.maps.extension.compose.style.LongValue maxZoom;
33223324
property public final com.mapbox.maps.extension.compose.style.LongValue minZoom;
3325+
property public final com.mapbox.maps.extension.compose.style.BooleanValue modelAllowDensityReduction;
33233326
property public final com.mapbox.maps.extension.compose.style.DoubleValue modelAmbientOcclusionIntensity;
33243327
property public final com.mapbox.maps.extension.compose.style.Transition modelAmbientOcclusionIntensityTransition;
33253328
property public final com.mapbox.maps.extension.compose.style.BooleanValue modelCastShadows;

extension-compose/api/extension-compose.api

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2711,6 +2711,7 @@ public final class com/mapbox/maps/extension/compose/style/layers/generated/Mode
27112711
public final fun getInteractionsState ()Lcom/mapbox/maps/extension/compose/style/layers/LayerInteractionsState;
27122712
public final fun getMaxZoom ()Lcom/mapbox/maps/extension/compose/style/LongValue;
27132713
public final fun getMinZoom ()Lcom/mapbox/maps/extension/compose/style/LongValue;
2714+
public final fun getModelAllowDensityReduction ()Lcom/mapbox/maps/extension/compose/style/BooleanValue;
27142715
public final fun getModelAmbientOcclusionIntensity ()Lcom/mapbox/maps/extension/compose/style/DoubleValue;
27152716
public final fun getModelAmbientOcclusionIntensityTransition ()Lcom/mapbox/maps/extension/compose/style/Transition;
27162717
public final fun getModelCastShadows ()Lcom/mapbox/maps/extension/compose/style/BooleanValue;
@@ -2745,6 +2746,7 @@ public final class com/mapbox/maps/extension/compose/style/layers/generated/Mode
27452746
public final fun setInteractionsState (Lcom/mapbox/maps/extension/compose/style/layers/LayerInteractionsState;)V
27462747
public final fun setMaxZoom (Lcom/mapbox/maps/extension/compose/style/LongValue;)V
27472748
public final fun setMinZoom (Lcom/mapbox/maps/extension/compose/style/LongValue;)V
2749+
public final fun setModelAllowDensityReduction (Lcom/mapbox/maps/extension/compose/style/BooleanValue;)V
27482750
public final fun setModelAmbientOcclusionIntensity (Lcom/mapbox/maps/extension/compose/style/DoubleValue;)V
27492751
public final fun setModelAmbientOcclusionIntensityTransition (Lcom/mapbox/maps/extension/compose/style/Transition;)V
27502752
public final fun setModelCastShadows (Lcom/mapbox/maps/extension/compose/style/BooleanValue;)V

extension-compose/src/main/java/com/mapbox/maps/extension/compose/style/layers/generated/ModelLayerState.kt

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extension-style-app/src/androidTest/java/com/mapbox/maps/testapp/style/layers/generated/ModelLayerTest.kt

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extension-style/api/Release/metalava.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4075,6 +4075,8 @@ package com.mapbox.maps.extension.style.layers.generated {
40754075
method public String getLayerId();
40764076
method public Double? getMaxZoom();
40774077
method public Double? getMinZoom();
4078+
method public Boolean? getModelAllowDensityReduction();
4079+
method public com.mapbox.maps.extension.style.expressions.generated.Expression? getModelAllowDensityReductionAsExpression();
40784080
method public Double? getModelAmbientOcclusionIntensity();
40794081
method public com.mapbox.maps.extension.style.expressions.generated.Expression? getModelAmbientOcclusionIntensityAsExpression();
40804082
method public com.mapbox.maps.extension.style.types.StyleTransition? getModelAmbientOcclusionIntensityTransition();
@@ -4129,6 +4131,8 @@ package com.mapbox.maps.extension.style.layers.generated {
41294131
method public com.mapbox.maps.extension.style.expressions.generated.Expression? getVisibilityAsExpression();
41304132
method public com.mapbox.maps.extension.style.layers.generated.ModelLayer maxZoom(double maxZoom);
41314133
method public com.mapbox.maps.extension.style.layers.generated.ModelLayer minZoom(double minZoom);
4134+
method @com.mapbox.maps.MapboxExperimental public com.mapbox.maps.extension.style.layers.generated.ModelLayer modelAllowDensityReduction(boolean modelAllowDensityReduction);
4135+
method @com.mapbox.maps.MapboxExperimental public com.mapbox.maps.extension.style.layers.generated.ModelLayer modelAllowDensityReduction(com.mapbox.maps.extension.style.expressions.generated.Expression modelAllowDensityReduction);
41324136
method public com.mapbox.maps.extension.style.layers.generated.ModelLayer modelAmbientOcclusionIntensity(double modelAmbientOcclusionIntensity);
41334137
method public com.mapbox.maps.extension.style.layers.generated.ModelLayer modelAmbientOcclusionIntensity(com.mapbox.maps.extension.style.expressions.generated.Expression modelAmbientOcclusionIntensity);
41344138
method public com.mapbox.maps.extension.style.layers.generated.ModelLayer modelAmbientOcclusionIntensityTransition(com.mapbox.maps.extension.style.types.StyleTransition options);
@@ -4194,6 +4198,8 @@ package com.mapbox.maps.extension.style.layers.generated {
41944198
property public String layerId;
41954199
property public Double? maxZoom;
41964200
property public Double? minZoom;
4201+
property public final Boolean? modelAllowDensityReduction;
4202+
property public final com.mapbox.maps.extension.style.expressions.generated.Expression? modelAllowDensityReductionAsExpression;
41974203
property public final Double? modelAmbientOcclusionIntensity;
41984204
property public final com.mapbox.maps.extension.style.expressions.generated.Expression? modelAmbientOcclusionIntensityAsExpression;
41994205
property public final com.mapbox.maps.extension.style.types.StyleTransition? modelAmbientOcclusionIntensityTransition;
@@ -4252,6 +4258,8 @@ package com.mapbox.maps.extension.style.layers.generated {
42524258
public static final class ModelLayer.Companion {
42534259
method public Double? getDefaultMaxZoom();
42544260
method public Double? getDefaultMinZoom();
4261+
method public Boolean? getDefaultModelAllowDensityReduction();
4262+
method public com.mapbox.maps.extension.style.expressions.generated.Expression? getDefaultModelAllowDensityReductionAsExpression();
42554263
method public Double? getDefaultModelAmbientOcclusionIntensity();
42564264
method public com.mapbox.maps.extension.style.expressions.generated.Expression? getDefaultModelAmbientOcclusionIntensityAsExpression();
42574265
method public com.mapbox.maps.extension.style.types.StyleTransition? getDefaultModelAmbientOcclusionIntensityTransition();
@@ -4302,6 +4310,8 @@ package com.mapbox.maps.extension.style.layers.generated {
43024310
method public com.mapbox.maps.extension.style.layers.properties.generated.Visibility? getDefaultVisibility();
43034311
property public final Double? defaultMaxZoom;
43044312
property public final Double? defaultMinZoom;
4313+
property public final Boolean? defaultModelAllowDensityReduction;
4314+
property public final com.mapbox.maps.extension.style.expressions.generated.Expression? defaultModelAllowDensityReductionAsExpression;
43054315
property public final Double? defaultModelAmbientOcclusionIntensity;
43064316
property public final com.mapbox.maps.extension.style.expressions.generated.Expression? defaultModelAmbientOcclusionIntensityAsExpression;
43074317
property public final com.mapbox.maps.extension.style.types.StyleTransition? defaultModelAmbientOcclusionIntensityTransition;
@@ -4356,6 +4366,8 @@ package com.mapbox.maps.extension.style.layers.generated {
43564366
method public com.mapbox.maps.extension.style.layers.generated.ModelLayer filter(com.mapbox.maps.extension.style.expressions.generated.Expression filter);
43574367
method public com.mapbox.maps.extension.style.layers.generated.ModelLayer maxZoom(double maxZoom);
43584368
method public com.mapbox.maps.extension.style.layers.generated.ModelLayer minZoom(double minZoom);
4369+
method @com.mapbox.maps.MapboxExperimental public com.mapbox.maps.extension.style.layers.generated.ModelLayer modelAllowDensityReduction(boolean modelAllowDensityReduction = true);
4370+
method @com.mapbox.maps.MapboxExperimental public com.mapbox.maps.extension.style.layers.generated.ModelLayer modelAllowDensityReduction(com.mapbox.maps.extension.style.expressions.generated.Expression modelAllowDensityReduction);
43594371
method public com.mapbox.maps.extension.style.layers.generated.ModelLayer modelAmbientOcclusionIntensity(double modelAmbientOcclusionIntensity = 1.0);
43604372
method public com.mapbox.maps.extension.style.layers.generated.ModelLayer modelAmbientOcclusionIntensity(com.mapbox.maps.extension.style.expressions.generated.Expression modelAmbientOcclusionIntensity);
43614373
method public com.mapbox.maps.extension.style.layers.generated.ModelLayer modelAmbientOcclusionIntensityTransition(com.mapbox.maps.extension.style.types.StyleTransition options);

0 commit comments

Comments
 (0)