Book Image

Application Development with Swift

By : Hossam Ghareeb
Book Image

Application Development with Swift

By: Hossam Ghareeb

Overview of this book

Table of Contents (14 chapters)

3D rendering


To render in 3D, you need to convert your 3D world to 2D images by applying effects and methods to make them look plausible. You take geometric data of your world and add perspective, material properties, lighting, and textures. Then, with some illusion and understanding of the human visual system, you make things look real.

Pipeline

In the past, we had the "fixed-function" pipeline, which means that the hardware is configurable, not programmable. So, you have to set certain states in the GPU to be applied. For example, in lighting or changing graphic states for textures, you can't write your own shaders. Then, the "programmable" pipeline that contains shaders was introduced. Shaders are small programs to be run per pixel or vertex. In that case, you write code that runs directly on the GPU. To make things clear, assume that we want to display a model on the screen. The object will be passed through the vertex shader, which projects this object on the virtual view plane. Then...