XS Grass - Xiexe/OldPatreonExclusiveThings GitHub Wiki
This is a grass shader that provides adding realistic looking simulated grass to your worlds.
Warning: Use carefully, and in moderation. Do not expect to be able to have a bajillion blades of grass with no performance cost.
While this shader is optimized, it can still get faily expensive and you'll likely need to optimize around it for larger scenes. Benchmarks on a GTX 1080 with the Valve Index shows the example scene reaching between 90-100 FPS.
Workflow tips to consider when using this shader:
-
If using the same material across multiple objects, be sure that the polygon size of those objects is relatively the same. Otherwise grass density will drastically vary.
-
The thinner the blades, the less overdraw, and therefore the more performance you gain, and the the denser you can make the grass.
-
The Taller the grass, the more overdraw there will be, and thus, the less blades you should have if you want to maintain reasonable performance.
-
The scale of the blades is super heavily dependent on the mesh - and very finicky. You will have to play around with scale, height, and width on a per mesh basis. Take the time to really make it look good, and be patient, placing grass isn't easy.
-
If making a large world with a lot of grass, I would personally duplicate the ground and delete polygons where I don't want grass to be. Essentially making a layer of "Grass" on top of your terrain.
-
Keep the render distance reasonable. The larger it is the less you can push the max blades up without losing performance.
-
Don't put it on avatars. It'll freak out and might crash your Unity/GPU drivers. However, this was made for worlds, not avatars, so it's not a supported use case. Things may break - that's on you at that point!