Tuesday, 28 April 2015

HA7 - Task 2: Displaying 3D Polygon Animations

Graphical rendering is done by the Central Processing Unit (CPU), and Graphics Processing Unit (GPU). The CPU tells the GPU what to render, for example lighting or shadows.

API

Game engines use software called Application Programming Interfaces (API). An API is made up of a set of routines or protocols, and tools for making software applications. Good APIs provide all the pieces for making a program, to make it easier.

Direct3D
Direct3D is an API that is used to manipulate and display 3D objects. It's developed by Microsoft, and gives programmers a way to develop 3D programs. Almost all PCs support Direct3D.

OpenGL
OpenGL is a 3D graphics language. There are 2 different versions, Microsoft OpenGL which was developed by microsoft, and Cosmo OpenGL which was developed by Silicon Graphics.
The Microsoft version is built into Windows and was made to improve performance. The Cosmo version is software only and specifically designed for machines without a graphics accelerator.

Graphics Pipeline
The graphics pipeline (also called the rendering pipeline), is the process of creating a 2D raster image on a 3D scene. Once a 3D model has been created, it must be converted into what the monitor will display. Some examples of graphics pipelines are OpenGL and DirectX/Direct3D.

Stages of a Graphics Pipeline

(Source)

3D Geometric primitives
The scene is created using primitives, usually triangles because they exist only on one plane.

Modelling and Transformation
It is transformed from the local co-ordinate system to a 3D co-ordinate system.

Camera Transformation
Then It's transformed from the 3D co-ordinate system to THE 3D camera co-ordinate system.

Lighting
The scene is then lit up according to how light the colours are and how reflective the object is. An example would be a completely white object on a black background, the lighting would need to be adjusted for that to be seen.

Projection Transformation
It is transformed from 3D co-ordinates to a 2D camera view. Distant object will be made smaller, and the camera will focus on the central object.

Clipping
Any of the primitives that are outside of view won't be visible, and will be removed.

Scan Conversion or Rasterization
The image is converted to a raster format, and made up of pixels. Then individual pixels can be altered, which is a very complex step.

Texturing, Fragment Shading
The individual fragments get given colors based on values given during the rasterization stage. 

No comments:

Post a Comment