O'Reilly logo

Microsoft XNA 4.0 Game Development Cookbook by Luke Drumm

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Cloud generation within the Reach profile

Sometimes a 2D image of cloud just isn't going to cut it.

Maybe your game needs some fluffy, white, 3D clouds to fly through or there is some dramatic and dynamic change of weather.

In either case, knowing how to generate a 3D cloud programmatically is a good place to start.

Getting ready

A cloud particle texture is required for this recipe.

Since it will be replicated and rotated repeatedly to make up a cloud, any random collection of white or grey dots on a transparent background should do the job nicely, as seen here:

Getting ready

How to do it...

To start rendering your own in-game clouds:

  1. Create a new class named ReachCloud: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required