Hey just noticed that when I export basic scene I also export physics engine which adds 2 mb download for client any clue whats that and if I can just throw it out?
by user 135497451858690049
Hey just noticed that when I export basic scene I also export physics engine which adds 2 mb download for client any clue whats that and if I can just throw it out?
by user 135497451858690049
Hello, this is on the roadmap to be changed and to only load/be included when you use any physics component / explictly install it. Itβs something we want to get rid of too
Haha, literarily same mistake I made when creating my homebrew exporter. It was a major pain to untangle physics engine from three
by user 135497451858690049
It shouldnt be a major headache i hope since only few components use it directly. But there are some other things coming first in the version 3 (next week i think) and then we can work on some sort of plugin system / move the physics into their own package maybe. Not 100% sure yet what the best way is
Godspeed!
by user 135497451858690049
Only collider and rigidbody components know anything of it actually and they also just call one already abstracted layer. Just need to move it out or refactor to load lazily (in which case we could keep everything as is and if you start using physics sometime later it could load which would also be a nice option)
And obviously not bundle rapier with the engine then. All that is to be figured out
Gotcha, thanks for quick reply
by user 135497451858690049
by user 135497451858690049
Do you have any link to your custom engine? Just curious.
Nope itβs super crude
by user 135497451858690049
And thanks for asking. So far nobody asked actually haha but just today when updating the vanilly js sample it totally bothered me again how big the js file is mainly because of physics
But I pack into three compatibilile JSON
by user 135497451858690049
which was a major pain to convert verticies and lightmaps still act weird very often
by user 135497451858690049
A custom json format? Or you serialize to threejs objects from json?
Three has its own json format, I made schema for that and serialize into it
by user 135497451858690049
Gltf was the right decision for us. You can put everything in extensions and load it in three or another tool that has gltf support.
Ah ok i see
It was 100%
by user 135497451858690049
The very first version we had heavily relied on js codegen as well. That wouldnt have scaled tho and now we can relatively easily build files that are kind of like a fully serialized scene (it could replace a complete unity scene asset at some point even with interop to blender for example. Its super cool)