Reader small image

You're reading from  Become a Unity Shaders Guru

Product typeBook
Published inJul 2023
Reading LevelN/a
PublisherPackt
ISBN-139781837636747
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Mina Pêcheux
Mina Pêcheux
author image
Mina Pêcheux

Mina Pêcheux is a freelance content creator who has been passionate about game development since an early age. She is a graduate of the French Polytech School of Engineering in applied mathematics and computer science. After a couple of years of working as a data scientist and web developer in startups, she turned to freelancing and online instructional content creation to reconnect with what brightens her days: learning new things everyday, sharing with others and creating multi-field projects mixing science, technology, and art.
Read more about Mina Pêcheux

Right arrow

Rendering 3D scenes on a 2D screen

We’ve seen that a 3D shape cannot be blitted on a screen as-is. This is because the computer just doesn’t have the required information to fill the entire set of pixels from the virtual positions of the shape’s vertices. So, in practice, how do shaders achieve this? In the following sections, we will discuss the working of shaders, both in general and in Unity.

A typical 3D rendering pipeline

Shaders are able to bridge the gap between the scarce 3D data and the denser 2D pixel information, thanks to the following three-step process:

  1. Vertex shader: First of all, the shader has to gather all the data about the shape that is necessary for its render. This is done in the vertex shader: this piece of code is run in parallel on all vertices of the 3D mesh and transforms the initial raw per-vertex data into processed per-vertex data. Usually, this process implies converting the vertex’s position from object space...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Become a Unity Shaders Guru
Published in: Jul 2023Publisher: PacktISBN-13: 9781837636747

Author (1)

author image
Mina Pêcheux

Mina Pêcheux is a freelance content creator who has been passionate about game development since an early age. She is a graduate of the French Polytech School of Engineering in applied mathematics and computer science. After a couple of years of working as a data scientist and web developer in startups, she turned to freelancing and online instructional content creation to reconnect with what brightens her days: learning new things everyday, sharing with others and creating multi-field projects mixing science, technology, and art.
Read more about Mina Pêcheux