Master your own destiny! Command a nation!

Large scale terrain vegetation

Initially we wanted vegetation to play a role in the gameplay, eg. we wanted players to be able to crouch and hide in the vegetation. In most other games (at least in those I’ve played) the vegetation is clipped away in the distance leaving the ground completely uncovered. The effect would be that the player would crouch down thinking he would hide in the high grass, but in reality all other players would be seeing him crouching on a bare piece of ground.

We already had a vegetation system similar to what exists in other games, but performance got really bad as soon as we moved the clip plane further away from the camera, so I started to look into other solutions. I had some ideas that I needed an algorithm that would work somewhat like our terrain drawing, where the terrain would get coarser in the distance.

terrain1 Terrain rendering getting coarser with the distance

So I started with a regular pattern that essentially would keep the overall structure across LOD boundaries, in order to keep popping artifacts at a minimum.

terrain2 Terrain vegetation using a regular distribution

I tried various solutions to try and hide the obvious tiling, but none I could think of were good enough. I then looked into a different solution inspired by the paper by Kevin Boulanger, as can be seen on the screenshot below:

terrain3 Grass rendering using the proposed method of Kevin Boulanger using his texture

And it worked really well for low vegetation like grass. But I wanted something where there was more variance in the visuals. So I went back to the idea of using a system like the terrain rendering but now I experimented with an irregular structure for the vegetation.

terrain4 Irregular mesh structure for vegetation

And I felt it looked more chaotic which was what I needed to get enough variance. Based upon this method I expanded the method to allow for up 4 different kinds of vegetation packed into a single draw call. Below is a debug version that shows where the different types of vegetation would be drawn.

terrain5 Different kinds of debug vegetation

And here is a screenshot showing the same scene with vegetation:

terrain6 Terrain vegetation without anything else

And now the same terrain with everything else:

terrain7 Terrain vegetation with the rest

  1. SteinardarriSteinardarri10-20-2011

    Wow, good job !

  2. ImperialDaneImperialDane10-20-2011

    Well that was certainly an interesting explanation :)

  3. Mjr_AwesomeMjr_Awesome10-20-2011

    Nice. I already noticed in the videos that there was some elaborate systen at work, well done.

  4. macdaddymacdaddy10-20-2011


  5. pixelbaronpixelbaron10-20-2011

    That looks really slick. The only potential problem I see is that some people will attempt to disable the grass entirely in order to see people attempting to hide.

  6. BradyBodycountBradyBodycount10-21-2011

    Innovative, very nice

What are you waiting for soldier? We need heroes on the battlefield and generals to lead them!