<p>Sample gaps will occur if you don't do things "properly". </p>

<p>In OpenGL or D3D, assuming a consistent winding order, if you have triangles  ABC and CBD, then when a sample point - that is a test during scan conversion to determine if a point (read pixel) is inside a triangle - lies <em>exactly</em> on the shared edge BC, then that sample will belong to <em>exactly one</em> of those two triangles. </p>

<p>This avoids both gaps <em>and</em> double filling. The latter would be problematic with, say, translucency or stencil operations.</p>

CC BY-SA 3.0
2016-05-23T18:27:22.187Z
As an example two edge sharing triangles may perfectly splitting the same pixel in two but an OpenGL implementation shall guarantee only one of the triangles cover the pixel center. Which one is implementation dependent.
Andreas
CC BY-SA 3.0
2016-05-23T11:55:20.703Z
2018-01-03T08:28:59.960Z
2018-01-03T08:28:59.960Z
Simon F
<p>In <a href="https://www.roiatalla.com/public/arcsynthesis/Basics/Intro%20Graphics%20and%20Rendering.html" rel="noreferrer">this tutorial</a>,</p>
<blockquote>
<p>It is very often the case that triangles are rendered that share
edges. OpenGL offers a guarantee that, so long as the shared edge
vertex positions are identical, there will be no sample gaps during
scan conversion.</p>
</blockquote>
<p>1 What exactly are sample gaps during scan conversion?</p>
<p>2 Under what circumstances, will it happen?</p>
<p>3 Does it happen when the line cross the center of the fragment?</p>

<opengl><rasterizer>
What are sample gaps during scan conversion?
AlexWei
# What are sample gaps during scan conversion?

(Asked by: username_0 on 2016-05-23)

In [this tutorial](https://www.roiatalla.com/public/arcsynthesis/Basics/Intro%20Graphics%20and%20Rendering.html),

> It is very often the case that triangles are rendered that share
> edges. OpenGL offers a guarantee that, so long as the shared edge
> vertex positions are identical, there will be no sample gaps during
> scan conversion.

1 What exactly are sample gaps during scan conversion?

2 Under what circumstances, will it happen?

3 Does it happen when the line cross the center of the fragment?

**Tags:** opengl, rasterizer


---

## 1 answers

### Answer by username_1 on 2016-05-23. Score: 8 | Accepted answer

Sample gaps will occur if you don't do things "properly".

In OpenGL or D3D, assuming a consistent winding order, if you have triangles ABC and CBD, then when a sample point - that is a test during scan conversion to determine if a point (read pixel) is inside a triangle - lies *exactly* on the shared edge BC, then that sample will belong to *exactly one* of those two triangles.

This avoids both gaps *and* double filling. The latter would be problematic with, say, translucency or stencil operations.

> **Comments:**
> **username_2**: As an example two edge sharing triangles may perfectly splitting the same pixel in two but an OpenGL implementation shall guarantee only one of the triangles cover the pixel center. Which one is implementation dependent.  

---

