Original Post
Im trying to understand some of the results Im getting using the ddx and ddy functions. Image 1 shows the normal, image 2 shows ddx(normal) and image 3 shows ddy(normal), where the ddx and ddy are scaled so that the result is visible. If the per pixel normals display smoothly, due to interpolation between the vertex normals, why dont the partial derivatives?
With the sphere, and dndx, I would have expected the change in normal with respect to the x screen space coordinate to smoothly increase as you go around the circumference starting at the center of the sphere image within the image.


With the sphere, and dndx, I would have expected the change in normal with respect to the x screen space coordinate to smoothly increase as you go around the circumference starting at the center of the sphere image within the image.
float4 PS(VS_OUT pIn) : SV_Target
{
float3 n = pIn.normalW;
float3 dndx = ddx( pIn.normalW );
float3 dndy = ddy( pIn.normalW );
float sn = 100.0f;
return float4( n, 1 );
return float4( sn*dndx, 1 );
return float4( sn*dndy, 1 );
}
