Xbox LIVE Indie Games

code sample details

Shader Series 5: Multipass Lighting (ARCHIVED)

Code Sample


Note: This sample is no longer supported. It may demonstrate techniques that are no longer valid in current versions of XNA Game Studio. The sample is archived here, but will not be updated.

The number and types of lighting effects that can be applied to a given piece of geometry are limited only by the need to maintain an interactive framerate. In this sample, shader programs are run multiple times on individual pieces of geometry to enable hundreds of lights on a single piece of geometry.

Additive, multipass lighting techniques are not unique to programmable shader hardware, but shaders add additional flexibility in batching for performance. This sample uses blend states to add the effects of individual draws to the back buffer, allowing multiple draws to light the same piece of geometry.

Other items in the Shader Series

All content and source code downloaded from this page is bound to the Microsoft Permissive License (Ms-PL).



GS 2.0

find education content
var gDomain=''; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/