Conclusion

[Previous] [Next]

In this chapter, you learned how to apply fog to your scenes. Fog adds realism to your applications, hides the effects of popping, and allows you to create imaginative effects to evoke the ambience you want.

At this point, if you haven't already done so, you should compile and run the main application for this chapter. You can enable fog effects by going to the main window (press the Alt key while in full-screen mode) and selecting the desired Fog mode from the Lighting menu. You can switch the fog on and off with the Fog Off menu item to see how it impacts the scene.

The companion CD includes another project, named MFCFog, in the /mssdk/samples/Multimedia/D3dim/src/MFCFog folder. You should build this project in addition to the overall book project to see another application using fog. MFCFog is a program that simulates a rotating flyover of a terrain with a number of columns sticking out of the ground. The demo lets you select vertex or pixel (table) fog. You can also vary the start and end values using the sliders on the screen. It does a very good job of demonstrating D3D's fog capabilities.

Figure 9-8 presents a screen shot of this demo application.

click to view at full size.

Figure 9-8 MFCFog demo application

In Chapter 10, we'll cover alpha blending. You'll learn how to use it to produce transparency and other special effects in your applications.



Inside Direct3D
Inside Direct3D (Dv-Mps Inside)
ISBN: 0735606137
EAN: 2147483647
Year: 1999
Pages: 131

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net