1 of 14

Computer Graphics Seminar

MTAT.03.305

Fall 2022

Raimond Tunnel

2 of 14

The Standard Graphics Pipeline

Data

Vertex Shader

Culling & Clipping

Rasterization

Fragment Shader

Visibility tests & Blending

vs

n

vs

vs

3 of 14

The Standard Graphics Pipeline

Data

Culling & Clipping

Rasterization

Visibility tests & Blending

vs

n

vs

vs

Vertex Shader

Fragment Shader

4 of 14

We start with a triangle.

5 of 14

VS

VS

VS

Vertex shader instances parse every vertex.

We start with a triangle.

6 of 14

FS

FS

FS

FS

FS

FS

FS

FS

VS

VS

VS

Vertex shader instances parse every vertex.

We start with a triangle.

Fragment shader instances parse every fragment.

The face is rasterized into fragments.

7 of 14

FS

FS

FS

FS

FS

FS

FS

FS

VS

VS

VS

uniform variable – global immutable values, accessible from all shaders

uniform

CPU

8 of 14

FS

FS

FS

FS

FS

FS

FS

FS

VS

VS

VS

uniform variable – global immutable values, accessible from all shaders

attribute variable – values associated with each vertex

uniform

attribute

CPU

CPU

9 of 14

FS

FS

FS

FS

FS

FS

FS

FS

VS

VS

VS

uniform variable – global immutable values, accessible from all shaders

attribute variable – values associated with each vertex

varying variable – values assigned in the vertex shader� and interpolated to the fragments

uniform

attribute

varying

interpolation

CPU

CPU

10 of 14

FRAGMENT SHADER

VERTEX SHADER

<code>

<code>

uniforms

attributes

Data

GLSL

GLSL

11 of 14

FRAGMENT SHADER

VERTEX SHADER

<code>

<code>

uniforms

attributes

Data

GLSL

GLSL

12 of 14

FRAGMENT SHADER

VERTEX SHADER

<code>

<code>

uniforms

attributes

Data

GLSL

GLSL

13 of 14

Time to <code>

14 of 14

Solutions

You can do it!