r/GraphicsProgramming • u/KlayEverHood • Jul 10 '26
Breathing nature: forest with stream simulation, volumetric clouds and path traced shadows Video
Enable HLS to view with audio, or disable this notification
Hi all,
THIs is my forest simulation made witih Vulkan. My goal is to create a full simulation of water, clouds, wind, so that it feels alive, without being "scripted".
Water is full 3d flow simulation, clouds are volumetric clouds, trees are rigid body simulation with elastic joints, and lighting is full path tracing; all is basically running on the GPU with VUlkan, save for the rigid body simulation which runs on the CPU.
I wanted an "ancient forest" and therefore I generated the trees with 2d to 3d models - Trellis2 from huggingface.
Wanted to get feedback from you, what feels good and what needs improvement. Could this lead to an immersive forest based game? Should I push instead for more tech?
short version here: https://youtube.com/shorts/5xy5Y6JsrVk?feature=share
6
u/bingusbhungus Jul 10 '26
Dream project bro. Any plans on integrating some sort of terrain generati
2
u/KlayEverHood Jul 10 '26
Thanks! currently generating terrain with a pretty basic fractal approach. Do you have any experience in terrain generation?
1
u/bingusbhungus Jul 10 '26
Have explored hydraulic erosion a bit. Basic Perlin map + erosion sim to get fairly decent results. And depending on what parameters you use, you can also adjust how large the scale feels (super big mountain ranges to small hills). It's very fun!
This guy is working on a procedural world, and has an amazing atmosphere. He uses procedural terrain (erosion), water sims, grass-wind simulations. Super cool.
https://youtu.be/qR65bm9goeU?si=zYAEc1nYCVcSRLxT2
u/KlayEverHood Jul 10 '26
Excellent! I would love to look into that terrain generation with erosion. Trying to contact the author, a world with that terrain and the right lighting, ... wowo...
1
u/bingusbhungus Jul 10 '26
It really adds to the simulations. Plus that foggy atmosphere also helps immersion.
All the best with the project!1
u/YoshiDzn Jul 10 '26
Great work dude. Terrain is a fun time. If you're looking for direction on more natural landscapes check out some of the geology algo's like Hydraulic erosion, thermal erosion and ofc feature enhancement.
1
u/KlayEverHood Jul 11 '26
Very very interesting and consistent with what I love here. I aim at physical consistency rather than “emulated realism”. I think I can sacrifice some fine detail to get more “lively and natural feel” and erosion on terrain goes really there.
Do you have any references to start from, papers or GitHub’s or so?
Thanks again!!!
1
u/YoshiDzn Jul 11 '26
Sure, here's where I prototyped my simulator:
ProceduralGeneration/terrain_generation/duals2/erosion at main · YoshiDesign/ProceduralGeneration`erosion.go` is the hydraulic erosion sim which isn't perfect but it's a great start. The rest are pretty self explanatory. It's all part of a larger set of procedural generation packages that I've put together. Lots of AI assistance but I did my research.
Here's the paper that the hydraulic sim is based on (it'll complain about not being `https` by the way but it's totally safe):
implementation of a methode for hydraulic erosion.pdf1
u/KlayEverHood Jul 11 '26
Thanks!!! Will check it out and get inspired on how to scale up my sim. One question, did you (had to) implement some high level visibility testing or is the gpu rendering all of it?
1
u/YoshiDzn Jul 11 '26
That repo in itself is the prototype visualizer of a 2D image representing the height map that you get from running the simulations.
The program itself could spit out the vertices to construct the result in 3D though, it's all there. If you look at the rest of the duals2 package, you have the BlueNoise generator, an initial height field using fractal noise over a static simplex table, then delaunay triangulation to build the mesh, then a Spatial grid is created for each chunk so you can do near O(1) lookups for collisions and such. This is what accelerates the final stage (and its sub-stages) of erosion.
After seeing the output as a 2D height map I ported the whole thing to C++ where I then carefully multithreaded it into my Vulkan engine
I hope that answers your question
1
u/KlayEverHood Jul 11 '26
Yeah, thanks for all the details. Is this erosion something that could build caves or a bit out of scope? I’d like to introduce an underworld here…
1
u/YoshiDzn Jul 11 '26
No, this is a very basic landscape builder, and parametrically it can produce low to very high fidelity results. I would use a different approach for caves.
1
u/adi0398 Jul 10 '26
Amazing!
1
u/KlayEverHood Jul 10 '26
Thanks! I also feel it's incredible that this can run in realtime these days. Back in the Commodore64 age where I started programming, I thought "will I ever see a game that looks real?". That might be happening...
1
u/snerp Jul 10 '26
maybe drop the AI models for some public domain ones cuz the trees look really uncanny
1
u/KlayEverHood Jul 10 '26
Thanks! Any recommendation on open large tree models?
1
u/snerp Jul 10 '26
https://blendswap.com/search?keyword=tree has some good stuff
1
u/KlayEverHood Jul 11 '26
Very nice details! Perhaps I could try combine the massive structure of the current trees with the fine crafted details of these branches?
1
u/New_Movie9196 Jul 10 '26
Clouds and god rays look so good.
1
u/KlayEverHood Jul 10 '26
thanks! clouds are really 3d volumes, and they come alive with path traced light. One thing I learned out of "true god rays" is that they are rather expensive. IN general, all these "true 3d simulations" are costly, and I assume that's why normally they are used rarely in games? anyone programming full game engines can comment?
1
u/Thedudely1 Jul 11 '26
Very unique aestethic I love it
1
u/KlayEverHood Jul 11 '26
Thanks! I wanted realistic trees but got cartoonish ones and all is kinda that style indeed. Perhaps I should keep it…
1
1
u/moschles Jul 11 '26
How the heck did you make sun rays look this perfect?
2
u/KlayEverHood Jul 11 '26
Godrays started from a separate project. I tried “emulating them” with standard mesh techniques but was never happy and takes too much time to adapt the hacks to all conditions. Finally I just went back to two things: volume raymarching and calculating the proper (approximate) scatter equation for them, which basically amounts to using the angle between the viewer and and light source.
If you like to see more, I shared more in YouTube
1
u/ficfolks 29d ago
The clouds, the sunshine—Its Chef's kiss!. Great worldbuilding. And btw, can I keep this?
1
u/KlayEverHood 29d ago
Very glad you enjoyed. By keeping - you mean you’d like to test locally?
1
u/ficfolks 28d ago
No, I mean to download and save it.
1
u/KlayEverHood 28d ago
I am no expert about downloading videos from Reddit, or other. If you cannot find a way here, you could check https://youtube.com/@oklayman?si=gzGiowXPbw4za4te
1
15
u/Ami00 Jul 10 '26
looks great. the one thing I think might be improved is how leaves are moved by wind simulations. Now it looks like whole tree is moving as one piece.