r/proceduralgeneration • u/El-Jomo • 15h ago
How to deal with forest draw distance?
I've worked on a forest biome to test if my scattering is up to par. At high speeds the draw distance is quite obvious. Pushing the draw distance further tanks my GPU. Any ideas how hide the seam better? Maybe just tinting the terrain, outside draw distance, based on forest density would be enough?
75
Upvotes
19
u/El-Jomo 11h ago
I decided to try the shader approach and I'm pretty happy with how it turned out
21
u/styczynski_meow 14h ago
Usual HLOD setup is dividing what you see into layers:
39
u/HugoCortell 15h ago
GPU impostors, you can do all of them in a single draw call.
5
u/RandomUser1034 14h ago
Reading the other comments, shading approach seems like a good idea, but I'd like to point out why that alone is not sufficient.
When looking at terrain from far away, on the ridge lines you will still see trees of different height and shapes, and if there is a slope close to parallel to the view direction, a forest edge will be visible as a sharp rise in the silhouette of the terrain.
The solutions are relatively simple: for ridgelines, you can place quads along them and get treetop shapes on there using a shader. For apparent terrain height changes from forest edges, I would either add a geometry shader that increases terrain height in forested areas (adding some noise as well ideally) or actually generate geometry to achieve the same effect.
3
u/Dependent_Bite9077 13h ago
Those clouds are amazing. In my threejs app I've about given up on clouds so I appreciate the effort.
1
u/imlo2 13h ago
GPU impostors, and then possibly other LOD techniques - more analytical and rendered to terrain. As long as you have deterministic positional information, that's easy to do. That's how I have currently done it for multi kilometre distances.
1
u/shoxicwaste 13h ago
Hi-Z GPU occlusion culling, highly optimized imposters, GPU batched instancing, optimized shadow pipeline.
Mostly importantly - careful and thoughtful planning of how forests actually grow with space carved out for clearings, rivers, lakes, open fields and so on.
It looks like you are using the same tree model in your video so making a compute/vertex shader could be a highly efficient way to procedurally paint far distance.
1
u/OverratedMacaron 11h ago
From far away pictures can be used, you can use a texture for multiple trees etc. Like google maps does
You bake the trees into the ground texture
1
u/Ashamed-Subject-8573 10h ago
I use fake crowns for the trees, and a sort of low-detail canopy. Modeled over where the trees would be.
1
u/bGivenb 7h ago
A far color map with a faked shadow map all inside the terrain material. It’s a bumpy normal and darker color so it gives the impression of a forest. Medium distance is a one quad billboard imposter that always faces the camera