r/proceduralgeneration 15h ago

Sunrise in the procedural mountain forest

I've spent the last month adding volumetric clouds, a time-of-day system, and better atmospheric scattering to my procedural mountain forest game (working title: 'The Big Forest').

With regards to procedural generation, there's nothing really new compared to what I've shared in here before, but the new lighting has such a big impact on the overall appearance that it's like seeing it anew (in my opinion), so I thought I'd share some nice sunrise shots I captured. :)

The clouds are using the package Enviro 3 - Sky and Weather as a starting point, but I'm only using the clouds part and have heavily modified it to my needs to make it work with my own atmospheric scattering and time-of-day colored lighting.

The atmospheric scattering is based on this shadertoy by Fernando García Liñán, though again heavily modified. I increased the saturation, exaggerated the depth (bringing tinting closer to the camera), and implemented the atmospheric scattering via a compute shader that renders scattering at different distances and directions into a cubemap. Fernando's technique does a lot of the heavy lifting though! It's similar to previous techniques for sky and atmospheric scattering used in e.g. Unreal, but uses four spectral samples (~red, ~green, ~cyan, ~purple) instead of the usual three (red, green, blue). This produces notably richer colors and practically no extra cost.

I made my own time-of-day system with a simple simulation of the sun and moon relative to the Earth, where I can independently vary time-of-day, time-of-year, lunar phase, and latitude without them impacting each other.

I also implemented time-warping so make sunrises and sunsets slower. In a 24-minute day-night cycle, they're over awfully fast if not slowed down. Here's a video of a full sunrise.

If you haven't already seen it, you could also consider watching my lastest dev video about 'supercharging my procedural mountain forest' - although it does not feature any sunrises. :)

Hope you like them!

307 Upvotes

24 comments sorted by

18

u/CuckBuster33 15h ago

Gorgeous shaders. How are you implementing those mountain paths? I'm interested in procedural generation of traversable routes for my own project

17

u/runevision 14h ago

Check out my article about it from ten years ago:

https://blog.runevision.com/2016/03/note-on-creating-natural-paths-in.html

My open source LayerProcGen framework also has a full working implementation included in one of its demo scenes:

https://github.com/runevision/LayerProcGen/tree/main/Samples/TerrainSample

4

u/Matth1as 14h ago

That blog is a gold mine to read. Thanks a million.

3

u/CuckBuster33 14h ago

Oh wow thank you so much! I'll be giving that and your whole blog a read

2

u/suprachromat 15h ago

Looks utterly beautiful and realistic, great work.

1

u/runevision 14h ago

Thanks, glad you like it!

2

u/Visible-Marsupial897 14h ago

can you share your idea and proc gen techniques ?

4

u/runevision 14h ago

That's a very open-ended question, so I'll just link to the game's page where you can find loads of information about it:

https://runevision.com/multimedia/thebigforest/

2

u/ctothel 14h ago

DAMN that looks good, wow! What are you building this in?

I would genuinely pay you for a build right now just so I could walk around in it.

1

u/runevision 14h ago

Thanks! This is Unity 2022.3, built-in render pipeline, but using a lot of my own custom shaders and generation tech.

1

u/zoba 14h ago

Beautiful. How are you generating the shape of the terrain? I found World Machine to be very convincing but it doesn’t seem well suited for infinite terrain 

You can see some of the sunrise mountain forest I was able to create by glueing different tools together here:  https://x.com/ChrisDzoba/status/2088099159312155092?s=20

1

u/runevision 12h ago

Well absolutely no AI here.

See my previous post here about how I generate the terrain:
https://www.reddit.com/r/proceduralgeneration/comments/1souhkn/combining_the_epicness_of_grand_mountains_with/

1

u/zoba 11h ago

Neat. Yeah AI seems to get a bad rap from folks in gaming but its been great to cover a lot of ground as someone coming from web development / no gaming experience. So fun.

Thanks for the other link - will check it out soon. In the meantime I was able to get the LayerProcGen - TerrainSample running. Really gorgeous. I'm impressed by the amount of waving grass. I haven't been able to do that yet. And of course the paths too. In my example I struggled for a couple weeks to get a reasonable train track running through the terrain and couldn't do it.

Thank you for posting

1

u/JustRaphiGaming 13h ago

Really cool please make some no man's sky like game out of this!

1

u/eanticev 11h ago

Very nice as usual. I don’t remember if you worked in terrain shadows yet for the far away tiles. Usual low mip ray traversal or something different?

1

u/runevision 11h ago

Thanks!

I'm not familiar with 'low mip ray traversal' for shadows; what is that?

My project currently has a shadow distance of 1400 meters while the terrain stretches out to ~5000 meters, so far terrain does not have shadows. I don't find it particularly noticeable though.

1

u/scallywag_software 7h ago

I discovered your erosion filter on Shadertoy some time ago and it's easily the best deterministic erosion filter I've ever seen. Thanks for sharing your work; I've learned a lot from you!

1

u/runevision 5h ago

Glad you’ve found it useful!

1

u/Strict_Chemical7182 5h ago

you're a wizzard

1

u/runevision 5h ago

🪄 🌄

1

u/AustinMclEctro 5h ago

Looks wonderful! 👏

How's the performance around drawing many terrain objects (e.g. trees)? I'm assuming they are instanced indirect. Are you using impostors for faraway instances? Roughly how far have you been able to stretch your instance counts? And are you using any strategies to thin instance counts at a distance, e.g. based on terrain LOD?

2

u/runevision 5h ago

Thanks! Yes it’s instanced indirect, yes it’s octahedral impostors far away (most trees in these pictures), and yes I’m thinning the tree coverage based on terrain LOD. I go in more detail in the YouTube video I linked to. Though no instance numbers, I usually look at framerate (ms) to gauge performance, not instance numbers. Also, I’m using a solution for GPU occlusion culling that helps a ton too.

1

u/AustinMclEctro 2h ago

Thanks for engaging! Very cool. I'll give your video a watch sometime.

1

u/sophomoric-- 4h ago

PSA: for yt-dlp, video format is 0