O'Reilly logo

3D Graphics with XNA Game Studio 4.0 by Sean James

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 3. Advanced Lighting

By the end of the last chapter, we had developed a system to draw a model with custom effects and we had created an effect that rendered a directional light shining onto a model. This is useful if we want a scene with only sunlight, for example, but what if we wanted to light up a specific area? To start with, we'd need a light type that more accurately models real world lights—the "point" light. We will start this chapter by implementing this type of light in HLSL. We will then look at a similar light type—the "spot" light. We will spend the rest of the chapter looking at two ways to draw multiple lights at the same time.

Implementing a point light with HLSL

A point light is just a light that shines equally in all directions ...

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