Feature - Better Grass (LOD) #124
spimort
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For the past month or so, I've been working on improving the foliage in TerraBrush. I was unhappy with the way it worked.
The way it works right now is by using GPUParticles. I just place them in around the player, in rows/columns, with a space of 1m between each. Then, a random is applied to the position so it's not too square-ish.
It works, for the most part, but it does not take too long that there are too many blades and it starts to lag.
The particles are emitted every 0.01s, to create a stable grass. I guess it's too often if you have too many particles.
Also, sometimes, it was flickering. I assume that it's due to how ofter the particles are created.
I tried several different ways to do what I wanted.
What I decided to do, at least, for now, is to implement a clipmap, similar to what we have for the terrain itself, but with the foliage.
It was a long process but I think it's worth it.
So it adds LOD to our foliage 🥳
Don't worry, you won't have to repaint anything it uses the same information for the foliage so it's a dropin replacement.
So you can imagine something like this :
In the middle (the camera position), the foliage is more dense. If you go far, you can still see some blades of grass, but way less.
This way, I'm able to place more mesh on the ground for the same perfs or better.
With the LOD settings, it gives you way more options to drive how the foliage is generated (density, distance, etc.).
Also, I switched over to MultiMesh, it seems faster and more stable.
I'm gonna make a video for it when it goes live.
Anyway, I'm done with the feature, I think. If someone is willing to try it, and give me some feedbacks (before it goes to main), it would be much appreciated :
#123
Also, there is now a setting that let you choose for the foliage strategy, so if you still want to work with the previous thing, I still support it.
Beta Was this translation helpful? Give feedback.
All reactions