CG study #4

I finished the chapter 7 of the book 3D Game Programming with DirectX 11 that discussed about lighting model and different light types: directional light, point light and spot light.

ex. 1. asked to modify light colors of the chapters lighting demo.

Capturech7ex1

ex.2. asked to modify the specular power (p) of the materials in the lighting demo trying different values for it.

land and waves material with p = 256 and p = 64 and p = 8

Capturech7ex2_p256
p = 256
Capturech7ex2_p64
p = 64
p = 8
p = 8

ex.3. asked to implement toon shading by modifying diffuse and specular factions.

Capturech7ex3

ex.4 asked to implement  keys to to increase and decrease the angle of spotlight cone.

I implemented it by modifying the spot exponent in the spotfactor like this

if (GetAsyncKeyState('A') & 0x8000)
		mSpotLight.Spot += 10.0f*dt;

	if (GetAsyncKeyState('S') & 0x8000)
		mSpotLight.Spot -= 10.0f*dt;

next chapter texturing, now we are getting somewhere !

Leave a Reply

Your email address will not be published. Required fields are marked *