Merge: gamnit: Blinn-Phong specular lighting, 3 axes of rotation and more
authorJean Privat <jean@pryen.org>
Wed, 7 Jun 2017 20:11:08 +0000 (16:11 -0400)
committerJean Privat <jean@pryen.org>
Wed, 7 Jun 2017 20:11:08 +0000 (16:11 -0400)
Implement a Blinn-Phong specular lighting shader to replace the previous Lamber diffuse lighting. It creates a reflection effect either from `specular_color` (as on the shields) or `specular_texture` (as on the gold tower).

![screenshot from 2017-05-31 10 16 13](https://cloud.githubusercontent.com/assets/208057/26636318/5a017ffc-45ea-11e7-8571-0918f13f6d9c.png)
![screenshot from 2017-05-30 23 13 32](https://cloud.githubusercontent.com/assets/208057/26636316/59c940c4-45ea-11e7-9106-99f9344cecbf.png)

The required material attributes for the specular effect were already present but not implemented. This PR adds similar attributes for normal maps, but leave them as a TODO. The new shader is fine but not optimal, I'll probably need to rewrite it to gain some performance, support normal maps and improve normals per vertex.

Add two angles of rotation to actors for full 3D rotation with Euler angles. All rotation angles follow the right-hand rule and are consistent between the camera and actors.

Other changes:
* Intro `Cuboid` that can be created by `Boxed3d::to_mesh`.
* Better error management when loading models.
* Fix missing `lock_cursor` implementation on desktop. It allows creating FPS like cameras.
* Fix and update `angle_lerp` to follow the style of `lerp` (where `self` is the weight).
* Improve the template project so 3D objects don't blend in the background and explain the printed performance statistics.

In a future PR, I'll standardize the assets classes and move some service up to `Asset`. This would allow for easier loading of all assets at once, no matter their type, and offer a standard behavior regarding errors and lazy loading.

Pull-Request: #2471
Reviewed-by: Jean-Christophe Beaupré <jcbrinfo.public@gmail.com>


Trivial merge