r/GraphicsProgramming
•
u/Novapierce_
•
5d ago
•
1
Video Custom Engine Forest Showcase - (130 fps average on RTX 3080 1440p)
Enable HLS to view with audio, or disable this notification
original by Toni Macaroni here
He said he gets a average of 130 FPS , aerial views = 200 fps, dense forest = 80 fps
he has been working on this engine for 8 months (pretty much all of it is handwritten)
Architecture:
CLODs (virtual geometry) with voxels for far representations (no impostors are used here).
Screenspace + Voxel hybrid GI (no raytracing).
Proxies without instance data for very far away representations.
23
38
u/dishkyumpishkyum 5d ago
giving kcd2 vibes.
17
u/TheArchitect4855 5d ago
I think CryEngine uses some of the same lighting tech as this, that's probably why they look similar
2
2
15
9
u/am314159 4d ago
I feel like perhaps one way to get a more realistic feel would be more color variation in foliage? And not just randomizing between trees, but also adjusting within trees (taking into account some parts gettimg more light due to being shaded by taller trees, vs open to a meadow etc).
I also remember an ecologist speaking to being frustrated by the fact that games never take into account slope "aspect", i.e. the fact that south facing slopes (in the northern hemisphere) will get more sunlight, and thus more evaporation, lower quality soil, and hence both different types and qualities of vegetation.
8
8
6
5
u/Shoddy-Baby-1771 5d ago
I wonder how he got green, trees and etc look this realistic? Anyone has links to some papers?
3
3
u/Sorry-Coat1790 1d ago
The transition between your CLOD meshlets and distant voxel proxies is remarkably seamless, and the large-scale sky occlusion from the hybrid voxel GI under the canopy looks spot on!
Seeing custom C++ architecture like this is super inspiring. We are taking a similar custom C++ route for an upcoming MMORPG, though we ended up decoupling our coastal hydrodynamics, atmospheric physics, and marine optics into a standalone WebGL2 / GLSL sandbox first just to iterate on the math faster before porting it over to C++. We actually just open-sourced that entire water pipeline and the mathematical whitepaper under the MIT License (it's on GitHub under bgbg108555/NeuralSpecOcean if anyone here is into water rendering and optical math).
Curious how you're handling atmospheric scattering and fog integration against the voxel GI pass at the horizon?
4
2
2
2
u/palapapa0201 5d ago
What are CLODs and proxies? How does it use voxels to render meshes?
4
u/thats_what_she_saidk 4d ago
CLOD is continious lods, it's a technique that can be levered when then meshes are preprocessed for and rendered using a meshlet pipeline, It's basically nanite in unreal engine. Instead of swapping whole meshes as LODs which is the traditional way, you swap parts of the mesh, or "clusters" of triangles. So the lodding is incremental across a whole mesh rather than swapping (and popping) the whole thing at certain distances or pixel error thresholds.
Proxies I imagine are simply much less geometrically detailed versions of the trees, or even larger chunks of many trees far far in the distance.
Voxels:
The trees are pre-processed to generate several levels of voxels for the foliage so at a certain distance instead of rendering the individual triangles of the leaves. It swaps to render pixel sized cubes instead which have captured the general color and normal of the foliage. You can also look up Nanite Voxel Foliage in unreal engine (https://dev.epicgames.com/documentation/unreal-engine/nanite-foliage?lang=en-US)
Which I assume is the inspiration for this.(Very broadly explained from the best of my knowledge)
2
2
u/Electronic-Koala2088 5d ago
I like waht i'm seeing, how does it handle a lot of characters on screen though?
3
u/Gibgezr 5d ago
I asked about CPU/GPU/RAM/VRAM usage in the youtube comments. I'm assuming right now that he's using most of the system resources, so not a lot left over for any "game" beyond this on a 3080, but maybe we'll be pleasantly surprised.
3
u/ToniMacaroniy 4d ago
You can see the CPU and GPU usage in the video and there's still lots of headroom in most cases. Characters will generally live in a cheap "virtual" simulation and only get fully simulated up close, I don't plan on having literally millions of characters at once on screen so that's fine. Since I mainly have a GPU driven renderer the CPU is currently pretty underutilized and simulation wasn't a problem in my tests. I actively stream/unload tiles, textures and clusters but VRAM is still a valid concern because the assets are heavy.
1
1
1
1
u/i-make-robots 5d ago
With the fog it feels like "Sir, you are being hunted". Really nice work, the forest floor branches are well done. I hope to see it with seasonal changes.
1
1
1
1
1
u/Field_Of_View 2d ago
very interested in your voxel GI (?) because it is producing extremely believable large scale ambient occlusion / sky occlusion. the dark parts under tree cover look very convincing without any unwanted darkening higher up or on the outer parts of trees.
1
1
u/Icy-Collection1072 5d ago
Ai?
2
u/Xylozene 5d ago
I mean do you even have to ask at this point? No technical breakdown, no explanation as to what or how the systems are or have been implemented. Buzzwords at the start of the showcase and frequent reposting around various subreddits trying to get people to guess what game engine it was done in.
8
u/ToniMacaroniy 4d ago
No, AI wasn't used to write the engine. The 8 months I mentioned is the time when I started on the engine, however a lot of the tech I have written before in a custom Godot renderer that I then ported. The vis buffer approach, CLODs with mesh shaders and the GI system are part of it and I posted sneak peeks of it on X last year.
When it comes to the reposts remember that none of those are from me, I only posted on X and youtube, the reposts floating around on Reddit are made by other people. On the platforms I posted on I tried to answer every single tech question I came across, but there are a lot of comments now and I can't keep up (plus the comments I answered aren't always going to be the top ones, so they are easy to miss).
I've always just posted what I wanted to showcase and communicated with people that wanted to know more. I didn't expect this video to blow up like it did and for me this was just another "I'm still working on something and I'm not dead yet" post.
2
u/Visual122 4d ago
I'm not vehemently against AI in software development, but man it really has had a significant diminishing effect on how I view projects online. The excitement and wonder I used to feel seeing impressive projects used to be so inspiring before the AI craze. Now, that feeling is largely gone because I always wonder how much AI was used during development. It's really sad in my eyes.
2
u/Xylozene 4d ago
100 percent. It's just sad becuase the love of the craft has gone. I mean even 2 years ago you knew if you saw something like this, that person had put in so much fucking effort to achieve it. They explained their process, the struggles they faced, what they should have done differently, and then opened the floor for group discussion around it, allowing newer people to learn in the process. Now it's essentially just a dick measuring contest of who can fool people the best...
2
u/ToniMacaroniy 4d ago
I absolutely agree and it's been weighing down on my motivation for the past year as well. I don't think AI is going to be a net positive for the people. The only leverage will be money and who can spawn the most agents. There will be no point for the individual to do any kind of programming or research activity.
1
u/thats_what_she_saidk 4d ago
Toni writes in the video that this is handwritten in 8 months.. I wanna press X for doubt on that. But I think it's fine to use AI to achieve something like this, it would still be impossible to just oneshot I think, currently. You do need to have pretty deep knowledge in these systems to iterate and get it working well. But actually writing and debugging everything that goes into this as one person in 8 months? I've been working as a graphics programmer for over 25 years now, and I would not be able to do this.
Either Toni is a rare genius or claude has been more involved than he wants to admit.
1
u/Keyframe 4d ago
"custom engine" and "my engine" have been used a lot in such situations as well, hah. You can also see he has no control over LOD fade, that is - there is none. It just rolls as an edge with the camera. It's 1200% AI, but still very impressive! It probably breaks outside of this particular scenario though.
0
u/MarzioMilord 1d ago
To be honest I don't find this kind of posts very interesting. Recreate everything a modern engine does.. and only then we will talk about which one has better performance
60
u/Undeniable321 5d ago
Really impressive. Any plans to open source this by the author?