Skip to content

New picking framework - #96

Open
ccpisheden wants to merge 23 commits into
mainfrom
picking
Open

ccpisheden wants to merge 23 commits into
mainfrom
picking

Conversation

@ccpisheden

@ccpisheden ccpisheden commented Sep 21, 2026 •

Copy link
Copy Markdown

Summary

This PR replaces the old picking system with a new picking framework, which unifies all types of EveSpaceScene picking and is extensible to new types of rendering.

Linked issue (optional)

https://fenriscreations.atlassian.net/browse/PLAT-11733

Testing

Tested on DX11/DX12, and on Metal. Picking functions as before.

AI assistance

None

Checklist

Since picking is now done with a different texture format (RGBA32_UINT instead of the god-awfull RGBA8_UNORM hack), shaders had to be updated to write out the new picking data. The fixed shaders are in the TE-PICKING-FRAMEWORK Perforce stream, which must be merged after merging this PR.

@ccpgames-carbon

ccpgames-carbon commented Sep 21, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@ccpisheden ccpisheden changed the title Picking New picking framework Sep 23, 2026
@ccpisheden
ccpisheden marked this pull request as ready for review September 23, 2026 16:40
@filipppavlov
filipppavlov requested a balanced review from Copilot September 24, 2026 11:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Readback lifetime and region handling defects, duplicate instance identifiers, and changed object-resolution behavior can produce invalid or incorrect picking results.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 2 High severity · 3 Medium severity · 1 Low severity

Open (6)
What changed in this PR

Introduces asynchronous GPU readbacks and expands picking results to include 64-bit object pointers plus two additional data values.

Changes:

  • Adds cross-backend Tr2ReadbackAL support.
  • Reworks scene/debug/instanced-mesh picking and Python APIs.
  • Propagates 64-bit picking identifiers through render data.
File Description
trinityal/​stub/​Tr2TextureALStub.h Declares stub readback support.
trinityal/​stub/​Tr2TextureALStub.cpp Implements stub readbacks.
trinityal/​src/​Tr2TextureAL.cpp Adds public readback wrapper.
trinityal/​metal/​Tr2TextureALMetal.mm Implements Metal readbacks.
trinityal/​metal/​Tr2TextureALMetal.h Declares Metal readback resources.
trinityal/​include/​Tr2TextureAL.h Exposes the readback API.
trinityal/​dx12/​Tr2TextureALDx12.h Declares DX12 readback resources.
trinityal/​dx12/​Tr2TextureALDx12.cpp Implements DX12 readbacks.
trinityal/​dx11/​Tr2TextureALDx11.h Declares DX11 readback resources.
trinityal/​dx11/​Tr2TextureALDx11.cpp Implements DX11 readbacks.
trinity/​Utilities/​BVH.cpp Adds an explicit index cast.
trinity/​Tr2SkinnedModel.cpp Propagates picking pointers.
trinity/​Tr2RenderContext.h Stores split picking-pointer variables.
trinity/​Tr2RenderContext.cpp Uploads pointer halves and area data.
trinity/​Tr2PickBuffer.h Simplifies synchronous mapping API.
trinity/​Tr2PickBuffer.cpp Updates pick-buffer mapping.
trinity/​Tr2PerObjectData.h Replaces user data with 64-bit picking data.
trinity/​Tr2DebugRenderer.h Updates debug picking interface.
trinity/​Tr2DebugRenderer.cpp Integrates debug geometry into shared picking.
trinity/​ITr2PickableScene.cpp Adopts the updated picking API.
trinity/​Interior/​Tr2IntSkinnedObject.cpp Propagates picking pointers.
trinity/​Eve/​SpaceObject/​Children/​EveChildMesh.cpp Simplifies LOD lookup.
trinity/​Eve/​SpaceObject/​Children/​EveChildInstancedMeshes.cpp Adds per-instance picking metadata.
trinity/​Eve/​EveSpaceScene.h Declares new picking buffers and APIs.
trinity/​Eve/​EveSpaceScene.cpp Implements the new picking pipeline.
trinity/​Eve/​EveSpaceScene_Blue.cpp Exposes expanded Python picking results.
trinity/​Eve/​EvePicking.h Redesigns pending readback state.
trinity/​Eve/​EvePicking.cpp Stores two extra result values.
trinity/​Eve/​EveInstancedMeshManager.h Extends instance picking data.
trinity/​Eve/​EveInstancedMeshManager.cpp Uploads and renders new picking metadata.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread trinityal/dx12/Tr2TextureALDx12.cpp Outdated
Comment thread trinityal/src/Tr2TextureAL.cpp Outdated
Comment thread trinity/Eve/EveSpaceScene.cpp
Comment thread trinity/Eve/SpaceObject/Children/EveChildInstancedMeshes.cpp Outdated
Comment thread trinityal/stub/Tr2TextureALStub.cpp Outdated
Comment thread trinityal/include/Tr2TextureAL.h
Comment thread trinityal/stub/Tr2TextureALStub.h Outdated
Comment thread trinity/Tr2DebugRenderer.cpp Outdated
Comment thread trinity/Eve/EvePicking.cpp Outdated
Comment thread trinity/Eve/SpaceObject/Children/EveChildInstancedMeshes.cpp Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants