فهرست منبع

Move PBR to use lightsources

David Catuhe 8 سال پیش
والد
کامیت
6778621518
3فایلهای تغییر یافته به همراه5287 افزوده شده و 5297 حذف شده
  1. 2643 2643
      dist/preview release/babylon.d.ts
  2. 2643 2643
      dist/preview release/babylon.module.d.ts
  3. 1 11
      src/Materials/babylon.pbrMaterial.ts

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 2643 - 2643
dist/preview release/babylon.d.ts


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 2643 - 2643
dist/preview release/babylon.module.d.ts


+ 1 - 11
src/Materials/babylon.pbrMaterial.ts

@@ -601,17 +601,7 @@
         public static BindLights(scene: Scene, mesh: AbstractMesh, effect: Effect, defines: MaterialDefines, useScalarInLinearSpace: boolean, maxSimultaneousLights: number, usePhysicalLightFalloff: boolean) {
             var lightIndex = 0;
             var depthValuesAlreadySet = false;
-            for (var index = 0; index < scene.lights.length; index++) {
-                var light = scene.lights[index];
-
-                if (!light.isEnabled()) {
-                    continue;
-                }
-
-                if (!light.canAffectMesh(mesh)) {
-                    continue;
-                }
-
+            for (var light of mesh._lightSources) {
                 MaterialHelper.BindLightProperties(light, effect, lightIndex);
 
                 // GAMMA CORRECTION.