-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
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.