O'Reilly logo

Silverlight 5 in Action by Pete Brown

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

Chapter 27. 3D lighting, texturing, and animation

 

This chapter covers
  • Effects, lighting, and normal vectors
  • Texturing objects
  • Coordinate spaces and matrices
  • Keyframe animation

 

In the previous chapter, you modeled a sphere and rendered it in 3D. You could tell it was 3D due to the curvature of the bands, but it wasn’t nicely shaded, and it definitely wasn’t lit. A key part of what makes a rendering convincing as 3D is the lighting.

In DirectX-based 3D systems, lighting is handled by various shaders. These shaders, which run directly on the video card, are small, high-performance algorithms that anyone can write. In XNA, a DirectX-based system, the shaders are encapsulated in a class derived from the Effect class. Throughout this chapter ...

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