Prechádzať zdrojové kódy

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 1 mesiac pred
rodič
commit
8621d52430
1 zmenil súbory, kde vykonal 1 pridanie a 1 odobranie
  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);
         CopyValue(l.color, ail->mColorSpecular);
 
 
         ail->mAngleOuterCone = l.falloffAngle;
         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->mAttenuationConstant = l.constantAttenuation;
         ail->mAttenuationLinear = l.linearAttenuation;
         ail->mAttenuationLinear = l.linearAttenuation;