Skip to main content
2 of 5
added 95 characters in body
Lasse
  • 3.2k
  • 2
  • 21
  • 31

Vertex shaders gets called a lot less than fragment shaders. It's because the fragments get generated from the vertices. Let's say that you have a triangle abc like this:

a = 0,0,0 
b = 1,0,0 
c = 1,1,0

Now depending on the resolution, this generates some amount of fragments covering the whole triangle. With certain projection configuration this will produce a triangle which covers half of the screen, which at 1920x1200 resolution and back faces culled will be 1920*1200/2 fragments. Without back face culling, it will be twice that. The amount of fragments increase with every triangle you draw.

A fragment is not a pixel. It is much more. http://en.wikipedia.org/wiki/Shader#Simplified_graphic_processing_unit_pipeline

If vertices send some properties to the fragments like a colour, they get interpolated to all the fragments.

Lasse
  • 3.2k
  • 2
  • 21
  • 31