Foliage Wind
- jamesghholt
- Apr 26, 2022
- 2 min read
Updated: Jun 9, 2022
Seeing as our game is set within a jungle, foliage is a large part of the final scene. Knowing this, early on in the project, I set out to develop wind interactive foliage. The first development was extremely simple, as I lacked any understanding of how to tackle such a daunting task at the time.


To begin creating the grass above, I started with a small strip, somewhat similar to a single blade of grass. Taking in account it's size, in relation to the character's (2m tall, model for reference: [https://skfb.ly/opDLX]). This one blade of grass can be duplicated and reorientated/ scaled to create a varied "bundle" of grass.

A seemingly simple step, UV unwrapping, is a critical step, for the planned method. The base of the "blade" must be orientated along the V axis. Once at this stage, I swiftly moved into Unreal.
Below is the material needed to create the effect of wind, and texture the grass. The colour is distrubuted by a linear gradient alpha, along the V of the UV map. Three colours are specified, and lerped between, to create the final gradient effect; along the length of each individual grass blade.

"Simple Grass Wind" is the foundation for this process (large scale example). This is shipped alongside Unreal Engine, and provides a simple wind like effect. However, the base of the grass blade isn't pinned, so it wiggles in the ground. This can be quickly fixed, by using a similar method to create the base colour. A linear gradient alpha defines what areas of the grass blade is influenced by "SimpleGrassWind". This is why the UV orientation of the grass blade must be correct.

Unfortunately, when creating our foliage assets we forgot to orient the maps as so. The concept of wind was forgotten about and we never finalised it's implementation. However, there are various other methods I could of attempted, which would achieve an even better final product -- and could be merged late into the project. For example, vertex weight painting foliage to define how influenced it is by wind. Or manually painting masks to define wind influence. Unfortunately, I ran out of time to execute such an idea, as manually doing all this, with all the current foliage and implementing a global wind shader -- was far out of reach at the time.
References
Comments