Objects or particle system for foliage?


#1

Any of you guys know how to add lots of grass and trees. This is something I have never figured out. Grass you could do a particle system ,but how do you place it where you want? Using a vertex group for particle density works in blender ,but not armory. In the hair example it covers the entire plane and as far as I know, you can’t determine where the particles go.


#2

You can use weight painting to determine where to put the grass. There should be videos on that all over You tube. Then the question is if it all transfers to Armory. You would probably have to make the particle system real to have it show up correctly in armory.


#3

Your saying I would have to convert the particles to real objects?


#4

Not positive, but if it isn’t working right that is where I would check first. Others may have a better idea or have worked with something like this. What I am not sure of is if armory will translate the weight painting for the particles.


#5

Avoid particles.

Best is to create your own shader.

Or wait until Armory gets the new paint and world generation tool external tool.
(While i would prefer some Blender plugin, Armory is loosing the all in one workflow getting more and more external tools)


#6

I still think if you made the particles “real” then the process would work.


#7

What do you mean ? It’s the particle hair demo i’m using.
I extruded the plane and particles doesn’t spawn well.

I think users must wait for a proper foliage and objects spawning system inside Armory 3D, it’s waste of time otherwise and you won’t get the same performance as an optimized grass system.


#8

I agree with the second half of your post. What I am saying is if you use a particle system for grass (say a simple polygon for blades of grass) and use the weight painting within the particle system to determine where and how much to place the grass and then make it real (change the particle system to actual objects) it would then show up properly in blender. The grass in this case wouldn’t need to be created dynamically inside Armory.

Does that make sense?


#9

I don’t understand all, but it seems a good idea.
Perhaps a special terrain texture map, one channel beeing used to tell where grass can spawn on the terrain, it’s more precise than vertex colors.

Do you have some example uploaded we can test ?


#10

You have the idea - look up using weight paint to determine where particles spawn - I don’t have an example but have watched a couple videos on the subject. What I am suggesting is that you make the real in Blender before going into Armory. That way the particle system is not doing anything real time. Armory is just rendering objects. Lots of objects but only objects and not doing any physics or logic to create the grass

Check out this links https://blendersushi.blogspot.com/2012/02/vfx-paint-weight-and-particle-instances.html


#11

For grass movement, some sin or cos movement using vertex shader is simple.

Blender particle uses vertex weight, i don’t seen any option to use a texture in Blender for the particle. It’s a new system you would need to code to use a texture lookup.


#12

AFWS88
Follow this tutorial
https://www.youtube.com/watch?v=-25lBcHnCOM

Make two groups one with weight = 1 where you don’t want grass, select inverse and make it group 2 with weight = 0.5 where you want grass.
On particle vertex group, on density assign the second group and perhaps a grass system.

Keep an uniform grid terrain, because Blender distributes the same amount of particles per face.
When you have smaller faces they will get the same amount of grass as others and it will look not so great until it’s the effect you want.

Unfortunatelly Blender particle does not have option to use a texture for grass placement and density.

Grass can be used that way for small games.
While i hope we will get the world generator tool available soon.


#13

What happens when you play? I have tried using a vertex group for density ,but when playing it places all over.


#14

In play mode it doesn’t work, i got almost all grass disappeared :joy:
Don’t waste your time with particles is not made for grass, it’s not a valid work around.

When your game is small areas you could place grass instances yourself with some Blender tool.
Or code a generator , doing top down raycast along some grid, checking if grass is on terrain object and placing it. Saving the grass placement into a file.

Otherwise particles is not a grass system.


#15

The common workflow for game engines with scatter operation like grass is animated texture and “instancing”. Blender has the instance capability. for 2.79 it’s making group>shift+a>group instance and 2.8 it’s shift+a>collection instance. Instance saves lots of memory as it uses pointer rather then real data.


#16

But particle is a real deal. I can’t output particle as well. What is the process. I saw a demo from Armory youtube with grass and emitter. I thought Armory is capable of rendering particle.


#17

Instancing is only for performance, you need a grass system able to pool grass objects and draw them as needed with grass density automatically lowering on long distance.
And you need some tools to auto generate grass on terrain or paint it.

Armory does not have that, you better wait until it gets one or try using some other 3D engine that have a grass system. I can only advise you it’s a waste of time trying to find a work around.


#18

Yes tried for several work around with failure. I think a scatter addon for instance object in Blender will do the op. Will try.


#19

Also it seems particle is a no-go for now in Armory. Did memory leak. It’s obvious though. As Blender particle system needs too much upgrade. I heard particle is going to be the first part of Blender “All node” project.


#20

Have you tried actually making the grass real - in the modifier panel - after getting the result you want? I wouldn’t let armory deal with the particles. Let blender place them but then make them actual objects instead of instances of the particle.

particle