Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are dFdx/ddx and dFdy/ddy 2 dimension variables when quering a 2d texture?

I cannot seem to understand this, shouldn't the derivative/change along the U or V coordinate in a 2d texture/array be single dimension variable as we are checking it only along ddx (U coordinate) or ddy (V coordinate)?

like image 940
Nims Avatar asked Jul 04 '14 07:07

Nims


1 Answers

There are 4 distinct partial derivatives here: du/dx, dv/dx, du/dy, and dv/dy. None of those four values need be zero, unless the texture image coordinates happen to be perfectly aligned to the display screen axes. In general the texture coordinate axes need not be aligned to the screen display axes. X and Y (display viewport axes) are not the same directions as U and V (texture image axes).

Diagram showing relationship of UV and XY

In other words, the Jacobian matrix that relates the 2D screen/viewport coordinate system to the 2D texture/image UV coordinate system contains 4 entries: Two per adjustable parameter.

like image 169
Christopher Bruns Avatar answered Sep 24 '22 20:09

Christopher Bruns