<p>I am reading through an old paper (<a href="https://www.academia.edu/28684978/Interpolation_for_Polygon_Texture_Mapping_and_Shading" rel="nofollow noreferrer">Interpolation for Polygon Texture Mapping and Shading</a>), cause it is mentioned in other papers I am reading.</p>
<p>In section two we have the following steps to perform linear interpolation of parameters in screen space</p>
<blockquote>
<ol>
<li>Associate a record containing the paraemters of interest with each vertex of the polygon</li>
<li>For each transform object space coordinates to homogeneous space using screen space using 4x4 object to screen matrix, yielding the values <span class="math-container">$(xw,yw,zw,w)$</span>.</li>
<li>Clip the polygon against plane equations for each of the six sides of the viewing frustum, linearly interpolating all the parameters when the new vertices are created.</li>
<li>Perform a homogenous division to compute $x = xw/w, y = yw/w, z = zw/w.</li>
<li>Scan convert in screen space, by linear interpolation of all the parameters using the parameter value at each pixel for shading.</li>
</ol>
</blockquote>
<p>Following this procedure for texture mapping for example, according to the paper, it would produce artifacts like the following:</p>
<p><a href="https://i.sstatic.net/hfMFf.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/hfMFf.png" alt="enter image description here" /></a></p>
<p>I understand what the artifact is, what I don't understand where (from the math) the artifact is coming from. Can anyone clarify somewhat where this is coming from?</p>
<p>Also I think the code associated with the procedure above is in
<a href="https://webdocs.cs.ualberta.ca/%7Egraphics/books/GraphicsGems/gems/PolyScan/poly_scan.c" rel="nofollow noreferrer">here</a></p>

CC BY-SA 4.0
2022-03-17T17:00:53.803Z
A linear function (plane) can pass at most through 3 linearly independent points. Whatever you do, if you pick a 4th point not on the plane, there is no way to find a plane passing thtough all 4. So it is in general impossible to achieve linear interpolation through 4 arbitrary points. You can achieve bilinear interpolation there. Or for more vertices there are many different variants of generalized barycentric coordinates. Thus the above image just uses some hack, so it's unsurprising that you get such artifacts.
lightxbulb
CC BY-SA 4.0
2022-03-17T19:44:35.423Z
The key idea in the Heckbert/Moreton paper is to do a linear interpolation of parameters (any parameter not just u,v coordinates) and do linear interpolation of the homogeneous interpolation factor. Then divide the interpolated parameters by the interpolated "interpolation factor"  also called the perspective divide, to get accurately interpolated values. The biggest difference in the math is calculating the interpolation factor. Which is presented in the paper. The images you posted are used over and over in presentations and other papers that cover perspective correct interpolation.
pmw1234
CC BY-SA 4.0
2022-03-18T09:21:11.010Z
@pmw1234 Yeah I realized that. It is a bit difficult though to interpret the original paper though.
user8469759
CC BY-SA 4.0
2022-03-18T09:30:25.423Z
@lightxbulb I think I understand that. But what was I trying to workout is specifically we're does the bilinearity come from that the paper mention as an artifact.
user8469759
CC BY-SA 4.0
2022-03-18T10:13:03.313Z
The above doesn't look like proper bilinear interpolation. For example see: https://www.reedbeta.com/blog/quadrilateral-interpolation-part-2/
I am assuming the authors do something hacky, so I would generally advise against delving in said paper.
lightxbulb
<texture><rasterizer>
Polygon Rendering with Linear interpolation
user8469759
# Polygon Rendering with Linear interpolation

(Asked by: username_0 on 2022-03-17)

I am reading through an old paper ([Interpolation for Polygon Texture Mapping and Shading](https://www.academia.edu/28684978/Interpolation_for_Polygon_Texture_Mapping_and_Shading)), cause it is mentioned in other papers I am reading.

In section two we have the following steps to perform linear interpolation of parameters in screen space

> 1. Associate a record containing the paraemters of interest with each vertex of the polygon
> 2. For each transform object space coordinates to homogeneous space using screen space using 4x4 object to screen matrix, yielding the values $(xw,yw,zw,w)$.
> 3. Clip the polygon against plane equations for each of the six sides of the viewing frustum, linearly interpolating all the parameters when the new vertices are created.
> 4. Perform a homogenous division to compute $x = xw/w, y = yw/w, z = zw/w.
> 5. Scan convert in screen space, by linear interpolation of all the parameters using the parameter value at each pixel for shading.

Following this procedure for texture mapping for example, according to the paper, it would produce artifacts like the following:

[![enter image description here](https://i.sstatic.net/hfMFf.png)](https://i.sstatic.net/hfMFf.png)

I understand what the artifact is, what I don't understand where (from the math) the artifact is coming from. Can anyone clarify somewhat where this is coming from?

Also I think the code associated with the procedure above is in
[here](https://webdocs.cs.ualberta.ca/%7Egraphics/books/GraphicsGems/gems/PolyScan/poly_scan.c)

**Tags:** texture, rasterizer

> **Comments:**
> **username_1**: A linear function (plane) can pass at most through 3 linearly independent points. Whatever you do, if you pick a 4th point not on the plane, there is no way to find a plane passing thtough all 4. So it is in general impossible to achieve linear interpolation through 4 arbitrary points. You can achieve bilinear interpolation there. Or for more vertices there are many different variants of generalized barycentric coordinates. Thus the above image just uses some hack, so it's unsurprising that you get such artifacts.  
> **username_2**: The key idea in the Heckbert/Moreton paper is to do a linear interpolation of parameters (any parameter not just u,v coordinates) and do linear interpolation of the homogeneous interpolation factor. Then divide the interpolated parameters by the interpolated "interpolation factor"  also called the perspective divide, to get accurately interpolated values. The biggest difference in the math is calculating the interpolation factor. Which is presented in the paper. The images you posted are used over and over in presentations and other papers that cover perspective correct interpolation.  
> **username_0**: @username_2 Yeah I realized that. It is a bit difficult though to interpret the original paper though.  
> **username_0**: @username_1 I think I understand that. But what was I trying to workout is specifically we're does the bilinearity come from that the paper mention as an artifact.  
> **username_1**: The above doesn't look like proper bilinear interpolation. For example see: https://www.reedbeta.com/blog/quadrilateral-interpolation-part-2/ I am assuming the authors do something hacky, so I would generally advise against delving in said paper.  

---

## 0 answers

