Standard “GameObject” grass will crush your CPU. To achieve truly lush, dense fields that react to the player, you must move the entire pipeline to the GPU using Compute Shaders and Indirect Drawing.
Because the grass is rendered in a shader, we can animate it with zero CPU cost:
WorldPosition + Time.Vector4. The grass blades check their distance to the player and “bend” away if too close.We don’t need to render grass behind the camera. In the Compute Shader, we check each blade’s position against the Camera Frustum. If it’s outside, we simply don’t add it to the Append Buffer. This allows us to have “infinite” grass fields while only processing what the player actually sees.
// Apply wind and bending in the vertex shader
float3 worldPos = instanceData[unity_InstanceID].pos;
float wind = tex2Dlod(_WindNoise, float4(worldPos.xz * _Scale + _Time.y, 0, 0)).r;
// Offset vertex based on height
v.vertex.xyz += v.normal * wind * v.uv.y * _WindStrength;