Let There Be Light!

Here’s the same sample as the last one but with lighting added to it. Notice that depth of the shaded colors now vary in detail depending on what type of light is used. Three types of lights are used in this application. Namely Directional/Parallel light(i.e sun), Point light(i.e. light bulb) and Spot light (i.e. ..err.. spot lights). The main formula that makes these lighting work is “Lambert’s Cosine Law”. The screenshots below also uses Phong Shading. Phong shading provides the most detailed but also the most expensive type of shading. Other types of shading are Lambertian and Garraud shading. These two shading types are less expensive but gives lesser shading quality( lower polygon models have triangles more noticeable(forgot the actual word)). For more info see [ELengyel04] or [FLuna08].

Directional Light Point Light Spot Light
directional point spot

[ELengyel04] : Mathematics for 3D Game Programmers & Computer Graphics 2nd Edition
[FLuna08] : Introduction to 3D Game Programming with DirectX 10

– CodeSushi


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s