1
\$\begingroup\$

How would I go about adding grass to a low-poly mesh in Unity?

Example of grass


Here is what I have looked into:

  1. Object2Terrain: I am not using Unity's built in terrain system because I am going for a low-poly art style. I tried converting my terrain mesh object to a terrain (using Object2Terrain) however this removes the sharp edges on the terrain, because Unity uses a height map for optimization.
  2. PolyMesh: From the get-go I knew this approach wasn't going to work. I knew it would be incredibly inefficient to render that many meshes at once. I still tried it though, and to no surprise, it was very laggy.
  3. Particle System: From what I've read, this should work fine for randomly scattering grass over your mesh, however I do want some control when placing grass. I followed this tutorial image as suggested by a comment in this question on Reddit, however, I was never able to achieve the desired result. Nevertheless, I do want control over placing the grass, and so I moved onto another approach.
  4. Shaders: I'm not experienced at all when it comes to creating (or even using) shaders, and it's quite a daunting topic to me. I've read that this is the most efficient approach, however haven't been able to understand how this means I could draw grass onto a mesh? On the same Reddit post linked above, "UpstairsCurrency" was kind enough to link their source code (here), however I'd like to understand what is happening? I'm reluctant to say that I'm not even sure I understand how to implement it into my project in the first place. Would appreciate any sources for reading up to help understand what is going on!

Thanks!

\$\endgroup\$
  • \$\begingroup\$ Do you want your grass to interact with characters that walk on it? Do you want it to be as realistic as the one in the picture? \$\endgroup\$ – TomTsagk Nov 22 '19 at 10:40
  • \$\begingroup\$ @TomTsagk No it doesn't have to interact with the player. I would like it to have an effect where it sways in the wind though. \$\endgroup\$ – Daniel Nov 22 '19 at 10:41
  • \$\begingroup\$ There's a nice tutorial series from 2 years ago by World of Zero about rendering grass using Compute Shaders. I think it might work for your situation. LINK \$\endgroup\$ – Darker Nov 23 '19 at 11:53
1
\$\begingroup\$

One option is to use the terrain system for rendering grass but still use your low poly mesh for the terrain itself. Backwards as it may seem, your can turn off rendering the terrain in the terrain inspector. In the settings tab, under Basic Terrain, uncheck “Draw”

\$\endgroup\$
0
\$\begingroup\$

For those interested, I found an asset on the asset store called Polaris, which is a low poly terrain engine.

\$\endgroup\$
0
\$\begingroup\$

If you've already got the mesh that represents your terrain and you simply want to make it grassy, you can look into this tutorial by Roystan on how to make a geometry shader that generates blades of grass on the surface of the object. If you like the look of it but can't be bothered to follow the tutorial (I tried it myself and encountered many errors), there is a github repository linked in the tutorial that contains the completed shader code, and the necessary files are in the starter project - also linked.

\$\endgroup\$

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.