Commit af3fbe9
authored
GPUPicker: Fix picking ID precision issues (#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.1 parent 1e74617 commit af3fbe9
File tree
5 files changed
+4
-6
lines changed- packages/dev/core/src
- Collisions
- ShadersWGSL
- Shaders
5 files changed
+4
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
223 | | - | |
224 | 222 | | |
225 | 223 | | |
226 | 224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
0 commit comments