- Date:
- Sunday , April 25, 2004
- Author:
- Brent Justice
- Editor:
- Kyle Bennett
- Google +1

Shader Model 3.0
NVIDIA recently distributed SM3.0 Screenshots and they got a lot of you asking questions. What was NVIDIA trying to show us with the screenshots from the FarCry game engine? We examine these differences and tell the truth about SM3.0.
Shader Model Differences:
NVIDIA and FarCry
Clearly there can be huge gains in image quality over Shader Model 1.1 as shown in NVIDIA's provided comparison. We have seen many games recently using Pixel Shader 2.0 effects to provide you with a more immersive gaming experience. One of those games is of course FarCry. What we have to ask ourselves is if any features in Shader Model 3.0 cannot be done in Shader Model 2.0.
Let’s take a look at what new features there are in Shader Model 3.0 over Shader Model 2.0. You can click here to see a table of what features are new in Shader Model 3.0.
Shader Lengths & Passes
First let’s look at the shader length in the Pixel and Vertex Shader. In Pixel Shader 2.0 the shader length can be up to 96 instructions long. With Pixel Shader 3.0 that instruction count has been increased to 65,535 and in the GeForce 6800Ultra the instruction count is unlimited. With a longer instruction limit more effects can be applied per pixel in a game. However, writing a shader program with a very long instruction count is not the only way to achieve an effect that would require such a long shader. Long shaders can also be achieved by using multipassing. For example you could have several 96 instruction length shaders in Pixel Shader 2.0 that perform an effect by doing them in several passes, thus achieving the same effect that one very long shader program outputs. In fact the Radeon 9800 series has built within it an F-Buffer that is meant to aid shader multipassing.
One of the most anticipated games this year Half Life 2 uses Shader Model 2.0 extensively but only has a shader length of 30-40 instructions, not even coming close the 96 instruction limit in Pixel Shader 2.0. So concerning shader length, what we are left with is going to be the performance differences between running Shader Model 2.0 programs in many passes with multipassing versus running Shader Model 3.0 with very long shaders. As of right now we have no idea how well the GeForce 6 series video cards can run very long shaders, and we also have no idea how well the Radeon series can run Pixel Shader 2.0 instructions with many passes.
Shader Branching
Now lets take a look at Dynamic Branching which is also a new feature that Shader Model 3.0 has that Shader Model 2.0 does not. As we discussed in our GeForce 6 series tech article Dynamic Branching gives the ability for programmers to control the actual flow of the program, starting and stopping code where they see fit instead of a straight execution from the beginning line of the shader program to the end. What this would allow is possibly faster shader performance. What this will not intrinsically allow is any difference in image quality. Even if Dynamic Branching is used in a Pixel or Vertex program the code can be unraveled for use in Shader Model 2.0. The potential for performance increase using Dynamic Branching does exist but it is yet to be seen how efficient the GeForce 6 series is at Dynamic Branching.
SM3.0 & Displacement Mapping
One of the more major upgrades in Shader Model 3.0 is the addition of Vertex Texture Lookups. What this allows is features like Displacement Mapping. If there is going to be any major difference in image quality comparing Shader Model 3.0 to 2.0 it is going to be with the use of Displacement Mapping. Bump mapping which is currently used now to give the appearance of height in textures is just an illusion. There is no physical difference in the texture, meaning if you look at the texture from the side or dead on you will see that it is still flat, only from far away does bump mapping work. Even then it isn’t the best option since the texture is physically still flat light and shadows do not reflect correctly. The answer is Displacement Mapping which physically adds surface detail by manipulating the height of the texture. Displacement Mapping can even go as far as to create the model itself. Displacement Mapping may be a huge boon to adding realism in games. If developers pick up on this technology and we see it implemented in games, this right here could be the deciding feature that shows the most difference between a game rendered in Shader Model 3.0 and a game rendered in Shader Model 2.0.
Geometry Instancing
Another feature, geometry instancing, could show itself as a noticeable performance increase. With geometry instancing a game could loop information from within the vertex buffer to create the same object. A good example of this would be in an RPG game where you are controlling a large army, and in that scene the characters all look the same. Instead of having to draw each one separately with geometry instancing the video card could simply draw one of them and copy the rest therefore providing a performance increase. No image quality differences would be seen with this feature, it is purely a performance feature.
