3D Theory - Rendering


Types of shading

The brightness of any point on the screen depends on a lot of factors. It will depend on the colour and reflectivity of the point being looked at. It will depend on the colour, brightness and distance from any light sources. It will also depend on the angle between the surface, the eye/camera and the various sources of light. There will be may other factors such as reflections from other objects.

The method of generating the 2D view from the 3D model will be a compromise between the size of the model needed, computational time taken to render it and the realism of the image. Possible methods include:

Flat shading

The object is represented as flat surfaces. Each of these surfaces is represented by a single normal (a normal is a vector perpendicular on the surface). The colour of the whole surface is then calculated from the angle between the light source, the normal and the eye. The object will look as if it is made up of flat surfaces unless each surface is made very small.

Phong shading

In this case, instead of having a normal for each face, you have a normal for every single point on the object. This produces a much more realistic image, but has the overhead of generating and storing all these normals.

Gouraud shading

In this case you generate normals for each vertex, then the normal for any point on the face can be calculated by interpolating between the normals at its vertices. This is a good compromise between a small model size and a realistic image with continuously changing tones for curved objects.


metadata block
see also:

 

Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

cover cover

If you are doing a lot of OpenGL programming, and you can afford it. It really helps (in fact its almost essential) to have these 2 books at hand. The programming guide (red cover) explains the theory and the reference manual (blue cover) has complete definitions for all the API calls.

cover Tricks of the 3D Game Programming Gurus: Advanced 3D Graphics and Rasterization. - A very big book with the information you need if you want to write your own rastoriser instead of using OpenGL or ActiveX

Commercial Software Shop

Where I can, I have put links to Amazon for commercial software, not directly related to this site, but related to the subject being discussed, click on the appropriate country flag to get more details of the software or to buy it from them.

 

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2017 Martin John Baker - All rights reserved - privacy policy.