1
$\begingroup$

I have a VERY large area (about 2-4 sq. km) of a landscape that I need to have covered in 3D grass, like how modern 3D games do it:

An example similar to what I'm looking to make in my game

There have been a couple of problems I've been running into though whilst making said grass. In one method I tried using particle systems by switching to the Blender Internal renderer and then creating a particle system and converting them to objects so they can be used with the BGE, but this put an excessive strain on my computer with the 3D Viewport while editing being 1-3 frames per second and the game itself playing even slower, later crashing after about 30 seconds of being tortured with 5 million+ object instances and several tens of millions of polygons to render in real-time.

I made that particle system using 1 grass model that has 24 triangles and 2 LoD models for that first model that had 12 and 4 triangles respectively. Making a particle system using even the lowest LoD would require at least 6 million instances of the object with a hefty 24 million triangles to render.

So I need a way to have consistent result of grass in the manner I have described that gives results like the particle system in terms of consistency and visual results whilst being the least hardware-intensive possible.

Thanks to anyone who contributes.

$\endgroup$
3
$\begingroup$

I believe you have to rely on intersecting textured planes for this. The grass model with 24 tris is way too much (i am assuming actual strands). Additionally you have to "grow" the grass only in the player visible area, and cull it when it gets really far away and substitute with a similar ground texture (even triple A games do this, like Skyrim). Additionally don't forget to have a fustrum size of your sun lamp that doesnt cover the entire landscape, but moves with the player. Drawing shadows is very expensive.

There are more than a few tutorials on how to create good looking grass patches for all kinds of game engines and the underlying principles stay the same for BGE unless the engine uses their own custom grass system.

Here is a tutorial for 3ds max on how to do grass for UE4: https://www.youtube.com/watch?v=B4j5tzAIflU

Here is one in blender (very similar): https://www.youtube.com/watch?v=BKxUKzpx--s

And here is a demo of an implementation of a generative approach in BGE: https://www.youtube.com/watch?v=kN6ftu0H4bQ

You might also want to have a look at different BGE forks like Upbge (https://www.youtube.com/watch?v=fx9JfJyCY6I) and Armory Engine (for better performance in transparency mixing and low poly meshes etc)

$\endgroup$
  • $\begingroup$ The grass model I am using is a set of textured planes, not strands like you assume as I already knew modelling like that would be too expensive. I'd like to know how to cull objects at a certain distance like you have said to help with getting rid of slowdown while editing and playing, as when doing so with the setup I tried before it slowed down a LOT. Particle systems are really heavy on resources, especially with the millions of particles needed to cover the area I need, so an alternative would be great. $\endgroup$ – JakoNintenCraft Jan 4 '18 at 16:43
  • 1
    $\begingroup$ a. I am not sure how you get 24 tris with just planes, do you have like 12 of them in a patch? b. I am not a BGE expert but you have i believe two ways to cull the grass: 1 - spawn and despawn the grass with a near sensor (docs.blender.org/manual/en/dev/game_engine/logic/sensors/types/…) or equivalent script parented to the player position 2 - use Occlusion Culling with a transparent occlusion object parented to the player position (youtube.com/watch?v=lDbF1O1cze8) Option 1 should be preferred as you have more control over it. $\endgroup$ – AdamTM Jan 5 '18 at 8:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.