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

こ雲淡風輕ζ 提交于 2019-12-04 13:15:46

问题


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)?


回答1:


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).

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.




回答2:


You are computing the derivative of a variable (such as the uv-coordinate of a texture) with respect to the screenspace in either the x or y direction. Or in other words you could say that the function answer the question: "what change will happend to this variable when I move one pixel to [the left]/[up]".



来源:https://stackoverflow.com/questions/24568918/why-are-dfdx-ddx-and-dfdy-ddy-2-dimension-variables-when-quering-a-2d-texture

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!