Grass on mobile device for 2023

Hi there
I’ve tried several years ago to display grass on mobile using Unity terrain. The performance was horrible.
I tried again in 2023 now, and I see that higher-end devices have no issue but devices from 2016 are still running the grass too slowly.

What’s the current status? Is there any asset package that would render grass with decent density on a device that runs OpenGL 3.2? (Google says that’s about 85% of devices already).

I’ve tried a few assets in the store but the results were not very promising.

Can you share your knowledge/experience?

Interesting question,

to me it sounds like the job of a pool.
Figure out how many grass you can get away with on the device, the minimal amount, and just teleport those guys to the points that they exist, while those points are in view. Sure it’s unlikely to be as dense as a cpu version of your game, but the gpu on the mobile device is fairly limited. I couldn’t think off the top of my head of many games that display a huge volume of grass on mobile. Yet some of the latest devices are much higher powered.

Do you have a sample project you could share? I’d be interested in taking a look at it in a profiler. Also what device did you see the bad performance on?

I’ve used a Redmi note 10 and a Kindle Fire 7. The Fire is by far the slowest device.
If I only paint grass as textures, performance is not wonderful but it at least runs. If I paint grass as meshes, well, it kills almost all mobile devices I test it.

I know this density is too much, but I use it as a test since this only has grass and a game usually has many other things.
The question is, is there any tool or any way to render the grass on an average mobile and it doesn’t look like we are in 1998 games?

Here is a repo I did quickly.
joaquingrech/UnityMobileGrass: Test of Mobile Grass (github.com)

1 Like

Thanks! I don’t have any immediate answers, but I’ll take a look at this in a profiler and see if anyone has suggestions.

1 Like

It’s actually super simple to make it run on mobile but I don’t know how much power you have to move this up on Unity.
How? Well, do what you already did with Tree Creator.
Unity Tree Creator created a 3d mesh, and the terrain has a parameter that at a certain distance that turns into a billboard. Was this efficient? Well, I’m running 50k trees forest on a Samsung Galaxy S4 (9 years old now?)

No solution, none, no asset, can go faster than that. I’ve tried every asset in the store. Funny thing is that Unity is not promoting Tree Creator anymore, Luckily, it still renders those, so it works like a charm on mobile.

If you do the same for grass and vegetation: 3d object, with a billboard at certain distance. Set it up on the terrain as we do with trees. Done, you should be able to render dense forest AND grass on even crappy mobile devices. The system is already there for Trees, no idea why it was never implemented for grass and vegetation.

At this moment we have to go around shopping for tons of assets that simply look bad, unrealistic, or do not gain much performance on a mobile device. I’ve probably spent $500 on assets trying to make grass and trees faster on mobile, and nothing, absolutely nothing, beats Unity Tree Creator on performance.

Just some examples I own (Calculate the amount I’ve spent if you want):

  • InfiniTree: Vegetation and trees look bad, with performance subpar compared to Unity Tree Creator.
  • Grassflow 2: Not thought for mobile. It won’t even run on old devices.
  • Vegetation Studio: The author is missing in action. Grass performance is horrible compared to unity billboarding. For trees, it actually tries to do the same as Unity Tree Creator (it creates billboards for your trees and displays those at a distance). Unfortunately, it does not do the same for grass.
  • uNature: The author also went missing in action. Package used to semi-work, now it doesn’t.
  • Bruce Force Grass Shader: it looks cartoony, it is fast but you cannot use your grass and it looks horrible at ground level. Only designed for top-view.
  • Advanced Terrain Grass: same thing, no improvement on mobile for grass although it does improve the trees performance.
  • Nature Renderer: bad performance on mobile for grass.
  • The Vegetation Engine (TVE): bad performance on mobile for grass.

And many many more that i’ve tried throughout the years.

In short, the “trees” on mobile is kinda solved by Tree Creator, even if not the best-looking trees. But for grass on mobile… if you guys at Unity did the same you did with Tree Creator, it would be wonderful.

4 Likes

Does Unity 2023 have a different vegetation-rendering system than Unity 2021 LTS?
What about GPU Instancer? Does anyone have experience with GPU Instancer? I would be very interested!

No, Unity vegetation system hasn’t changed since Unity 2.0 practically. And GPU Instancer does the same as Vegetation Studio. It just draws indirect instances. It works well for tons of 3d meshes, but it has little to no benefit for grass on mobile. If you are using SpeedTree, rocks and such, Indirect Instancing works fine so it will be helpful (Vegetation Studio or GPU Instancer). On the other hand, do not use Vegetation Studio, the author has been gone for months and the emails bounce. It’s failing and not updated.

For grass on mobile? Nope, none of the packages are useful, unless you were so silly to try to render dense grass as 3d meshes on a mobile phone.

Sadly the tree creator doesn’t work properly in URP afaik (at least not with billboards etc)

**InfiniGRASS **video showcasing the various possibilities and demos on 1050GTX Laptop GPU (software recording)

https://www.youtube.com/watch?v=361Mqt7pYSo

