FBX: Add correct light locations and falloff values.
authorMatt Oliver <protogonoi@gmail.com>
Mon, 9 Jan 2017 05:07:40 +0000 (16:07 +1100)
committerMatt Oliver <protogonoi@gmail.com>
Mon, 9 Jan 2017 06:03:25 +0000 (17:03 +1100)
commitb34a552fb759d5aa810a7d48c90781b198d856f5
tree6588bb98c2df791df4ce5c7e51065c777b96e860
parent685c737051fe74b9ed8ad41df9849e6b60b2d25f
FBX: Add correct light locations and falloff values.

Fbx lights are stored in the scene graph as well as having separate light properties.
The separate light properties have a light position and direction that is already fully
transformed based on its position in the scene graph so this results in the assimp
light being transformed twice. Since the scene graph contains all the relevant
transformations the light position and direction can just use default values. Fbx
specifies lights along the negative y axis so the default light values have a up and
direction set accordingly.

The DecayStart value specifies the distance from the light that the light intensity
will drop to half. Using the default assimp falloff equation of f=1/c+lr+qr^2 then
the falloff coefficients can be calculated for either c,l or q accordingly by setting
r=DecayStart and f=0.5.

Fixes #851
code/FBXConverter.cpp
code/FBXDocument.h