瀏覽代碼

Updated Inner Cone formula for Spot Lights in GLTF (#6078)

Updated the Inner Cone formula such that exponent values of 0 result in no inner cone and large exponent values result in a inner cone being most of the cone angle-wise.

Co-authored-by: Kim Kulling <[email protected]>
Jackson Levitt 3 月之前
父節點
當前提交
8621d52430
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      code/AssetLib/glTF/glTFImporter.cpp

+ 1 - 1
code/AssetLib/glTF/glTFImporter.cpp

@@ -515,7 +515,7 @@ void glTFImporter::ImportLights(Asset &r) {
         CopyValue(l.color, ail->mColorSpecular);
 
         ail->mAngleOuterCone = l.falloffAngle;
-        ail->mAngleInnerCone = l.falloffExponent; // TODO fix this, it does not look right at all
+        ail->mAngleInnerCone = l.falloffAngle * (1.0f - 1.0f / (1.0f + l.falloffExponent)); 
 
         ail->mAttenuationConstant = l.constantAttenuation;
         ail->mAttenuationLinear = l.linearAttenuation;