-
-
Notifications
You must be signed in to change notification settings - Fork 767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Globe custom layer fixes #5150
Globe custom layer fixes #5150
Conversation
# Conflicts: # src/geo/projection/globe_transform.ts # src/geo/projection/mercator_transform.ts # src/geo/transform_helper.ts # src/geo/transform_interface.ts
…aring during projection transition
…'t use internal API in examples
…CustomLayer implementation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## projection-expression #5150 +/- ##
=========================================================
- Coverage 91.82% 91.81% -0.01%
=========================================================
Files 281 281
Lines 38712 38751 +39
Branches 6745 6757 +12
=========================================================
+ Hits 35548 35581 +33
- Misses 3036 3042 +6
Partials 128 128 ☔ View full report in Codecov by Sentry. |
I've added some comments. Thanks! |
I think the following PR: Will cause this PR to not exactly match the changes I've made. |
…bapelc/globe-custom-layer-fix2 # Conflicts: # src/geo/projection/globe_transform.ts
I can help with merge conflicts with #5164 if there are any. The changes don't seem to overlap too much. |
…bapelc/globe-custom-layer-fix2 # Conflicts: # CHANGELOG.md # src/geo/projection/globe_transform.ts # src/geo/projection/mercator_transform.ts # src/geo/projection/vertical_perspective_transform.ts # src/geo/transform_interface.ts
I've added a few comments. |
// seems to solve z-fighting issues in deck.gl while not clipping buildings too close to the camera. | ||
this._nearZ = this._helper._height / 50; | ||
|
||
if (this._helper.autoCalculateNearFarZ) { |
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.
I was under the impression other variables are used later on, since this is not the case I would consider moving this to an internal method, it will be a lot more readable.
} | ||
|
||
public get cameraPosition(): vec3 { return this._cameraPosition; } | ||
public get projectionMatrix(): mat4 { return this._projectionMatrix; } | ||
public get modelViewProjectionMatrix(): mat4 { return this._viewProjMatrix; } | ||
public get inverseProjectionMatrix(): mat4 { return this._invProjMatrix; } | ||
public get nearZ(): number { return this._nearZ; } | ||
public get farZ(): number { return this._farZ; } | ||
public get nearZ(): number { return this._helper.nearZ; } |
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.
Move these methods to be with the other helper methods in the file
I'll merge this and fix what's left in the other branch, THANKS!!! |
49802fb
into
maplibre:projection-expression
* Initial commit to move the logic of transition out to a new file * Remove one line method * Fix build test * Fix projection data bad refactoring * Fix render and size tests * Fix failing unit test * Uncomment unit tests * Fix typo, remove unneeded details provider initialization. Added current transfrom getter * Fix typo * Add back error correction for latitude. * Refactors the `Projection` classed only (#5163) * This refactors the projection class only, without touching other parts of the code. * remove mercator from the code, revert more changes * Refactor camera helper to split the logic for vertical-perspective and mercator (#5162) * Refactor camera helper * Use the helper in the factory. * Fix build test * Fix according to code review * Use `Transitionalable` infrastructure for transfrom globeness changes. (#5164) * Remove duplicate code * Fix lint, add some methods for original branch * Add projection definition in factory * Add has transition to projection * Fix transition value * Remove isRenderingDirty and use hasTransition when needed * Remove the last part of the animation handling in the transform class * More clean-up * Remove some "TODO"s. * Remove reference to globe projection in globe transform * Rename newFrame with recalculateCache * Remove unneeded ifs * Add support for arbitrary projection definitions * Uses mercator matrix when globe is using mercator transform * Improve handling of fog martix in globe transform --------- Co-authored-by: Isaac Besora Vilardaga <isaac.besora@gmail.com> * Globe custom layer fixes (#5150) * Simplify custom layer ProjectionData code in mercator transform * Fix globe tiles example * Fix globe projection shader * Add custom layer 3D model after globe->mercator transition render test * Fix custom layer 3D models not rendering when globe transitions to mercator * Move camera to center distance to helper # Conflicts: # src/geo/projection/globe_transform.ts # src/geo/projection/mercator_transform.ts # src/geo/transform_helper.ts # src/geo/transform_interface.ts * Synchronize globe+mercator near and far Z to prevent 3D model disappearing during projection transition * Expose getProjectionData and getMatrixForModel for custom layers, don't use internal API in examples * VerticalPerspectiveTransform should have a valid getProjectionDataForCustomLayer implementation * Add changelog entry * Fix missing docs * Fix docs again * Review feedback * Move nearZfarZoverride to transform helper * Update build size * Review feedback * Change near/far Z override API * Custom layers use internal API * Fix globe custom tiles example * Update build size * Fix typo --------- Co-authored-by: HarelM <harel.mazor@gmail.com> * Final removal of TODOs and some minor clean up * Update CHANGELOG.md --------- Co-authored-by: Isaac Besora Vilardaga <isaac.besora@gmail.com> Co-authored-by: Jakub Pelc <57600346+kubapelc@users.noreply.github.com>
Fixes #5117
args.defaultProjectionData.mainMatrix
value using globe projection with high zoom level #5117 + adds a render test for this issueglobe-custom-tiles.html
example