BasicEffect and SpriteBatch shader source code

Originally posted to Shawn Hargreaves Blog on MSDN, Saturday, August 16, 2008

I'm pleased to announce we have released the HLSL source code for the shaders used by BasicEffect and SpriteBatch.

If you are just getting started with shaders and looking for something simple, these are probably not the best place to start. I would recommend the Shader Series as an introduction to 3D, or the Sprite Effects sample for 2D.

These new releases are intended for experienced programmers who are already familiar with how shaders work, and want to see exactly how we implemented the shaders that come built into the XNA Framework. The Xbox version of the SpriteBatch vertex shader is particularly interesting in the way it uses a vfetch instancing technique to offload computations to the GPU.

Blog index   -   Back to my homepage