<p>You are correct in your understanding that the rasterizer produces fragments. Each fragment can be thought of as a quasi-pixel, in that geometry may generate more than one fragment for the same pixel (such as in multisampling). The pixel shader's job is to take those fragments and compute lighting, color, etc., to produce the final pixel that gets written to the target buffer.</p>
<p>In essence: Vertex Shader -&gt; Rasterizer -&gt; Fragment -&gt; Pixel Shader -&gt; Pixel</p>
<p>You might also find the DX11 documentation <a href="https://docs.microsoft.com/en-us/windows/win32/direct3d11/overviews-direct3d-11-graphics-pipeline" rel="nofollow noreferrer">here</a>, and <a href="https://stackoverflow.com/questions/31173002/what-is-the-difference-between-a-sample-a-pixel-and-a-fragment">this</a> question about the difference between fragments, samples, and pixels to be useful.</p>

CC BY-SA 4.0
2022-04-24T12:42:10.710Z
and the size of the fragment is sample sized correct,which is hardware defined(cannot be changed by developer),correct?
VersesDev
CC BY-SA 4.0
2022-04-24T20:31:42.317Z
I believe so? Though seeing as its implementation defined, there's not much you could do about it anyway. In the end, I know of know way that you can query for it, so I'm honestly not sure it's something that application developers really need to concern themselves with.
Straivers
CC BY-SA 4.0
2022-04-22T02:46:12.777Z
2022-04-22T02:46:12.777Z
Straivers
<p>In general, a rasterizer converts a vector description of an image to a raster description, like converting (<em>center<sub>x</sub> center<sub>y</sub> radius color</em>) to a bitmap of a shaded circle. Literally, the rasters are the <em>rakes</em> (<a href="http://en.wikipedia.org/wiki/Rastrum" rel="nofollow noreferrer">unrelated implement named from the same Latin root</a>) or scanlines of the image, so they might be interally represented as rows of a bitmap or a run-length encoding or a set of cooefficients for a fourier transform or something.</p>
<p>The process can be considered as projecting the scanlines backwards into the model space and detecting where these lines intersect with the boundaries of objects. A distributed shader might produce a small bitmap or a few scanlines which must be reintegrated to produce the full image.</p>
<p>In a finer-grained setting, the rasterizer could be isolated to just detecting the edges of objects and then call the pixel shader for the smaller range of the scanline where it's actually inside of the object.</p>

CC BY-SA 4.0
2022-04-20T18:07:55.527Z
2022-04-20T18:07:55.527Z
luser droog
<p>&quot;A fragment is a potential pixel that has to pass some tests before becoming a pixel.&quot;</p>
<p><a href="https://www.youtube.com/watch?v=uH1ES8LOrlM" rel="nofollow noreferrer">https://www.youtube.com/watch?v=uH1ES8LOrlM</a></p>

CC BY-SA 4.0
2024-03-26T10:35:45.747Z
2024-03-26T10:35:45.747Z
user21335
<p>what exactly does the rasterizer outputs as per my knowlage it outputs primitives rasterized as fragments which seems correct as the next step in vulkan/opengl is fragment shader but dx confuses me here because there the step after rasterization is pixel shader.Is it just a convention for dx to call it pixel shader even though it runs per fragment or is my understanding incorrect that rasterizer outputs fragments.Also what is the size of a fragment?</p>

<opengl><vulkan><directx12><directx11>
what is the output from rasterizer
VersesDev
# what is the output from rasterizer

(Asked by: username_0 on 2022-04-20)

what exactly does the rasterizer outputs as per my knowlage it outputs primitives rasterized as fragments which seems correct as the next step in vulkan/opengl is fragment shader but dx confuses me here because there the step after rasterization is pixel shader.Is it just a convention for dx to call it pixel shader even though it runs per fragment or is my understanding incorrect that rasterizer outputs fragments.Also what is the size of a fragment?

**Tags:** opengl, vulkan, directx12, directx11


---

## 3 answers

### Answer by username_1 on 2022-04-22. Score: 1 | Accepted answer

You are correct in your understanding that the rasterizer produces fragments. Each fragment can be thought of as a quasi-pixel, in that geometry may generate more than one fragment for the same pixel (such as in multisampling). The pixel shader's job is to take those fragments and compute lighting, color, etc., to produce the final pixel that gets written to the target buffer.

In essence: Vertex Shader -> Rasterizer -> Fragment -> Pixel Shader -> Pixel

You might also find the DX11 documentation [here](https://docs.microsoft.com/en-us/windows/win32/direct3d11/overviews-direct3d-11-graphics-pipeline), and [this](https://stackoverflow.com/questions/31173002/what-is-the-difference-between-a-sample-a-pixel-and-a-fragment) question about the difference between fragments, samples, and pixels to be useful.

> **Comments:**
> **username_0**: and the size of the fragment is sample sized correct,which is hardware defined(cannot be changed by developer),correct?  
> **username_1**: I believe so? Though seeing as its implementation defined, there's not much you could do about it anyway. In the end, I know of know way that you can query for it, so I'm honestly not sure it's something that application developers really need to concern themselves with.  

---

### Answer by username_2 on 2022-04-20. Score: 0

In general, a rasterizer converts a vector description of an image to a raster description, like converting (*centerx centery radius color*) to a bitmap of a shaded circle. Literally, the rasters are the *rakes* ([unrelated implement named from the same Latin root](http://en.wikipedia.org/wiki/Rastrum)) or scanlines of the image, so they might be interally represented as rows of a bitmap or a run-length encoding or a set of cooefficients for a fourier transform or something.

The process can be considered as projecting the scanlines backwards into the model space and detecting where these lines intersect with the boundaries of objects. A distributed shader might produce a small bitmap or a few scanlines which must be reintegrated to produce the full image.

In a finer-grained setting, the rasterizer could be isolated to just detecting the edges of objects and then call the pixel shader for the smaller range of the scanline where it's actually inside of the object.


---

### Answer by username_3 on 2024-03-26. Score: 0

"A fragment is a potential pixel that has to pass some tests before becoming a pixel."

<https://www.youtube.com/watch?v=uH1ES8LOrlM>


---

