labris
March 28, 2025, 2:59am
1
With the dazzling arrival of the incredible Babylon 8.0, it’s time to update our favorite development template and share it with you!
Babylon.js 8 +Vite 6 Typescript Template with Havok Physics
Freshiest Babylon.js, Vite, Typescript and all other dependencies
WebGPU engine by default, WebGL2 supported as well
Havok Physics already set up and included in the demo scene
FPS Counter in the right top corner
Inspector - press Ctrl+Alt+Shift+I
Axes Viewer
Default Rendering Pipeline with FXAA and MSAA enabled
All console.log
messages are cleared in the production build
Easy to disable not needed functions (Havok, Axes Viewer, Pipeline etc)
8 Likes
onekit
March 28, 2025, 7:52am
2
Thank you for this solution!
Previously, I didn’t know about this way to exclude dependencies in vite.config.ts
:
optimizeDeps: {
exclude: ["@babylonjs/havok"],
},
Before, I used a dirty hack in my code like this:
async physicsEngine() {
const wasmBinary = await fetch('./node_modules/@babylonjs/havok/lib/esm/HavokPhysics.wasm');
const wasmBinaryArrayBuffer = await wasmBinary.arrayBuffer();
return HavokPhysics({
wasmBinary: wasmBinaryArrayBuffer,
});
}
2 Likes
labris
March 29, 2025, 2:08am
3
The small update - GitHub - eldinor/bp800: Babylon.js 8 + Vite 6 Typescript Template with Havok Physics
Tree-shaking to reduce bundle size
Inspector’s import only for DEV mode to reduce bundle size
5 Likes
Oh, I am happy to hear that!
We made a slight change to the declaration files (to support node16 and nodenext module resolutions), and though i fully tested it, anything can go wrong. So - Happy to hear that 8.2.1 is working correctly
labris
April 15, 2025, 12:41pm
7
brightMoon:
You’re really punctual
There were some things in 8.2.0 which should be corrected
Thanks!
1 Like