Procedural Foliage Volume for Grass?

I’m using my own static mesh as landscape, and trying to use a Procedural way to populate it. Procedural Foliage Volume does a good job for non-dense objects(trees, rock, bushes etc.), but for grass I can not figure out how to do it.

What is the best way for GRASS population?
Side note: i don’t use landscape materials.

You could roll your own? That’s what I have done on a number of occasions…

1 Like

I tried making a plugin on c++ but I couldn’t… no tutorials, no beginner-friendly API documentation. Maybe there is the way to manipulate foliage instances through actor script, but i can’t find any information how to do it.

I just did it in blueprint. There’s not a lot to it, but it really depends on your requirements.

I’m putting procedural foliage on spheres, so all the engine stuff is out.

This is procedural foliage on a sphere, all of it… ( buildings etc )

ezgif.com-gif-maker

1 Like

Wait whaaaa??? This is sick. Is it just Blueprint ACTOR? How do i google it?

It’s all to do with using instanced static meshes ( or hierarchical ).

The basics are

  1. Make a HISM actor

image

  1. Add instances of it

image

  1. I found that setting the transform after placing worked best:

You need one HISM for each foliage type.

For your needs ( totally guessing here ), I’d say a collision box would do the trick. The blueprint can choose random points inside the box and do line traces to the landscape or mesh, and put the foliage there. Easy to add height sensitivity later etc.

Tell me if you can’t get it working, and I’ll drop some basic code in here.

:smiley:

1 Like

Hello,
I want to spawn foliage on sphere. Can you show full blueprint?

I will come back later about this, it’s non-trivial…

I can’t drop the whole BP in here, because it wouldn’t make any sense to you. It has all sorts of stuff you don’t need to get this working.

Let’s get the first step working, which is spawning meshes on the surface of the sphere. If you get that sorted, we can expand it to do HISMs, which is how the foliage system works.

So the basic setup, is to have a loop, get a random unit vector, multiply is by the radius of there sphere and then plonk the mesh there:

followed by

( don’t worry about my planet being a BP for now, as long as you put a big sphere at 0,0,0 and use the radius here, it will work ).

Now you can just spawn the mesh at the location

Tell me how it goes…

I started implementing your blueprint snapshots but I am having difficulties because Iam not good ad blueprints. I use UE4 with C++
I spawned sphere and edited it Event Graph. After BeginPlay I’ve put for loop but I dont know where to find SET Random Unit V.

Here’s a basic setup for you. The blueprint just contains a sphere

The construction script goes like this:

With sphere scale 8 and 35 for N, I get:

And I can change the scale and the number

cons

and I can replace the cube with a tree

2 Likes

Works beautifully, thank you !

1 Like