Skip to main content
added 34 characters in body
Source Link
Daniel
  • 121
  • 1
  • 5

Fun fact: $Z_{ndc}$ has the form $z'=A+\frac{B}{z}$$Z_{ndc}=A+\frac{B}{z}$ (where $z$ is in view space) and is also linearly interpolated in screen-space for z-buffering:

Fun fact: $Z_{ndc}$ has the form $z'=A+\frac{B}{z}$ and is also linearly interpolated in screen-space for z-buffering:

Fun fact: $Z_{ndc}$ has the form $Z_{ndc}=A+\frac{B}{z}$ (where $z$ is in view space) and is also linearly interpolated in screen-space for z-buffering:

edited body
Source Link
Daniel
  • 121
  • 1
  • 5

Fun fact: NDC z-coordinates of$Z_{ndc}$ has the form $z'=A+\frac{B}{z}$ areand is also linearly interpolated in screen-space for z-buffering:

Thus both steps amount to LERPa lerp of NDC z$Z_{ndc}$.

Fun fact: NDC z-coordinates of the form $z'=A+\frac{B}{z}$ are also linearly interpolated in screen-space for z-buffering:

Thus both steps amount to LERP of NDC z.

Fun fact: $Z_{ndc}$ has the form $z'=A+\frac{B}{z}$ and is also linearly interpolated in screen-space for z-buffering:

Thus both steps amount to a lerp of $Z_{ndc}$.

deleted 16 characters in body
Source Link
Daniel
  • 121
  • 1
  • 5

The vertex NDCs are $I_1/Z_1$ and $I_2/Z_2$ and the perspective-correct interpolation equation gives: $$ \left[\frac{I_1}{Z_1^2}+s\left(\frac{I_2}{Z_2^2}-\frac{I_1}{Z_1^2}\right)\right]Z_t $$ which is clearly not $I_t/Z_t$ as defined in $\eqref{*}$. The reason this equation doesn't work in this case is that its derivation is based on the fact thatrequires the attribute to variesvary linearly across the triangle in 3D space (view space). But screen-space NDC coords don't vary linearly in 3D space because of the perspective divide, so the premise is broken. (Clip-space coords do vary linearly in view-space because they are the result of a linear transform.) Perspective-correct interpolation of values that have undergone perspective divide doesn't work. They are not in 3D space anymore, rather in 2D projection space and thus require linear interpolation in screen-space to get correct results. In practice it's accomplished using perspective-correct interpolation of clip-space coords, plus perspective divide per-pixel.

The vertex NDCs are $I_1/Z_1$ and $I_2/Z_2$ and the perspective-correct interpolation equation gives: $$ \left[\frac{I_1}{Z_1^2}+s\left(\frac{I_2}{Z_2^2}-\frac{I_1}{Z_1^2}\right)\right]Z_t $$ which is clearly not $I_t/Z_t$ as defined in $\eqref{*}$. The reason this equation doesn't work in this case is that its derivation is based on the fact that the attribute varies linearly across the triangle in 3D space (view space). But screen-space NDC coords don't vary linearly in 3D space because of the perspective divide, so the premise is broken. (Clip-space coords do vary linearly in view-space because they are the result of a linear transform.) Perspective-correct interpolation of values that have undergone perspective divide doesn't work. They are not in 3D space anymore, rather in 2D projection space and thus require linear interpolation in screen-space to get correct results. In practice it's accomplished using perspective-correct interpolation of clip-space coords, plus perspective divide per-pixel.

The vertex NDCs are $I_1/Z_1$ and $I_2/Z_2$ and the perspective-correct interpolation equation gives: $$ \left[\frac{I_1}{Z_1^2}+s\left(\frac{I_2}{Z_2^2}-\frac{I_1}{Z_1^2}\right)\right]Z_t $$ which is clearly not $I_t/Z_t$ as defined in $\eqref{*}$. The reason this equation doesn't work in this case is that its derivation requires the attribute to vary linearly across the triangle in 3D space (view space). But screen-space NDC coords don't vary linearly in 3D space because of the perspective divide, so the premise is broken. (Clip-space coords do vary linearly in view-space because they are the result of a linear transform.) Perspective-correct interpolation of values that have undergone perspective divide doesn't work. They are not in 3D space anymore, rather in 2D projection space and thus require linear interpolation in screen-space to get correct results. In practice it's accomplished using perspective-correct interpolation of clip-space coords, plus perspective divide per-pixel.

added 14 characters in body
Source Link
Daniel
  • 121
  • 1
  • 5
Loading
added 585 characters in body
Source Link
Daniel
  • 121
  • 1
  • 5
Loading
added 28 characters in body
Source Link
Daniel
  • 121
  • 1
  • 5
Loading
edited body
Source Link
Daniel
  • 121
  • 1
  • 5
Loading
added 2 characters in body
Source Link
Daniel
  • 121
  • 1
  • 5
Loading
deleted 26 characters in body
Source Link
Daniel
  • 121
  • 1
  • 5
Loading
added 389 characters in body
Source Link
Daniel
  • 121
  • 1
  • 5
Loading
added 389 characters in body
Source Link
Daniel
  • 121
  • 1
  • 5
Loading
deleted 299 characters in body
Source Link
Daniel
  • 121
  • 1
  • 5
Loading
added 104 characters in body
Source Link
Daniel
  • 121
  • 1
  • 5
Loading
added 24 characters in body
Source Link
Daniel
  • 121
  • 1
  • 5
Loading
added 24 characters in body
Source Link
Daniel
  • 121
  • 1
  • 5
Loading
added 299 characters in body
Source Link
Daniel
  • 121
  • 1
  • 5
Loading
added 1 character in body
Source Link
Daniel
  • 121
  • 1
  • 5
Loading
added 6 characters in body
Source Link
Daniel
  • 121
  • 1
  • 5
Loading
added 133 characters in body
Source Link
Daniel
  • 121
  • 1
  • 5
Loading
added 265 characters in body
Source Link
Daniel
  • 121
  • 1
  • 5
Loading
deleted 21 characters in body
Source Link
Daniel
  • 121
  • 1
  • 5
Loading
deleted 93 characters in body
Source Link
Daniel
  • 121
  • 1
  • 5
Loading
deleted 93 characters in body
Source Link
Daniel
  • 121
  • 1
  • 5
Loading
added 50 characters in body
Source Link
Daniel
  • 121
  • 1
  • 5
Loading
added 276 characters in body
Source Link
Daniel
  • 121
  • 1
  • 5
Loading