![]() For Direct3D, calling the ddx() or ddy() function returns the difference between the "first" pixel (top left*) and the pixel to its right or bellow it, and all pixels within the pixel quad get that same value. This is the smallest region a GPU can render if the GPU is rendering 1 pixel of something, it's always actually rendering 4 pixels in parallel. ![]() Now I say "above or below" and "left or right", and you might be thinking "okay, how can it be or?" All modern GPUs break up the screen into a grid of 2x2 pixels, known as a pixel quad. ddx() is the one to the left or right, and fwidth() is abs(ddx(n)) + abs(ddy(n)). In the case of ddy() it's the difference between the pixel and the one above or below it. Which is a complicated way of saying it's a function that says how much a value is changing from one pixel to the one next to it. Oskar's stuff is amazing, but he's hand waving away a lot of the implementation details here.ĭdy(), and the related function ddx() and fwidth() are screen space partial pixel derivative functions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |