Aeva / m.grl

Midnight Graphics & Recreation Library
http://mgrl.midnightsisters.org
GNU Lesser General Public License v3.0
44 stars 3 forks source link

remove "up_vector" from spot lights and sun lights #227

Open Aeva opened 8 years ago

Aeva commented 8 years ago

Instead, before calling the function to generate the view matrix, the up_vector should be determined from the vector from the light position to the look_at target: if the vector is parallel to (0, 0, 1), then the up_vector should be (0, 1, 0), otherwise it should be (0, 0, 1).

For generating shadow maps, the up vector doesn't actually matter. It might be a good idea to keep the option to specify the up vector for spot lights though, if a texture is employed to allow the light to project a texture as well.