Conversation
u_cam_matrix is not projective and w is always 1 for points
* Remove haze * Remove density * Catch a couple more small cleanup items * Fix broken shader * Tighten/restore fog culling * Update src/render/painter.js
… horizon blend
- Also removes extraneous branching with min in fog_apply_premultiplied
…ion and add validation tests
* Switch fog from percentage window height to CSS vh units * Fix tests * Fix more tests * Fix still more tests * Update src/style-spec/reference/v8.json
| for (const tile of this._visibleDemTiles) { | ||
| if (tile.dem) { | ||
| const id = tile.tileID; | ||
| const tiles = Math.pow(2.0, id.overscaledZ); |
There was a problem hiding this comment.
1 << id.overscaledZ instead of function call?
| return null; | ||
| } | ||
|
|
||
| raycastBatch(points: Point[]): vec4[] { |
There was a problem hiding this comment.
Should we replace raycast() with raycastBatch(1) defined here or would this one eventually be slower for just one ray?
| const yRadius = map.transform.height * 0.33; | ||
|
|
||
| // Phyllotaxis: https://www.desmos.com/calculator/duq27u6vof | ||
| const n = 5; |
There was a problem hiding this comment.
Can make n larger if the goal is to stress-test it a bit more.
| this._construct(mips, 0, 0, maxLvl, 0); | ||
| } | ||
|
|
||
| get rootBounds(): [number, number] { return [-aabbSkirtPadding, this.maximums[0]]; } |
There was a problem hiding this comment.
Should this be this.minimums[0] - aabbSkirtPadding in case the terrain is below sea level? Or maybe Math.min(this.minimums[0], 0) - aabbSkirtPadding if the goal is to get it to intersect with elevation = 0?
| const treeBounds = tree.rootBounds; | ||
|
|
||
| //Z in meters | ||
| const minz = treeBounds[0]; |
There was a problem hiding this comment.
Does this need exaggeration as well, in case it's below sea level?
69bfce9 to
798728e
Compare
|
Where is it going to be used? What is the size of improvement in typical scenario? |
|
@astojilj this gave fairly minimal performance improvement for the use case we had and ended up only using 5 rays, we were imagining using more but the difference in computing average elevation wasn't worth it (refer to. #10621 at https://github.com/mapbox/mapbox-gl-js/pull/10621/files#diff-a2b3330768267b8c7996b8bf292fcd864e8b768f538436813b0d7e19f7202176R336). So we're not going to go ahead with merging this but will leave it open in case this is needed for other purposes later, as this can be useful whenever we need to do a lot of raycasts at once. |
29f0846 to
a0d6705
Compare
|
Closing as stale |


Provides an optimized raycast method that can speed up terrain raycasting for multiple rays per frame.
It does this by combining all the rays into a single frustum, and then uses that frustum to determine which tiles need to be considered.
This results in dropping a few tiles before it enters into a
O(num_tiles * num_rays)loop.