Understanding Limits on Older Shader Models

Because you manipulate a pixel shader in this code, one thing you might notice is that the number of available instructions you can use in a 1.1 pixel-shader pass is extremely limited. For pixel shaders under version 1.4, you are limited to 12 instructions for the entire shader program, which obviously isn't much. For version 1.4, the limit is raised to 28 (in two phases), but that is still not much. You are also limited to 8 constants in these shader programs. Pixel shader versions 2.0 and higher have the ability to perform more complex operations and have higher instruction and constant counts. You can check the capabilities for your card to find out how many of each are supported.

For the first part ...

Get Beginning 3D Game Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.