fbpx
🚀Get the Unity Shaders Bible with a 15% OFF! Only for a limited time🚀

Here's your free sample!

1.0.9. Geometry processing phase

This post is also available in…

The images that you see on the computer screen are requested by the GPU for the CPU. These requests are carried out in two main steps:

  1. The configuration of the render state, which corresponds to the set of stages from geometry processing up to pixel processing.
  2. And then, the object being drawn on the screen. 

The geometry processing phase occurs in the GPU and is responsible for the vertex processing of your object, which is divided into four subprocesses which are: 

  • Vertex Shading.
  • Projection.
  • Clipping.
  • Screen mapping.
(Fig. 1.0.9a)

Once the primitives have been assembled in the application stage, the Vertex Shading, better known as the Vertex Shader Stage, carries out two main tasks: 

  1. It calculates the object vertices position.
  2. Then it transforms its position to different space coordinates so that they can be projected onto the computer screen. 

Also, within this subprocess, you can select properties that you want to pass on to the following stages, for example, Normals, Tangents, UV coordinates, etc. 

Projection and clipping occur in this process, which vary according to the camera properties in the scene: that is, if it is configured in perspective or orthographic (parallel). It is worth mentioning that the complete rendering process only occurs for those elements that are within the camera frustum, also known as the View-Space. 

To understand this process, say there is a Sphere in the scene, where half of it is outside the frustum of the camera. Only the area of ​​the Sphere that lies within the frustum will be projected and subsequently clipped on the screen (clipping), while the area of ​​the Sphere that is out of sight will be discarded in the rendering process.

(Fig. 1.0.9b)

Once the clipped objects are in the memory, they are then sent to the screen map. In this stage, the three-dimensional objects in the scene are transformed into 2D screen coordinates, also known as Screen or Window coordinates.

Follow us to stay informed about all the latest news, updates, and more.

Join the group to share your experiences with other developers.

Subscribe to our channel and keep learning game dev!

Jettelly Team

We are a team of indie developers with more than 9 years of experience in video games. As an independent studio, we have developed Nom Noms in which we published with Hyperbeard in 2019. We are currently developing The Unity Shader Bible.

Follow us on our social networks.