Fix pickPosition accuracy when depthTestAgainstTerrain is false #8207
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #8179. Merge #8205 first.
Local sandcastle for testing
This builds on top of #8205 by using the "everything-else" color texture to determine whether the pick depth should take the scene's depth value or the globe's depth value for a given pixel. If a pixel in the color texture is opaque it writes the scene depth, otherwise it writes the globe depth.
The one downside I noticed so far is that is breaks
scene.pickTranslucentDepth
since those commands are depth-only and the color texture can't be relied on. I tried a few ideas like writing color in that pass but it exposes a different bug that is very similar to #7429 (because my testing Sandcastle happens to use EDL). I have an idea for doing this whole PR differently by rendering a stencil bit for the depth plane and doing a two-pass copy. I'll see how that goes and then bump this PR for review.