# Missing doc for gpupicker in v8.31.3

**URL:** <https://forum.babylonjs.com/t/missing-doc-for-gpupicker-in-v8-31-3/61295>\
**Category:** Questions\
**Created:** [November 5, 2025, 7:05am UTC](https://forum.babylonjs.com/t/missing-doc-for-gpupicker-in-v8-31-3/61295 "2025-11-05T07:05:27Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![phaselock](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@phaselock](https://forum.babylonjs.com/u/phaselock)\
**Post date:** [November 5, 2025, 7:05am UTC](https://forum.babylonjs.com/t/missing-doc-for-gpupicker-in-v8-31-3/61295/1 "2025-11-05T07:05:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![noname0310](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/noname0310/32/27103_2.png) [@noname0310](https://forum.babylonjs.com/u/noname0310)\
**Post date:** [November 5, 2025, 7:12am UTC](https://forum.babylonjs.com/t/missing-doc-for-gpupicker-in-v8-31-3/61295/2 "2025-11-05T07:12:06Z")

</div>

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.

> <https://github.com/BabylonJS/Babylon.js/pull/17289>
>
> 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.

---

<div class="post-metadata">

**Author:** ![phaselock](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@phaselock](https://forum.babylonjs.com/u/phaselock)\
**Post date:** [November 5, 2025, 7:36am UTC](https://forum.babylonjs.com/t/missing-doc-for-gpupicker-in-v8-31-3/61295/3 "2025-11-05T07:36:16Z")

</div>

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](https://forum.babylonjs.com/t/removing-thin-instances-vs-gpupicker/57989/4), it appears that there might be more than 1 breaking issue.

You can try [https://playground.babylonjs.com/?version=8.31.2#NNC5Y2#1](https://playground.babylonjs.com/?version=8.31.2#NNC5Y2#1) vs  
[https://playground.babylonjs.com/#NNC5Y2#1](https://playground.babylonjs.com/#NNC5Y2#1) with latest version, the console is logging very different results. Perhaps you can start with this?

---

<div class="post-metadata">

**Author:** ![noname0310](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/noname0310/32/27103_2.png) [@noname0310](https://forum.babylonjs.com/u/noname0310)\
**Post date:** [November 5, 2025, 8:26am UTC](https://forum.babylonjs.com/t/missing-doc-for-gpupicker-in-v8-31-3/61295/4 "2025-11-05T08:26:52Z")

</div>

This doesn’t seem like a breaking change, but rather a bug.  
I’m currently looking into the issue.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [November 5, 2025, 10:36pm UTC](https://forum.babylonjs.com/t/missing-doc-for-gpupicker-in-v8-31-3/61295/5 "2025-11-05T22:36:34Z")

</div>

Thanks a lot @noname0310 for looking into it and let us know if we should revert

---

<div class="post-metadata">

**Author:** ![noname0310](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/noname0310/32/27103_2.png) [@noname0310](https://forum.babylonjs.com/u/noname0310)\
**Post date:** [November 5, 2025, 11:26pm UTC](https://forum.babylonjs.com/t/missing-doc-for-gpupicker-in-v8-31-3/61295/6 "2025-11-05T23:26:33Z")

</div>

I created a PR to fix the issue. If the issue persists after the merge, please let me know.

> <https://github.com/BabylonJS/Babylon.js/pull/17404>
>
> 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.

---

<div class="post-metadata">

**Author:** ![phaselock](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@phaselock](https://forum.babylonjs.com/u/phaselock)\
**Post date:** [November 14, 2025, 12:34pm UTC](https://forum.babylonjs.com/t/missing-doc-for-gpupicker-in-v8-31-3/61295/7 "2025-11-14T12:34:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![phaselock](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@phaselock](https://forum.babylonjs.com/u/phaselock)\
**Post date:** [November 15, 2025, 1:05am UTC](https://forum.babylonjs.com/t/missing-doc-for-gpupicker-in-v8-31-3/61295/8 "2025-11-15T01:05:21Z")

</div>

Repro: [https://playground.babylonjs.com/#CP2RN9#317](https://playground.babylonjs.com/#CP2RN9#317)

Compare against [https://playground.babylonjs.com/?version=8.31.2#CP2RN9#317](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!_

---

<div class="post-metadata">

**Author:** ![noname0310](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/noname0310/32/27103_2.png) [@noname0310](https://forum.babylonjs.com/u/noname0310)\
**Post date:** [November 15, 2025, 5:14am UTC](https://forum.babylonjs.com/t/missing-doc-for-gpupicker-in-v8-31-3/61295/9 "2025-11-15T05:14:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![noname0310](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/noname0310/32/27103_2.png) [@noname0310](https://forum.babylonjs.com/u/noname0310)\
**Post date:** [November 15, 2025, 5:44am UTC](https://forum.babylonjs.com/t/missing-doc-for-gpupicker-in-v8-31-3/61295/10 "2025-11-15T05:44:14Z")

</div>

This PR resolves the issue.

> <https://github.com/BabylonJS/Babylon.js/pull/17462>
>
> 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\`.

---

<div class="post-metadata">

**Author:** ![phaselock](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@phaselock](https://forum.babylonjs.com/u/phaselock)\
**Post date:** [November 24, 2025, 1:12am UTC](https://forum.babylonjs.com/t/missing-doc-for-gpupicker-in-v8-31-3/61295/11 "2025-11-24T01:12:08Z")

</div>

Tested with v8.38.0, fix works! 🙂 Tyvm, cheers!
