Updated: July 2008
Gets or sets a value that indicates the shader register to use for the partial derivatives of the texture coordinates with respect to screen space.
Assembly: PresentationCore (in PresentationCore.dll)
An attempt was made to set the property more than one time or after initial processing of the effect.
Use the property to specify the shader register that contains the partial derivatives of the texture coordinates with respect to screen space. For example, if is set to 4, the shader register c4 is used. Register c4 contains four float fields. The following High Level Shading Language (HLSL) code shows how this register is used. The nextPixelUV value represents the next pixel to the right.
float4 ddxUvDdyUv : register(c4); SamplerState sampler : register(S0); ... float2 nextPixelUV; nextPixelUV.u = ddxUvDdyUv.x + u; nextPixelUV.v = ddxUvDdyUv.y + v; tex2D(sampler, nextPixelUV);
The following table shows how the register specified for is filled.
Texture coordinates are denoted as (u, v). ddx(u) is the constant partial derivative of the texture coordinate component u with respect to the screen-space x-coordinate. ddy(u) is the partial derivative of the texture coordinate u with respect to the screen-space y-coordinate. Similarly, ddx(v) and ddy(v) are the corresponding screen-space derivatives for the texture coordinate component v.
HLSL has the ddx and ddy instructions to calculate these values, but these instructions are not available on all PixelShader 2.0 hardware.
You may think of these constants in the following way. If you step 1 pixel to the right in screen space (in the x direction), then ddx(u) is the amount that u changes in texture space, and ddx(v) is the amount that v changes in texture space. If the effect is axis-aligned when it is rendered, then ddx(v) is 0. If the effect is rotated when it is rendered, then ddx(v) is non-zero.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.