Hi. You can try **InfiniGRASS **system, it optimizes the grass even on older Shader Model 2.0 devices and does not require special hardware. The performance boost can be massive, e.g. use a single draw call batch for all grass in a stage etc

The system can optimize any foliage, trees, rocks and any item in general. Also can be planted on any orientation, on Unity terrains or any mesh, can be made to follow transform rotation and translation of objects that is planted on and can be planted and perma-shaped at run time.

Also does not use any scripted instancing of the grass, essentially there is a mode that can be used without any scripts at all, should this be required and possible in the game needs.

I have more than three thousand users, many using it on mobile with great results, of course as all systems depends a lot on what need to be done and how is the game structured. The script-less mode is also useful for some exotic platforms that not support upload of scripts.

Well, actually I purchased Infini Grass a while ago and tested it and performance for grass was worse or the same than using standard Unity terrain system.

Infinigrass is useful for prefab rendering (similar to vegetation studio, gpu instancer, and so on). But if you only have grass as 2d textures or just grass, I saw no benefits whatsoever.

I see, indeed the default grass is meant to be detailed 3D grass that looks good from above.

Still can be faster than Unity even in that mode though, if the batch group is large enough. Imagine that in my test i get 500 draw calls from Unity simple billboards and my grass is 50 draw calls for full 3D grass, with proper shadows etc

So if configured well can help, many users have reported great results on mobile due to that as well.

I can help pinpoint the settings that can help as well. Let me know.

I also work on a batched billboards version, where will use the simple grass as you mention and massive batch it for even more performance boost. This mode is already working in the upcoming InfiniGRASS STUDIO asset, but i plan to backport it to the current InfiniGRASS as well.

well, you have a chance to prove it easily. The thread here began with me posting access to a free open source demo at github joaquingrech/UnityMobileGrass: Test of Mobile Grass (github.com)
And see how it can be sped up. I tried with your asset and I got no improvement (using the same assets) on my mobile device vs regular Unity terrain.
I also tried with billboarding and Unity terrain beats it on mobile always.

Do you accept the challenge? It has to be running on a mobile device, in my case I used a 4 years old android for most my tests.

Hi,

Indeed my demos are generally desktop demos, will try adapt to your github one on mobile and get back asap

yeah, there is only one Demo that says “mobile”, but it has so little grass that is basically useless. I would not need any package to render 65k polys of grass, that can be done easily without any help on an 10-year-old mobile device.

I wanted a full terrain with grass, and from the videos and description that is what Infini Grass should be for. Instead, I found that it runs horribly horribly horribly bad on mobile. I sent you screenshots in private of how bad your demo scenes look and run on a regular Android.

So far, the best grass asset for mobile i’ve found has been Vegetation Studio which is now with the author missing in action. Unity should be really looking at how to render detailed grass on mobile.

Can you post an image from mobile with fps and the Vegetation Studio grass ? I need to understand how that grass looks and how far it is rendered etc and can try replicate with InfiniGRASS

The desktop grass and systems are not meant for mobile, so perhaps that is why you see the bad performance, so will try tailor the system to those needs and get back, but need to understand the best you have got so can recreate something around that, as is not clear.

A video would be even better.

If you load the GitHub and hit play, that’s exactly how it looks. It doesn’t matter if you use vegetation studio or not. It looks the same when I switch between both systems.

this whole thread is about MOBILE rendering of grass. Now you are telling me your system is not thought for mobile. Really?

you have everything needed to test on mobile, the source code and textures. Infini Grass is probably the worst of them all: bad quality, slow performance, no benefit whatsoever on mobile. Hit play and compare with and without Infini grass. In my case a samsung galaxy s6 using Unity terrain without any optimization renders about 4 times faster than using Infini Grass “optimization” with any grass.

Yes, the desktop demos are not meant for mobile, to adapt to mobile need to use special considerations. There is no magic solution for all cases, each case is different for both desktop and mobile.

I will make a sample asap and get back, with the grass as shown in your example. Will take a bit as i work in unity 2019 and 2021.3 lts, so have to recreate the mobile building for the 2022 first that the github project uses.

Note that you compare two completely different things, my grass is not billboard, the base is meant to look great from above

https://www.youtube.com/watch?v=dKuHGRRJmis

If you want a full terrain of grass, one solution is to use Vegetation Studio Pro and integrate it with Microsplat. Basically it can render detailed vegetation up close and then simply paint the vegetation colors onto the terrain in the distance. It gives a decent illusion of grass on the entire terrain without actually rendering grass everywhere in real time.
https://www.awesometech.no/index.php/vegetation-color-mask-setup-with-microsplat/

As a side note, there is a similar integration for faking tree shadows in the distance using Microsplat integration.
https://www.awesometech.no/index.php/configure-shadow-mask-with-microsplat/

This works well on desktop. I have not tested it on mobile, though.

Yeah, the Vegetation Studio Pro works to fake the grass. The problem with Vegetation Studio is that the author has gone missing and emails bounce. So it will most likely die like many other assets that can’t keep up with newer Unity versions.