Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
GLSL Essentials

You're reading from   GLSL Essentials If you're involved in graphics programming, you need to know about shaders, and this is the book to do it. A hands-on guide to the OpenGL Shading Language, it walks you through the absolute basics to advanced techniques.

Arrow left icon
Product type Paperback
Published in Dec 2013
Publisher Packt
ISBN-13 9781849698009
Length 116 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Jacobo Rodriguez Jacobo Rodriguez
Author Profile Icon Jacobo Rodriguez
Jacobo Rodriguez
Arrow right icon
View More author details
Toc

Execution model


When a primitive stage has ended, its processing in the vertex primitive stages (vertex shaders, geometry shaders, and clipping) becomes rasterized. The fragment shader execution begins this rasterization.

Consider a triangle; in order to paint that triangle onto the screen you need to convert it from its native vectorial form (vertices coordinate) to discrete pixels. The system that carries out that action is the fragment shader module, being executed once per each fragment.

The more of the framebuffer's area the primitive covers, the more times the fragment shader will be executed. The fragment shaders' performance has direct influence on your application's fill rate (the speed at which the GPU can output fragments).

Having said that, let's see two very important constraints about fragment shaders:

  • A fragment shader can't read the framebuffer. It's only capable of writing into it. If you need to mix your framebuffer with the result of your fragment shader computations, you...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime