فهرست منبع

Fixed a bug in the encoder where point lights were converted to ambient lights when they had no decay

Darryl Gough 13 سال پیش
والد
کامیت
4095311da5
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();