Advertisement

a basic question

Started by February 08, 2015 02:59 PM
1 comment, last by frob 9 years, 11 months ago

What are the fragments of each object that are rendered? Are they simply the rasterized pixel that match a single pixel on the screen? Also does the depth testing starts when a triangle has been rasterized?

By fragments do you mean the lowest level of information in a model? If so these are simply triangular polygons which can be shaded and/or textured.

These are represented by three points in 3d space.

Depth testing is usually done by creating a depth buffer which is used by your graphics api (e.g. DirectX) to determine correct draw order of the scene.

Luckily days are long gone where you have to worry about internal implementation of a depth buffer yourself, but there are lots of articles on Google if the inner guts interest you.

Have fun!

Advertisement


What are the fragments of each object that are rendered? Are they simply the rasterized pixel that match a single pixel on the screen?

Yes, a fragment, as in a fragment shader, is the data that is about to be written for a single pixel.

The fragment variables -- the things you can modify -- include the color to be written, the depth both as a distance and as a fraction of the clip space, and the front facing or back facing status.


Also does the depth testing starts when a triangle has been rasterized?

Normally depth testing takes place after the fragment shader. However, in some cases the card can use an early fragment depth test.

This topic is closed to new replies.

Advertisement