Просмотр исходного кода

Merge pull request #874 from dgough/next

Fixed a bug in the encoder where point lights were converted to ambient lights when they had no decay
Sean Paul Taylor 13 лет назад
Родитель
Сommit
582d4392f2
1 измененных файлов с 10 добавлено и 3 удалено
  1. 10 3
      gameplay-encoder/src/FBXSceneEncoder.cpp

+ 10 - 3
gameplay-encoder/src/FBXSceneEncoder.cpp

@@ -767,9 +767,16 @@ void FBXSceneEncoder::loadLight(FbxNode* fbxNode, Node* node)
         switch (decayType)
         {
         case FbxLight::eNone:
-            // No decay. Can assume we have an ambient light, because ambient lights in the scene are 
-            // converted to point lights with no decay when exporting to FBX.
-            light->setAmbientLight();
+            // FBX does not support ambients lights so ambient lights are converted 
+            // to point lights with no decay and visibility set to false.
+            if (fbxNode->GetVisibility())
+            {
+                light->setPointLight();
+            }
+            else
+            {
+                light->setAmbientLight();
+            }
             break;
         case FbxLight::eLinear:
             light->setPointLight();