XaiJu
xiexe
xiexe

patreon


Patreon Shader 12/6/2019 | Grass Grass Grass! Edition

Hello cuties!

Today is finally the day - the day that the grass becomes available to all.

I will warn you all now, this should be used CAREFULLY and in moderation.

Do not expect to just be able to have a bajillion blades of grass with no performance cost!

While I've optimized as much as I can, the shader is still always going to be a fairly expensive effect, and you'll likely have to optimize around it for larger scenes.

My current benchmarks show a little above 90-100 FPS on a GTX 1080(not ti) and a Valve Index in the included example scene.

Here's some tips on the workflow to consider when using this shader.

1) 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.

2) The thinner the blades, the less overdraw, and therefore the more performance you gain, and the the denser you can make the grass.

3) 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.  

4) 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.

5) 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.

6) Keep the render distance reasonable. The larger it is the less you can push the max blades up without losing performance.

7) Don't put it on avatars. It'll freak out and might crash your Unity/GPU drivers. (I'd like to know why this happens, but haven't figured it out, it just doesn't like weirdly complex meshes.) 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!

And that's all the tips I can think of off of the top of my head!

Enjoy the shader! If you find any major issues with it, let me know, and I'll be sure to fix them if I'm capable of doing so!

Oh, and I was listening to this while writing this - Grass! Grass! Grass!
https://youtu.be/atuFSv2bLa8

EDIT: Updated to include a fix for broken real-time shadows. Woopsies.


PATCH 12/10/2019
- Fix issue where height and distance scaling was based in object position rather than world position - your grass should be consistent height across the entire world now.

- Fix and issue where the grass would "pop" in and out of the peripherals of Index Headset users FOV.

Patreon Shader 12/6/2019 | Grass Grass Grass! Edition Patreon Shader 12/6/2019 | Grass Grass Grass! Edition

More Creators