Shaders - 02. Graphics Render Pipeline
.
For mobile devices, 30-60 fps is standard, while VR targets 120 fps.
Sometimes it's also referred to as Hertz (Hz), which represents frequency.
What Is the Graphics Render Pipeline?
The graphics render pipeline is the process by which Unity renders images to the screen.
The general flow is: Culling > Rendering > Post-Processing > Display.
For each frame, this entire pipeline executes to produce the final displayed image.
1. Culling
The first stage is culling, which excludes objects outside the camera's field of view from rendering.
This is done to improve performance by not rendering objects that aren't visible.
2. Rendering
After culling comes rendering. Shaders process the vertices and fragments of visible objects.
In this stage, geometry is transformed, lighting is applied, and textures are mapped.
3. Post-Processing
After the main rendering is complete, post-processing effects can be applied.
This stage handles effects like bloom, motion blur, color grading, and more.
4. Display
Finally, the processed image is displayed on screen.
Unity's Render Pipelines
Unity offers several render pipelines:
- Built-in Render Pipeline: The legacy pipeline suitable for most projects
- Universal Render Pipeline (URP): Optimized for mobile and performance
- High Definition Render Pipeline (HDRP): For high-end graphics and PC/console games
Understanding the Pipeline
Each stage of the pipeline has specific responsibilities:
- Vertex Shader: Processes vertex positions and transforms them into screen space
- Fragment/Pixel Shader: Determines the color of each pixel based on material properties
This is why understanding the render pipeline is essential for writing efficient shaders.
When writing shaders, you're essentially instructing the graphics pipeline on how to render geometry.
Summary
The graphics render pipeline is the backbone of 3D graphics in games.
Understanding how Unity processes geometry, applies materials, and displays the final result enables you to write more efficient shaders and optimize game performance.
In the next article, we'll dive deeper into how to write custom shaders using this pipeline knowledge.