-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Conversation
@lbud, thanks for your PR! By analyzing this pull request, we identified @jfirebaugh, @1ec5 and @ansis to be potential reviewers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really looking forward to this feature! Thanks for all the hard work you've put into it both here and in GL JS.
I know it's pretty far down on the priority list, but I've left some premature comments about the iOS and macOS side of things, primarily regarding documentation. Take your time with that; the to-do items you've identified are more interesting anyways.
In addition, in order for the iOS and macOS SDKs to build, MGLFillExtrusionStyleLayer.h needs to be added to Mapbox.h, ios.xcodeproj, and macos.xcodeproj. See "Making a type or constant public" and "Adding a source code file" in this guide for details. Let me know if you have any questions.
painter.cp
Outdated
@@ -0,0 +1,421 @@ | |||
#include <mbgl/renderer/painter.hpp> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this file was committed by accident.
NS_ASSUME_NONNULL_BEGIN | ||
|
||
/** | ||
Controls the translation reference point. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change might be worth making upstream:
Controls the translation reference point of a fill extrusion style layer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@1ec5 it might be — this language is copied from *-translate-anchor
in every other layer type. I'll ticket this in that repo as a follow-up.
@property (nonatomic, null_resettable) MGLStyleValue<NSNumber *> *fillExtrusionOpacity; | ||
|
||
/** | ||
Name of image in sprite to use for drawing images on extruded fills. For |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there's no public concept of a spritesheet in the native SDKs, we override any documentation that says "sprite" to say "style image" instead in platform/darwin/scripts/style-spec-overrides-v8.json while we await mapbox/mapbox-gl-js#4086.
|
||
#if TARGET_OS_IPHONE | ||
/** | ||
The geometry's offset. Values are [x, y] where negatives indicate left and up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also use style-spec-overrides-v8.json to remove any sentence that talks about offsets or padding as arrays, because that isn't how they're exposed by the iOS and macOS SDKs. (They're CGVectors or NSEdgeInsets or UIEdgeInsets, not NSArrays.)
/** | ||
The base color of the extruded fill. The extrusion's surfaces will be shaded | ||
differently based on this color in combination with the root `light` settings. | ||
If this color is specified as `rgba` with an alpha component, the alpha |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per #6107 (comment), we override documentation to remove the phrase "as rgba
, because that's CSS syntax, whereas alpha may be specified with -colorWithHue:saturation:brightness:alpha:
or -colorWithWhite:alpha:
instead of -colorWithRed:green:blue:alpha:
.
* `MGLInterpolationModeExponential` | ||
* `MGLInterpolationModeInterval` | ||
*/ | ||
@property (nonatomic, null_resettable) MGLStyleValue<NSValue *> *fillExtrusionTranslate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per #6098 (comment), we turn "translate" to "translation" using platform/darwin/scripts/cocoa-conventions-v8.json to prevent a call to the property's getter from looking like a call to an action method.
*/ | ||
@interface NSValue (MGLFillExtrusionStyleLayerAdditions) | ||
|
||
#pragma mark Working with FillExtrusion Style Layer Attribute Values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/FillExtrusion/Fill Extrusion/
#if TARGET_OS_IPHONE | ||
/** | ||
The base color of the extruded fill. The extrusion's surfaces will be shaded | ||
differently based on this color in combination with the root `light` settings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
light
will in all likelihood be a property of MGLStyle; the word "root" is meaningless in the context of these SDKs.
### Example | ||
|
||
```swift | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eventually we'll want to fill in some example code here, via MGLDocumentationTests.swift, but that can be tail work.
/** | ||
An extruded (3D) polygon. | ||
|
||
You can access an existing fill-extrusion style layer using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/fill-extrusion/fill extrusion/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@1ec5 I am of the opinion (though not strongly) that this should remain hyphenated, I think, for clarity — do you have a strong feeling that it should be fill extrusion
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, as a noun phrase, it should be unhyphenated in prose. ("Fill-extrusion style layer" would be more natural as shorthand for "fill and extrusion style layer", like "zoom-property function" as shorthand for "zoom-and-property function".) Unlike in JavaScript, the hyphenated form fill-extrusion
will never appear in the developer's code.
FYI, our handling of these underwent some recent changes (by @mollymerp and I) - happy to help 💭 / 🕵️ |
Thanks for the 👀 @1ec5! All platform-specific code committed thus far has been autogenerated with scripts/make targets so your attention is especially appreciated 🙇♀️ — adding to the list. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remember to rerun make darwin-style-code
to incorporate the changes in d682d56.
"doc": "The geometry's offset." | ||
}, | ||
"fill-extrusion-color": { | ||
"doc": "The base color of this layer. The extrusion's surfaces will be shaded differently based on this color in combination with the `light` settings. If this color is specified with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacityco." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "opacityco".
@@ -50,6 +53,17 @@ | |||
"doc": "Name of image in style images to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512)." | |||
} | |||
}, | |||
"paint_fill-extrusion": { | |||
"fill-extrusion-pattern": { | |||
"doc": "Name of image in style images to use for drawing image fill-extrusions. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512)." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Image fills" sort of made sense for fill-pattern
, but I'm not sure about "image fill-extrusions". How about "for drawing the surfaces of the extrusion"?
4a68bc9
to
76a3fb1
Compare
@jfirebaugh @kkaefer I'm trying to figure out one last thing here: there's a failing TileCover test on a few Bitrise platforms (though passing on Travis) — the returned tiles the same but are slightly out of order; this is the result of the changes in Aside from that however this is ready for review (so please start reviewing whenever you feel ready) — the only thing that may change is that small part of |
Also tagging in @ivovandongen @1ec5 to do a pass over generated Darwin/Android code 🙏 |
…ill-extrusion layer with a further near clip plane, and leave the global projection matrix alone
…ssor conditional in types.hpp) in all cases
Recording the solution to the depth buffer issue for posterity's sake: |
@lbud I get a failed UI test on
|
… avoid setting and re-setting matrix
Looks like this PR rolled back #6619 (nfarina/calloutview#107): #9314. |
Opening this for tracking purposes as it's getting close enough to have a public living to-do list:
[functionality]
implement transitions in light options[bug]
In 9514b62 I rewroteRenderItem
to hold a vector ofRenderTile
s, rather than a singleRenderTile
, so that we can render a whole layer at a time (necessary for the offscreen texture approach used herein). In doing so I wrote a logic bug — need to comb over that rewrite 🔍[bug]
I suspect there may be a bug in the way we're handling zoom-and-property functions — investigatepunted to Composite functions behave incorrectly with non-integer stops #8460 as it is not actually related[bug]
there are weird striping/zigzag artifacts on glfw and macOS, but not on ios. Need to investigate what's going on hereGL_DEPTH_COMPONENT16
; changed toGL_DEPTH_COMPONENT
which leaves resolution up to the implementation)GL_DEPTH_COMPONENT16
is the only valid depth internalformat for renderbufferStorage 🤔 — onward)[tests]
un-ignore render tests + ensure all pass [not ready] Un-ignore fill-extrusion tests on native mapbox-gl-js#4519 🚀[tests]
unit tests[cleanup]
this depends on theextrusions-native-tweaks
branch of mapbox-gl-js, which makes a few changes to shaders — merge that + update dep here[bug]
many render tests are broken (opacity issue?); investigatelost cause, will squash upon merging[cleanup]
squash/clean up commits (apologies to reviewers 🙈)[cleanup]
revert committed changes in./platform/glfw/main.cpp
[platform]
address @1ec5's comments below + corresponding concerns across other generated platform code