BabylonJS / Babylon.js

Babylon.js is a powerful, beautiful, simple, and open game and rendering engine packed into a friendly JavaScript framework.
http://www.babylonjs.com
Apache License 2.0
22.75k stars 3.39k forks source link

BoundingBox helper: add batch methods #15225

Closed Popov72 closed 1 week ago

Popov72 commented 1 week ago

You can now do:

await BBHelper.batchInitializeAsync(meshList);
BBHelper.batchProcess();
<...update animation...>
BBHelper.batchProcess();
<...update animation...>
BBHelper.batchProcess();
...
await BBHelper.batchFetchResultsAsync();

This will calculate bounding boxes that are the union of all the bounding boxes computed by each call to batchProcess.

The existing API (computeAsync) still exists, this PR is not a breaking change.

Note: I'm not sure if the new methods have the right name...

bjsplat commented 1 week ago

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). To prevent this PR from going to the changelog marked it with the "skip changelog" label.

bjsplat commented 1 week ago

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s). To prevent this PR from going to the changelog marked it with the "skip changelog" label.

bjsplat commented 1 week ago

Snapshot stored with reference name: refs/pull/15225/merge

Test environment: https://babylonsnapshots.z22.web.core.windows.net/refs/pull/15225/merge/index.html

To test a playground add it to the URL, for example:

https://babylonsnapshots.z22.web.core.windows.net/refs/pull/15225/merge/index.html#WGZLGJ#4600

Links to test babylon tools with this snapshot:

https://playground.babylonjs.com/?snapshot=refs/pull/15225/merge https://sandbox.babylonjs.com/?snapshot=refs/pull/15225/merge https://gui.babylonjs.com/?snapshot=refs/pull/15225/merge https://nme.babylonjs.com/?snapshot=refs/pull/15225/merge

To test the snapshot in the playground with a playground ID add it after the snapshot query string:

https://playground.babylonjs.com/?snapshot=refs/pull/15225/merge#BCU1XR#0

bjsplat commented 1 week ago

WebGL2 visualization test reporter:

https://babylonsnapshots.z22.web.core.windows.net/refs/pull/15225/merge/testResults/webgl2playwright/index.html

bjsplat commented 1 week ago

Visualization tests for WebGPU (Experimental)

https://babylonsnapshots.z22.web.core.windows.net/refs/pull/15225/merge/testResults/webgpuplaywright/index.html