N. J. Funk
N. J. Funk

Reputation: 122

How does the rasterizer create fragments?

Does the rasterizer (in OpenGL) create one fragment for each pixel the triangle is mapped to? So if we have 4 triangles and each triangle covers the whole screen (each triangle has a different z value) and my resolution is 1080*720, are there then 1080*720*4 fragments created?

I got confused with this concepts because I haven't seen it mentioned clearly somewhere. And will the fragment shader then render all these fragments or are they discarded based on the depth function settings before rendering?

Im assuming there is no multisampling.

Upvotes: 0

Views: 262

Answers (1)

robthebloke
robthebloke

Reputation: 9682

That's pretty much the crux of it. The only complication in this case may be thrown up by depth testing, which may discard fragments if the Z test fails. So assuming each triangle is rendered in front of the proceeding triangle, then yes you'll have 1080*720*4 fragments.

Upvotes: 3

Related Questions