Skip to content
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

Excessive renderable tiles generated when terrain is activated #5368

Open
kkokkojeong opened this issue Jan 17, 2025 · 1 comment
Open

Excessive renderable tiles generated when terrain is activated #5368

kkokkojeong opened this issue Jan 17, 2025 · 1 comment
Labels
bug Something isn't working PR is more than welcomed Extra attention is needed

Comments

@kkokkojeong
Copy link
Contributor

maplibre-gl-js version: v5.0.1

browser: Chromium

Steps to Trigger Behavior

  1. http://localhost:9966/test/examples/3d-terrain.html#19.99/47.27574/11.3908601
  2. covering_tiles.ts
         export function coveringTiles(transform: IReadonlyTransform, options: CoveringTilesOptions): OverscaledTileID[] {
            // ....
           console.log('coveringTiles', !!options.terrain, result.length, options.terrain);
           return result.sort((a, b) => a.distanceSq - b.distanceSq).map(a => a.tileID);
         } 
  3. Too many tiles are returned.
    Image
    Image

If you look at the screen above, there are very few tiles drawn on it.

When the terrain is deactivated, the number of covering tiles with a raster source is 2.
However, after enabling the terrain, the number of covering tiles (RenderToTexture) increases significantly to about 20.

This results in many renderable tiles being generated, causing the device to consume a large amount of GPU texture memory and triggering unnecessary draw calls.

I hope this issue can be improved. :)

@kkokkojeong kkokkojeong changed the title Too many renderable tiles are covered when terrain is activated Excessive renderable tiles generated when terrain is activated Jan 17, 2025
@HarelM
Copy link
Collaborator

HarelM commented Jan 17, 2025

Cc: @NathanMOlson
Can you take a look at this?

@HarelM HarelM added bug Something isn't working PR is more than welcomed Extra attention is needed labels Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PR is more than welcomed Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants