Things evolve.
I'm not a coder of shaders (i'm doing something based upon a code and a simulation but in a complete different sector) but i'm a Boffin in a specific branch of science where the term Research has a meaning and where if something today is blu, tomorrow will be less blu and more green and the day after.. will be something new..and so on...
some materials don't need pixel shader2
OK..
"The latest DirectX 9 class hardware supports more advanced shader models, older hardware (DirectX 8 Level) much simpler profiles named vs_1_1 ps_1_3 / ps_1_4
with more limitations in the amount of instructions and capabilities."
http://www.bitmanagement.com/developer/ ... hader.html
Pixel and vertex shader have limits... limits like the number of textures slots, arithmetic functions slots and so on.
What is a pixel shader?
"A pixel shader is a computation kernel function that computes color and other attributes of each pixel.
Pixel shaders range from always outputting the same color, to applying a lighting value, to doing bump mapping, shadows, specular highlights, translucency and other phenomena. They can alter the depth of the pixel (for Z-buffering), or output more than one color if multiple render targets are active. A pixel shader alone cannot produce very complex effects, because it operates only on a single pixel, without knowledge of a scene's geometry or of neighboring pixels."
http://en.wikipedia.org/wiki/Pixel_shader
if i do a shader with Pixel and Vertex model 1.1 i have these limits.
Pixel Shader slots -> ps_1_1 -> 4 texture + 8 arithmetic
The same shader but compiled to run on a ps 2.0 has these limits.
Pixel Shader slots -> ps_2_0 -> 32 texture + 64 arithmetic
Shader model 3.
Pixel Shader slots -> ps_3_0 -> 512 minimum, and up to the number of slots in D3DCAPS9.MaxPixelShader30InstructionSlots. See D3DPSHADERCAPS2_0.
The minimum number of SLOTS for ps3 are 512.. so 512 textures, colors, bump map etc. che be manipulated one after another withour requesting more hardware shader unit...
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
So if an object has 5 textures and a shader model 1.1, the Unified shader engine on a modern videocard has to do 2 pass to apply the shader or use 2 different shader units, loosing half of the compute power in the process. Right?
With a ps_2 the same objects is done in 1 pass..
What happen if i have 100 objects all with the 4 texture slots limits? A mess...
Vertex shader.
"Vertex shaders are run once for each vertex given to the graphics processor. The purpose is to transform each vertex's 3D position in virtual space to the 2D coordinate at which it appears on the screen (as well as a depth value for the Z-buffer).
Vertex shaders can manipulate properties such as position, color, and texture coordinate, but cannot create new vertices. The output of the vertex shader goes to the next stage in the pipeline, which is either a geometry shader if present or the rasterizer otherwise."
Vertex shader - Maximum number of instruction slots
vs_1_1 128
vs_2_0 256
vs_3_0 512 minimum, and up to the number of slots in D3DCAPS9.MaxVertexShader30InstructionSlots. See D3DCAPS9.
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
Same as above.. more instrucions slots = better use of the current hardware.
If i have 512 instructions to be processed.. is better to use 1 hardware shader engine capable of 512 slots or 1 with only 128 slots? Of course the first is better because if i have 320 engine (like my 3870) capable to run 512 instructions at the same time but the shader is the old 1.1, it' takes 4 more time to compute the same thing... so when the GPU reach 100% start ditching frames and the result is a lagging movement.
This is more visible in motion. In my case there are 15-20 fps less, looking to an objects standin still or in movement..
"Early shader models (Shader Model 1.x) used very different instruction sets for vertex and pixel shaders, with vertex shaders having much more flexible instruction set. Later shader models (2.x and 3.0) reduced the differences, approaching Unified Shader Model."
"Unified Shader Architecture"
"
Unified Shader Architecture allows more flexible use of the graphics rendering hardware [2]. For example, in a situation with a heavy geometry workload the system could allocate most computing units to run vertex and geometry shaders. In cases with less vertex workload and heavy pixel load, more computing units could be allocated to run pixel shaders."
To conclude...
My idea is that the use of an older shader model with big limitations is what is causing the lag when there aren't other things involved (loading routine.. the speed of the HD...etc)
I know that there are hundred of things requested by the community.. hundred of.. i want this i want that.. but the shaders are fondamental.. like the Distant Moutains... that, of course, are done by a shader.. DistantTerrain.fx
regards