1 of 15

Game development

The example of the grass

This is meant to be a collective slide, please feel free to send updates/comments. David Elahee 2025

2 of 15

Vertex vs Pixel Processing

Vertex => far less vertices than pixels in general ( one FHD screen = 2M data lines vs One proper scene is 1M vertices at most with consoles/steamdeck in mind )

Pixel (shader) processing must not alter “depth” otherwise the early depth optimizations cannot be performed ( late-Z will be triggered and is bad ).

No “if” if possible in the shader.

Everything can be stored in the mesh or constants, avoid textures as they are less performant

Store barycentric data like influence to wind/flowfields, colors and process at vertex stage.

Geometry shader/Tesselation is not very performant in general, keep it only for “fronting” grass right under the player.

You can use compute shaders to apply advanced effects and control it has the advantage to be “variable rate” correct.

Stick to U8 data/Colors if possible ofc.

Atlas textures and maps and reused a lot, make them smaller to stay in gpu cache.

Vertex lighting and baking, Variable shading and lighting techniques applies.

For shadowing purpose, use lowest LOD.

3 of 15

Rendering

For many years we almost never used transparency for greenings

We use Opaque and CutOut

In general do not use alpha transparency but your local cutout stuff, for unimportant stuff, even for main character. We keep transp for VFX and even there we use tricks.

If you don’t have pure cutout ( also called “alpha to coverage” ), use alpha test with 0 or add a discard in shader when alpha <= 0.0f which allows for “automatic” “early Z”.

Most architecture will perform depth optimizations if you stick to this.

Y-Billboard ( rotate around vertical only ) behind a certain distance ( also sometimes called cards in some variants ).

Paint the ground so the grass blends naturally.

Modulate mesh transforms and base color FTW so you can create cheap diversity.

Use “Variable Rate” techniques ( lighting, shading, shadowing, physics )

4 of 15

Control

Vertex painting / Vertex Data then!

Go for LOD ( 5 to 10 stages is not unheard of, though well designed ones are around 3-4 )

Allows for efficient shading with regular pixel pipeline

One polygon = many grass and LOD for grass close to player

You can upgrade to more poly per grass if you have the systems to do it.

When super close it’s okay to use better things but it should be used with care

Batch polygons together as “islands” rather than sparses all over the world so culling and occlusion work perfectly and streaming have a great time.

With this technique, Lighting and Effects are using regular pipeline. Lighting and effects precision can be tuned to LOD ( for ex its classic to only have vertex lighting when very far see HZD ).

Have a finite pool of high def stuff ( 20 trees, 20 bushes… don’t make everything freely available ).

If skinned be mindful of processing and culling.

Fake physics.

5 of 15

Keys

Have a scene quota ( for ex 1M polygons in view at every time)

Allocate X% for grass/vegetations ( 16x16k polygons ? 10 to 20% is cool )

Have explicit pools

Have tools to monitor that.

Be mindful that Unity, Unreal and Godot may not manage culling and batching the same way ( for example occ culling in unity it very costy after a few hundred “containers” )

It does come well with proper Occlusion Culling and manual Portals.

When making LOD watch the mesh from afar and optimize for Perception

Remember that grass is a complex issue, it is not core to the game, KISS

For reference, the fastest buffer to draw is more than 1024 polygons and less than 32k ( the index should stay 16-bit ), so if all your vegetation stands in one buffer you may “win” the perf game

6 of 15

Physics

I will not iterate on it as its very “game” dependent.

Some will inject a local wind on the batch, some will apply pseudo simulation, it is really up to you.

Many will use a local flow map blended with a global one.

As long as you don’t apply “all the physics engine” to it it should be ok.

The video set in references are talking a lot about the topic, watch them.

7 of 15

Remember!

You are making student games!

Make things “good enough”

Make things that means stuff for the experience, don’t spend time on unmeaningful things for the experience

It takes a crazy amount of time and effort to adopt AAA level of setup so “go indie” and keep it simple.

8 of 15

Resources

Reference from nvidia Chapter 7. Rendering Countless Blades of Waving Grass | NVIDIA Developer

Nice video summing up all techniques how this game renders millions of blades of grass

The skyrim approach https://stepmodifications.org/wiki/Guide:Skyrim_Tree_Settings

VRS Variable Rate Shading Update Xbox Series Consoles

Optimize Renderer Features with Variable Rate Shading in Unity 6.1

implémentation under unity following the method from GOT https://github.com/harlan0103/Grass-Rendering-in-Modern-Game-Engine ( attention 60fps PC ~= 20 FPS on Consoles and 10 FPS on steamdeck ) so use with caution

=====

modern AAA take sur Ghost of Tsushima Procedural Grass in 'Ghost of Tsushima'

Between Tech and Art: The Vegetation of Horizon Zero Dawn ( same engine as Death Stranding ) lot of details on rendering technique

Interactive Wind and Vegetation in 'God of War' lot of details of billboard creation, tech artistic direction, winds, general vegetation optims

9 of 15

10 of 15

11 of 15

12 of 15

13 of 15

14 of 15

15 of 15

Source

Bad

Bad