What is a fragmentĪs previously mentioned in the render pipeline overview, a fragment is a sample of a primitive that contains certain information required for coloring a pixel.Ī pixel can consist of multiple fragments, because, depending upon what area of the primitive the pixel covers, there can be multiple values present within the pixel, which have to either be combined, or just one selected at random.Īs an example, take a circle that is to be rendered on a screen of size 8x8 pixels (total of 64 pixels), as shown by the image below: Since it is executed per fragment on all fragments generated by the GPU pipeline, any operation that requires modification of the color of the fragment (like brightening due to lights or darkening due to shadows) can be done through the fragment shader. Similar to how a vertex shader operates on vertices of an object, a fragment shader operates on a "fragment" of an object and tells what the color of that fragment is supposed to be. Shader Basics - Fragment Shader What is a fragment shader
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |