瀏覽代碼

Fix Spot Light

Sebastien Vandenberghe 8 年之前
父節點
當前提交
62317d400f

文件差異過大導致無法顯示
+ 2995 - 2995
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


文件差異過大導致無法顯示
+ 3 - 3
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


文件差異過大導致無法顯示
+ 2 - 2
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js


文件差異過大導致無法顯示
+ 2995 - 2995
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.module.d.ts


+ 1 - 2
src/Shaders/ShadersInclude/pbrLightFunctions.fx

@@ -18,12 +18,11 @@ float computeDistanceLightFalloff(vec3 lightOffset, float lightDistanceSquared,
     return lightDistanceFalloff;
 }
 
-float computeDirectionalLightFalloff(vec3 lightDirection, vec3 directionToLightCenterW, float lightAngle, float exponent)
+float computeDirectionalLightFalloff(vec3 lightDirection, vec3 directionToLightCenterW, float cosHalfAngle, float exponent)
 {
     float falloff = 0.0;
     
     #ifdef USEPHYSICALLIGHTFALLOFF
-        float cosHalfAngle = cos(lightAngle * 0.5);
         const float kMinusLog2ConeAngleIntensityRatio = 6.64385618977; // -log2(0.01)
 
         // Calculate a Spherical Gaussian (von Mises-Fisher distribution, not angle-based Gaussian) such that the peak is in the light direction,