Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Respect 'base' in composite functions #8654

Closed
anandthakker opened this issue Apr 5, 2017 · 3 comments
Closed

Respect 'base' in composite functions #8654

anandthakker opened this issue Apr 5, 2017 · 3 comments
Labels
Core The cross-platform C++ core, aka mbgl

Comments

@anandthakker
Copy link
Contributor

anandthakker commented Apr 5, 2017

In GL JS, we use the base property to interpolate the zoom component of composite functions of all types (not just for type: exponential). Ref

Here, it looks like we always assume a base of 1.0f

For consistency with GL JS, we should include a base property on each Composite*Stops<T> type--or maybe as a member of the function itself? I'm not sure--and use when we compute the interpolation factor.

@anandthakker anandthakker added the Core The cross-platform C++ core, aka mbgl label Apr 5, 2017
@anandthakker anandthakker changed the title Respect 'base' in composite functions of all types Respect 'base' in composite functions Apr 5, 2017
anandthakker pushed a commit to mapbox/mapbox-gl-js that referenced this issue Apr 5, 2017
@jfirebaugh
Copy link
Contributor

I think there's an underlying design flaw with the current specification of composite functions at play here. You should be able to separately specify the types of the camera and source portions of composite functions -- and if both types are exponential, provide separate bases for each.

@anandthakker
Copy link
Contributor Author

Agreed @jfirebaugh - though I think we should keep this issue open to track the short/medium-term problem, since fixing the spec may take longer.

anandthakker pushed a commit to mapbox/mapbox-gl-js that referenced this issue Apr 5, 2017
anandthakker pushed a commit to mapbox/mapbox-gl-js that referenced this issue Apr 6, 2017
anandthakker added a commit to mapbox/mapbox-gl-js that referenced this issue Apr 6, 2017
* Refactor byte pair unpacking into separate shader function

* Document / clarify StyleDeclaration#calculateInterpolationT

* Document strategy for populating vertex attributes with composite function values

* Clamp composite function interpolation to [0, 3], not [0, 4]

* Refactor {Array,Buffer}Group to construct layout vertex array type dynamically

* Enable property functions for text-size

* Improve naming and symbol layout internal docs

* Enable property functions for icon-size

* Add render tests for data-driven {text,icon}-size

* Pack texture and layout data into single attribute

Fix bug in packing of labelangle value

 * Label angles passed to addVertex() are in units of 1/256 of a circle.
Because packUint8ToFloat clamped input values to [0, 255], the value 256
was clamped to 255 (== 1.4 degrees off the horizontal), rather than
being wrapped to 0.

* Remove vestigial parameters

* Refactor {text,icon}-size-related bucket data

 - Consolidate it under bucket.{text,icon}SizeData objects
 - Include function base as part of said data
 - Use interpolationFactor to account for base != 1 for consistency with
   paint properties

* Document and refactor exponential function interpolation

* Fix handling of camera functions of 'interval' type

* Add t.equalWithPrecision() assertion and use it for function tests

* Edit comment for accuracy

* Ignore high-base tests for native

mapbox/mapbox-gl-native#8654

* Fixup render test: add missing feature properties
@jfirebaugh
Copy link
Contributor

In mapbox/mapbox-gl-js#4934 we switched gl-js to match native's linear interpolation for the zoom component. We'll defer to expressions to provide sophisticated independent control over this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

No branches or pull requests

2 participants