-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix(extensions): Correctly activate picking module in terrain picking pass #9768
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
fix(extensions): Correctly activate picking module in terrain picking pass #9768
Conversation
a621eaa
to
5cf39ed
Compare
Note: This fixes my fundamental problem but I still feel like there's something broken, because although now I can successfully pick items, if I try to get more accurate pick coordinates (c.f. #7831) by doing: const getPickCoordinates = (
info: PickingInfo<Marker>,
event,
): Coordinates | undefined => {
// info is now a valid pick with this PR
const pick = deckRef.current.pickObject({
x: event.offsetCenter.x,
y: event.offsetCenter.y,
// layerIds,
unproject3D: true,
radius: 100,
})
return pick && [pick.x, pick.y]
} My resulting pick is always undefined. So @Pessimistress I'd be keen to hear if you think that's an unrelated problem, or whether I might have approached this fix in the wrong way and a better approach might have fixed both problems. |
Thanks for digging! There is an internal _getShaderModuleProps responsible for merge props from effects onto the shader props, but this is concerning a PickingLayerPass. Terrain appears to be the only extension extending a This leads me to believe this a well formed fix for the terrain picking pass's shader module props. I'm not sure about the remaining issue with |
Woop! Thanks @chrisgervang |
I just released for testing in |
Closes #9764
Change List
getShaderModuleProps
method of theTerrainPickingPass
wasn't callingsuper()
, so, in the case of my reproduction in [Bug] Pick invalid / Corrupt pick index when using SolidPolygonLayer with a TerrainExtension #9764, the following were missing from the returned shader props:The picker was therefore incorrectly activated; it was running but gave an erroneous index
36094
.The penny dropped when I realised that
36094
(the index being erroneously picked) decodes toRGB [255,140,0]
which was the fill colour of the polygon... so I guess the algorithm falls back to the color of the object, instead of the colour in the picking layer, which then gets decoded wrongly.And for the first time ever...
ChatGPT actually did help a bit by steering me toward looking at this method.