I alr have the gpu picker integrated into Seedborn. When updating @babylonjs/core to latest, the gpupicker broke. Managed to track it down to v8.31.3. There seems to be a breaking change but could not find any documentation to update my current setup.
Can someone detail the breaking changes in doc? Thanks in advance.
It seems the issue is caused by the PR I created.
If you could describe the situation where the problem occurs, it would help us resolve it.
master ← noname0310:gpupicking-improve
opened 01:55PM - 14 Oct 25 UTC
This PR introduces three major changes to Babylon.js’s GPUPicking:
## 1) Use … `float` IDs instead of `vec4`
I replace the previous vec4-encoded mesh/instance IDs with single float attributes passed to the shader.
Mesh / InstancedMesh : `meshID` attribute changes from `vec4` -> `float`.
Thin instances : `instanceID` attribute changes from `vec4` -> `float`.
**Why this is valid**
Priviously, ID encoding only used the RGB channels (3 × 1 byte = 24-bit unsigned int). This fits safely within the precise integer range of 32-bit floating point (all integers up to 16,777,216 are exactly representable). Therefore, moving from RGB-packed vec4 to a float preserves correctness while simplifying the pipeline.
## 2) Box (Selection) Picking
Add box selection support (`boxPickAsync`)
This is particularly useful for building editors and selection-heavy tools with Babylon.js.
## 3) Support Dynamic Picking Lists
Enables appending new meshes to the picking list at runtime without rebuilding from scratch.
Introduced `addPickingList` to append to the existing picking set.
---
The code has already been tested in the local environment.
I would love your feedback :)
+ Oh, and now it supports meshes using various fill modes. It works not only for triangles but also for meshes using primitives like lines.
Are you using the GPUPicker.defaultRenderMaterial property?
If so, changes to this property may be breaking your code.
I’ve yet to lock down on the issue. All I know is that my thin instances are not highlighting when picked. Comparing to the pgs in this thread , it appears that there might be more than 1 breaking issue.
You can try https://playground.babylonjs.com/?version=8.31.2#NNC5Y2#1 vs
https://playground.babylonjs.com/#NNC5Y2#1 with latest version, the console is logging very different results. Perhaps you can start with this?
1 Like
This doesn’t seem like a breaking change, but rather a bug.
I’m currently looking into the issue.
1 Like
sebavan
November 5, 2025, 10:36pm
5
Thanks a lot @noname0310 for looking into it and let us know if we should revert
1 Like
I created a PR to fix the issue. If the issue persists after the merge, please let me know.
master ← noname0310:gpupicker-fix-precision-issue
opened 11:22PM - 05 Nov 25 UTC
Resolves the issue:
https://forum.babylonjs.com/t/missing-doc-for-gpupicker-in-… v8-31-3/61295/5
What I found while examining this issue is that
when outputting values received as uniform variables in the shader to the screen,
the uniform values were displayed completely without error,
but values received as attributes exhibited errors.
I don't know the exact reason for this, as it is an internal WebGL implementation detail.
Through experimentation, I found a safe `MaxPickingId` value usable across WebGL, WebGL2, and WebGPU.
I confirmed that adding 0.5 at the point of casting from int resolves this precision issue.
1 Like
Just tested against the latest build, thin instance picking is still not registering the correct colorId. As my scene has other settings, I need to do a full dissection for a repro. But my schedule isn’t open till end next wk (earliest), have to kiv for now.
Repro: https://playground.babylonjs.com/#CP2RN9#317
Compare against https://playground.babylonjs.com/?version=8.31.2#CP2RN9#317
Open the console, try to mouseover the area roughly under the lower lip of the mesh. In the latest version, the gpu picker will show pick results but not in the 8.31.2 version. Or you can try picking the tip of the mouth, either way works. I suspect the vat animation isn’t updated in the pick texture.
Took less time than I tot, yay!
1 Like
I’ve identified the cause and am currently considering how best to fix it. Please stay tuned.
Oh, and thank you so much for providing the PG. Thanks to that, I was able to identify the root cause of the problem very fast.
This PR resolves the issue.
master ← noname0310:shadermaterial-instanced-vat-fix
opened 05:43AM - 15 Nov 25 UTC
This PR resolves the issue https://forum.babylonjs.com/t/missing-doc-for-gpupick… er-in-v8-31-3/61295/8
I noticed that `PrepareAttributesForBakedVertexAnimation` does not function correctly in `ShaderMaterial`. The reason is as follows:
https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/core/src/Materials/materialHelper.functions.ts#L415
```
const enabled = defines["BAKED_VERTEX_ANIMATION_TEXTURE"] && defines["INSTANCES"];
if (enabled) {
attribs.push("bakedVertexAnimationSettingsInstanced");
}
```
`PrepareAttributesForBakedVertexAnimation` checks whether `BAKED_VERTEX_ANIMATION_TEXTURE` and `INSTANCES` exist in the defines to determine whether to add the `bakedVertexAnimationSettingsInstanced` attribute to the list.
However, `ShaderMaterial` stores the define list as a sequence of `“#define DEFINENAME”` entries, causing it to fail this test.
<img width="847" height="379" alt="image" src="https://github.com/user-attachments/assets/36c2d576-334e-4486-8786-d92f8637f7d0" />
This is what it actually looks like when executed on the `ShaderMaterial` in the Edge debugger.
Therefore, I specialized this logic to suit `ShaderMaterial`.
This approach was chosen based on the observation that specialization had already been performed in the logic for assigning Bone's Define and Attribute within `ShaderMaterial`.