What exactly do the ps 2.0+ dsx and dsy instructions compute?
The DirectX 9 SDK documentation is a bit shady about it:
du/dx = d(u'/w)/dx
du/dx = 1/w² * (w * du'/dx - u' * dw/dx)
with u' the homogeneous texture coordinate. Of course it can also be rewritten as a function of the position.
Is this correct? If it is then what is the use of it? I know that it is required to compute the mipmap level but that's already done automatically. And what does the "running in lock-step" mean?
I just would like to know what these instructions are for. In the whole ps 2.0+ instructions set they are the most obsucure and undocumented of all...
The DirectX 9 SDK documentation is a bit shady about it:
So does it work on any register or just texture registers? To compute du/dx we need:The rate of change computed from the source register is an approximation on the contents of the same register in adjacent pixel(s) running the pixel shader in lock-step with the current pixel.
du/dx = d(u'/w)/dx
du/dx = 1/w² * (w * du'/dx - u' * dw/dx)
with u' the homogeneous texture coordinate. Of course it can also be rewritten as a function of the position.
Is this correct? If it is then what is the use of it? I know that it is required to compute the mipmap level but that's already done automatically. And what does the "running in lock-step" mean?
Somebody here understand Zulu? I believe this confirms that it is related to mipmap level computations, but it isn't very concrete. How could the above formula be implementation dependent?The exact formula used to compute the gradient varies deoebgubg nb hardware but should be consistent with the way the hardware does the same operations as part of the LOD calculation process for texture sampling.
I just would like to know what these instructions are for. In the whole ps 2.0+ instructions set they are the most obsucure and undocumented of all...