- Home /
Wind Waker-styled tall grass
So what I'm trying to do is set up tall grass exactly how it's handled in Wind Waker; if the player walks into it, it gets pushed over, and when the player is no longer near it, it goes back to being upright. The problem is, I have no idea where to start with this. Do I use triggers and adjust the grass's angle accordingly if the player is in the trigger, or what? I can't exactly use non-trigger colliders because then the player wouldn't be able to walk through the grass.
Answer by tanoshimi · May 01, 2017 at 06:21 AM
Triggers/Colliders would work but would be an expensive solution, since you'd be running a physics simulation on each blade of grass.
When I did this on a previous project we modifed the Unity grass shader (called Nature/DoubleSidedWave or something similar) to include a vertex deformation that pushed the top vertices of each grass plane mesh away from the location of the player, which was supplied as a worldspace Vector3 parameter to the shader. Simple and fast because it runs entirely on the GPU, and it looks quite effective especially if you run through densely-planted patches.
I wouldn't necessarily be doing it on every blade of grass. Like I said, it's Wind Waker-styled; rather than rendering every blade of grass I just have a grass patch mesh that I use to populate slightly larger patches. 
Yes, but even a collider/rigidbody per mesh chunk would be expensive - you really don't need to simulate acceleration, velocity, transfer of momentum or collision contact points do you?
Answer by CorvusGameLab · Apr 10 at 01:34 PM
Hi, i made a grass shader with lots of features like player interaction or placing the grass only on a certain height. If you are interested you can download it here: https://www.youtube.com/watch?v=st-EjyeObEM
Your answer
Follow this Question
Related Questions
camera view grass distance 1 Answer
Billboard grass rotate weird 1 Answer
Mass place objects on mesh 0 Answers
I can't put texture on the terrain 3 Answers
How can a look up of grass height at a position on terrain be done? 0 Answers