To run my demos smoothly, I needed the best LOD thresholds with meshoptimizer.
So I built a tool that also writes InstancedMesh2 code.
5,000 animated characters: 76M โ ~500K triangles.
More to come, ideas and criticism welcome!
Link below ๐
#threejs#webgl#webgpu#gamedev
@okean0807 Screen space is a bit slower but I donโt know if itโs noticiable. With the tool you can switch from screen space to distance mode anyway.
But if you use distance, the object scale is not considered. I can prepare a benchmark
@JE4NVRG With dead tree models, because of the many branches I had to edit parameters manually as the popping was too noticeable. For trees with leaves, I think I prefer octahedral impostors instead. Iโve to release a library for that as well, given that I already had one almost done.
@0xdoppo Well, with the editor, you can see the transitions between one LOD and another based on screen space, and you can fine-tune the thresholds beyond the automatic ones
@VolpatoDavide The values are auto generated when you load a model, but you can edit all of them afterward, so you decide the trade-off between performance and quality. In this case I'm quite happy with the result even in automatic mode, but with some models I had to make manual adjustments.
@arshadbarves The generated code is for InstancedMesh2, which supports per-instance frustum culling and, of course, LODs. It also supports BAT (I wrote a post about it). Iโll be adding more flags related to BAT soon ๐
Iโve finally had a bit of time over the last few days to finish this duck project ๐ฆ
Itโs been made using #threejs (webgpu only) and #Claude
I hope you like it!
๐ซถ https://t.co/rArXiUXVln
@SudhanshuS67445 Yes, a bit but only fading instances pay for it. A bone matrix is 3 texels; a vertex blends 4 bones at 2 frames, so 24 reads. A fade also samples the outgoing clip, so 48, skipped once the fade ends. Far LODs read the nearest frame with 1โ2 bones: as low as 3 reads (no lerp).
Bone Animation Textures are now in InstancedMesh2 ๐ฆด
Skeletal clips are baked once into a GPU texture, and every instance plays its own clip, speed and crossfade. No per-frame CPU animation.
10,000 skinned monsters, WebGL, WebGPU.
Link in the next post.
#threejs#WebGPU#WebGL
@quaternius They are essential for the demos Iโve written and will be publishing over the coming weeks. Iโm gradually using almost all of them ๐ Iโm glad you saw this post
@peak__ai Yes, with InstancedMesh2 is possibile, even if this feature is still in beta.
Now getBonesMatrixAt works only on cpu side, even with BAT but it can be optimized for your specific case.
Do you want to try it? Itโs open source, ping me if you want.
@kar_umit For simplicity, in this demo they all move at similar speeds, with each walk/jog/sprint clip tuned to match. Each instance has its own playback state though (clip, time, speed, loop), so you can change its speed on the fly with no pose pop. Iโll make an example also on that ๐