Skip to main content
3 of 5
added 77 characters in body
user avatar
user avatar

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

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

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.

If vertices send some properties to the fragments (like a colour), they get interpolated across the surface of the triangle to all the fragments.

Lasse
  • 3.2k
  • 2
  • 21
  • 31