In terms of video games or computer graphics, what is a shader?

105 views

What is a vertex shader and a pixel shader? How do I know how many of these do I need to play a typical game?

In: 4

Anonymous 0 Comments

A “shader” is a simple program that runs on a GPU/Graphics Card.

A vertex shader is one that performs some operations on the vertices/geometry of the 3D models.

The vertex shader then passes the result of onto the pixel/fragment shader. The most basic vertex shader does a camera transformation on the geometry data then passes it onto the pixel/fragment shader. An example of a more complicated vertex shader is one that allows grass to sway in the wind or react when players/npcs walk through it.

The pixel/fragment shader is where a lot of the actual rendering happens. It takes in the geometry data from the vertex shader and and performs operations on all of the pixels within the chunk of geometry being rendered.

You don’t really need to worry about these as the player. But there’s anywhere from a couple shaders to hundreds depending on how complex things are.

Most shaders are pretty basic, and you really only see complex ones when necessary for certain effects.