I worked on this project for
Forza Motorsport 3. While our engine supported animation for the crowd members that stand alongside the track, we did not have any suppot for animation for other objects in the game. One of the central art objectives for
Forza Motorsport 3 was improving the sense of "track life," and animated flags would play a part in this, as race courses are often dotted with a great number of flags for the venue, driver nationalities, and team or manufacturer logos. It initally appeared that we might have to scale back on this, as we would not have time to integrate support for animated track-side objects. However, I was able to develop a shader-based solution by using procedural methods in the vertex shader to create real-time animated flags. These flags were added to nearly all of the tracks in the game, but they were featured particularly in the Le Mans circuit.
These flags use a combination of trigonometric math and rotational transforms to give a sense of wind blowing past the flag. These deformations are scaled based on the UV coordinates of the vertex, attenuating the affect towards the hoist side. The entire effect is scaled via a set of staggered sine waves that create a gust and doldrums cycle in the animation. A pair of bump maps are additionally panned and rotated across the flag in the pixel shader to add high-frequency detail and to create a 'billowing' feel to the flag's animation.