Master the fundamental concepts of gpu architecture through this focused micro-challenge.
Modern GPUs render images through a multi-stage pipeline. Early GPUs used fixed-function stages; today most stages are programmable shaders, but the data flow remains the same.
The standard pipeline in order:
The rasterizer is the bridge between the vertex-centric and fragment-centric worlds. For example, one triangle with three vertices can generate thousands of fragments on a large screen area.
Vertex shaders run once per vertex. Fragment shaders run once per fragment. Attributes like color and texture coordinates are interpolated across the triangle surface using barycentric coordinates during rasterization.
cLoading…
Vulkan, Direct3D 12, and Metal expose this same sequence as explicit pipeline state objects. Engines from id Tech to Unreal execute billions of these stage transitions per frame.
You will simulate the pipeline for a single triangle, printing what happens at each stage from vertex input through fragment output. This task asks you to trace attribute interpolation and show how three vertices become many fragments. Getting rasterizer barycentric interpolation right here is the prerequisite for the software rasterizer subtrack.
Write a C program that documents and simulates the graphics pipeline stages for a single triangle.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github