Three-nanite: Unreal Nanite in Three.js
github.com
github.com
That way I could see exactly which meshes are being rendered (w.r.t to the reference), and then rotate around the scene (as a viewer) to get a better idea of where mesh cutting/optimizing is happening.
Right now, all I see from these demos are highly performant scenes with rabbits in them. I want to peek behind the veil and see how deep the rabbithole actually goes!
I loved it so much I built it into every engine I worked on from then on - I added it to the PSP game Bloodlines (the only other Assasin's Creed game to feature Altair) and it literally saved us many milliseconds because we had a unknown goof in our frustum culler which was allowing many large buildings BEHIND the camera to get through to the very expensive CPU clipping routines. Certainly there are other ways to accomplish this but a visiual tool is so excellent.
On Unreal Engine 4 - I didn't have to make this myself since a third party made the exact thing and shared it and I could use it since UE is source available and you can share and incorporate cool features from other studios.
So, yeah I agree wholeheartedly - and I guess the thing is - I or you or someone else could make this for UE5 since it's source available and you can build the entire engine with this awesome tool idea.
I also wish to see a nanite demo that doesn't try to explain simplified mesh clusters with alternating colors, but rather just thick outlines on the boundary of the original texture, since I find the colors distracting.
https://jms55.github.io/posts/2024-06-09-virtual-geometry-be...
https://jms55.github.io/posts/2024-11-14-virtual-geometry-be...
You can download Bevy https://github.com/bevyengine/bevy, and run `cargo run --release --examples meshlet --features meshlet`. After it compiles you'll get prompted to download a bunny.meshlet_mesh file. Click the link to download and create and place it in the appropriate folder, and then run the example again.
There's also this video from the Bevy 0.14 release notes demonstrating it, but performance/quality has improved a _lot_ since then: https://bevyengine.org/news/bevy-0-14/many_bunnies.mp4
The WASM distribution channel is a huge potential selling point for Bevy. You don't get that with Unreal, and AFAIK, with Godot either. And because it's Rust, you get a way better type system and story around deploying to consumer devices than Three.js.
Please show this stuff off in the browser!
For virtual geometry specifically, it makes use of 64-bit integers and atomics, which are not supported on WebGPU at the moment, only the native Vulkan/DirectX/Metal backends. So unfortunately I can't do a web demo yet.
Hopefully the WebGPU spec will add support for it eventually, I've given my feedback to the spec writers about this :)
----
> The WASM distribution channel is a huge potential selling point for Bevy. You don't get that with Unreal, and AFAIK, with Godot either.
To clarify: if by "WASM distribution channel" you mean "exporting for the Web"--Godot has supported exporting & running projects in a web browser for around a decade[0].
(WASM has been supported since Godot 3.0[a] & is still supported in the current Godot 4.3[b][c]. Even prior to WASM, Godot 2.1 supported export for web via `asm.js`[d].)
Godot even has an editor[e]... :) which also runs in a browser via WASM[f].
That said, yes, you're correct that WASM support in both Bevy & Godot is a selling point--particularly because people often use Game Jams as an opportunity to try out new game engines and as "everybody knows" no-one[i] downloads executables from game jams so you'll get way more people trying your game[j] if they can play it in a web browser.
----
[0] The oldest `platform:web`-related issues tracked date back to 2015.
[a] https://docs.godotengine.org/en/3.0/getting_started/workflow...
[b] https://docs.godotengine.org/en/4.3/tutorials/export/exporti...
[c] The move to the new rendering architecture (OpenGL vs Vulkan vs WebGL) in Godot 4.0 has had an impact on which exact features are supported for web exports over time.
[d] https://docs.godotengine.org/en/2.1/learning/workflow/export...
[e] A light-hearted tongue-in-cheek jab played for cheap laughs with my only defense being that I've used both Godot[g] (since 2018) & Bevy[h] (since 2022) for 2D/3D game jam entries of varying degrees of incompleteness; participated in both communities; and am supportive of both endeavours. :)
[f] https://editor.godotengine.org/releases/4.3.stable/godot.edi...
[g] https://rancidbacon.itch.io/sheet-em-up
[h] https://rancidbacon.itch.io/darkrun
[i] (Rounding down.)
[j] My own most complete & played game jam entry was (unexpectedly) this Incremental/"Clicker Jam" entry inspired by a childhood spent dismantling electronics: https://rancidbacon.itch.io/screwing-around
Keep it up!
Wish you had setup a video recording with metrics to compare over time and then you could just concat them together to show how its been improving over time visually.
I think if I had to spend time recording and putting together videos, I would never get any programming done haha. Putting together the blog posts are pretty taxing as it is.
"The only issue I ran into is that the tangent.w always came out with the wrong sign compared to the existing mikktspace-tangents I had as a reference. I double checked my math and coordinate space handiness a couple of times, but could never figure out what was wrong. I ended up just inverting the sign after calculating the tangent. If anyone knows what I did wrong, please open an issue!"
Registers 700,000 triangles even when there's nothing visible on-screen, just because the Stanford rabbits happen to be nearby in terms of LOD.
Even something "simplistic", like LOD quadtree culling with a view frustrum would probably dramatically reduce triangle counts and speed up rending even further.
That said, still an impressive demo, and compared to what I often see done with three.js, really fast rendering speeds for the sheer quantity of instanced geometry being shown.
On pretty mediocre old hardware, circa late 2010's Celeron with integrated graphics, getting 20 fps near-field in about the worst case of display, and 40 fps with the far-field heavily LOD reduced.
You could just cull an entire object, but the larger the associated geometry, the more unnecessary geometry you keep out of the viewport. This defeats a large selling point of virtualized geometry. It's not just about clustering and simplifying meshes from an extremely high detailed source, but also rendering the portions that are actually important.
That being said, this implementation is very cool as it stands. It addresses arguably the most important actual parts of virtualized geometry, I think.
- switch to software rasterization for small triangles. This required a good heuristic to choose between whether to follow the hardware or software path for rasterization. It also needed newer shader stages that are earlier in the geometry pipeline. These are hardware features that came with shader models 5&6.
- using deferred materials which drastically improves their ability to do batched rendering.
It's actually the result of decades of hardware, software and research advancements.
The 2 solutions posted in recent days seem heavily focused on just the continuous lod without the rest of the nanite system as a whole.
Also yes, there were also challenges around the sheer amount of memory for such dense meshes and their patches. The latest nvme streaming tech makes that a little easier, along with quantizing the vertices which can dramatically lower memory usage at the expense of some vertex position precision.
So it’s only really practical because GPUs have the power to render games with a certain level of fidelity, and RAM and SSD size and speeds for consumer gear are becoming capable of it.
Also there are significant benefits for a developer, especially if using photogrammetry or off-the-shelf high-detail models like Quixel scans, so there’s a reason Epic is going all-in.
AMD should also be coming out with something like this soon, maybe when RDNA4 launches. Just yesterday they released their DGF SDK, based on the paper they published a bit ago for basically the same thing as Nvidia (except Nvidia does the compression in hardware with an opaque format, rather than leaving it up to devs to implement an open format via an SDK).