Xbox LIVE Indie Games

code sample details

Shader Series 4: Materials and Multiple Light Sources (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 key message with all shader programming is flexibility. The fast, parallel floating-point math executed on the GPU can be used for arbitrarily more complex and interesting rendering. However, to really benefit from all this power, some level of organization is required to combine these elements into a detailed and varied 3D scene.

Until now, the Shader Series has focused on single meshes, single lights, and single materials. However, a real game requires multiples of all these techniques, and some means of operating on them efficiently without removing their inherent flexibility or usability. This sample is an example of how a developer might combine the techniques leading up to this sample into a usable system for composing a 3D scene. In that sense, modern shaders are deeply tied to the architecture of any modern 3D engine, and the design of an engine informs the shader implementations used.

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>");} /*]]>*/