Skip to content

Performance: pick from globe depth when possible #13005

@mzschwartz5

Description

@mzschwartz5

Feature

It's no secret that globe picking is slow. We should soon have some big improvements for globe picking, but for dense terrain data (like ArcGIS), it will still be relatively slow (at least, the first pick on each tile can be slow, but subsequent picks get faster. Still, when panning the camera around, new tiles constantly load in, and cause slight lag as the camera does slow picks to avoid collisions).

It's important to understand the difference between globe.pick and GlobeDepth. The former uses CPU-side vertex data and intersection tests to find where an arbitrary ray intersects the globe. The latter can be used to do something similar, but via a readback of the GPU globe depth buffer - and, by nature, only works for rays from the camera, not for arbitrary rays.

Now, because globe.pick works for arbitrary rays, some code (including the camera class) uses it, when they actually only need the special case of picking along a camera ray. In these cases, it may be wise to read back from the depth buffer instead.

Proposal: allow globe.pick to read back from the depth buffer instead of doing CPU-side picking. This could be via a flag, by checking if the input ray is a camera ray (same origin + direction within frustum), or just a new method entirely, to name a few options.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions