STYLIZED STATION Profile picture
Creativity x Tech X Gundams

Aug 8, 2023, 33 tweets

Have you ever wondered how the grass in Ghost of Tsushima looks so good?

Wouldn't these environments take decades to build by hand?

Believe it or not, Sucker Punch Studios actually used some very creative techniques to let the grass build itself.

Another long 🧵

To achieve their goal of creating a painterly look for their grass, Sucker Punch Studios originally went for traditional grass cards early in their prototyping phase.

But this wasn’t practical for the amount of grass density they wanted to achieve.

Overdraw was a big problem, and they wanted to render lots of grass that interacted with the wind...

So Sucker Punch Productions chose to render their fields by generating individual blades of grass on the GPU that could each have their own procedural appearance and animation.

The grass is procedurally generated based on several techniques.

First, they chop the world up into tiles.

These tiles contain a suite of textures that determine the height of the terrain, the material to render the terrain as, and most importantly, what type of grass goes there.

Each grass type has several different parameters available to artists to play with, such as its height, width, tilt, and colour.

Each type of grass has a different set of parameters.

I want to note that grass geometry is not created manually by artists.

Instead, each grass blade is built procedurally based on a bezier curve, and its grass type parameters.

Using a compute shader, the position of the grass blade is determined by the shader and then randomly offset to add variation.

Then, two techniques called distance and frustum culling are applied to exclude calculating blades of grass that are out of view of the camera.

From there, the grass geometry samples from the assigned textures in the tile to determine its grass type and height depending on its position in the tile.

Usually to add variation to procedural grass, you can add random height values to make it look a little messier.

Real grass isn't simply random heights though.

If you look at real grass, it grows in clumps, where taller grass clumps are a result of the soil having a higher nitrogen count in the area, which even affects the color of the grass.

GoT mimics this by using a procedural noise algorithm to collect grass blades in an area into clumps and influence their various parameters like height, color, and direction to mimic this grass ‘clumping’ you see in real life.

Grass blades come in 2 versions, a high lod of 15 vertices, and a lower lod of 7 verts.

To avoid LoD popping when switching from high to low and low to high, the grass lod blends from high to low as it nears its change point by shifting its vertices.

This makes the transition between the two lods much smoother, especially on grass heavily curved by the wind.

GoT also uses an intelligent optimization technique to make fields seem fuller.

If the grass blade is short enough, it would be wasteful to remove the geometry.

GoT instead folds the grass blade in the middle to create two blades of grass to make areas of short grass seem twice as dense for 0 cost.

Super cool trick.

In GoT, the wind does the majority of the animation for the grass.
The wind is powered by a simple 2d Perlin noise texture, and scrolled in the direction that the wind is blowing.

This scrolling noise determines the power of the wind at any given point and affects the bend of the grass.

Combining this with adding a simple ‘bobbing’ animation to the grass by using a sine wave and blending that with the animation from the wind, you get very realistic grass movement.

Since the grass is created procedurally, each animation is slightly different for each and every piece of grass.

Heres a fun normal trick they used:

In real life, blades of grass aren’t flat faces, they’re slightly curved.

Normally to recreate this you would have to add extra vertices to curve the blade, but this would literally double the amount of vertices that your GPU has to render.

So to get around this, GoT uses curved normals to give each blade of grass that naturally rounded look -

this trick is a much cheaper option, and definitely something I’m going to be adding to my own grass in the future.

Sometimes in games when you look at blades of grass at a right angle, the grass looks way too thin, like looking at a piece of paper from the side.

To make the grass fields feel fuller, GoT also shifts grass blades that are orthogonal to the camera, to face the camera slightly, which subtly thickens the grass blade from the user’s perspective.

The various other foliage like spider lilies, and the iconic pampas grass are procedurally distributed in a similar fashion to the grass, where its parameters are determined by the tile each asset is spawned in.

Unlike the grass blades, which are built procedurally based on a curve function, these other foliage are built by hand by artists.

One of Sucker Punch's biggest grass challenges was how to handle grass LoDs at very far distances.

There are several spots on the island of Tsushima where you can see the entire island at once, and rendering each blade of grass from miles away is unnecessary and extremely expensive.

So instead of rendering millions of blades of grass and its other foliage, all of the foliage is removed and replaced with an artist’s authored texture thats rendered at far distances instead of the underlying material.

So yeah, grass is pretty cool.

If you want to learn how to make beautiful grass in Unreal Engine, check out my Environment Art course for beginners.

https://t.co/zsMIqGZuOucourses.stylizedstation.com/p/survival-kit

Thanks for reading!

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling