فهرست منبع

Better check for whether vertex lights have been processed.

Lasse Öörni 14 سال پیش
والد
کامیت
6b94f902c7
1فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 5 1
      Engine/Graphics/View.cpp

+ 5 - 1
Engine/Graphics/View.cpp

@@ -687,6 +687,7 @@ void View::GetBatches()
         {
             Drawable* drawable = *i;
             unsigned numBatches = drawable->GetNumBatches();
+            bool vertexLightsProcessed = false;
             
             for (unsigned j = 0; j < numBatches; ++j)
             {
@@ -743,8 +744,11 @@ void View::GetBatches()
                         // due to overflowing the pixel light count. These need to be skipped as the per-pixel accumulation
                         // already renders the light
                         /// \todo Sub-geometries might need different interpretation if opaque & alpha are mixed
-                        if (!j)
+                        if (!vertexLightsProcessed)
+                        {
                             drawable->LimitVertexLights(prepass && pass->GetBlendMode() == BLEND_REPLACE);
+                            vertexLightsProcessed = true;
+                        }
                         
                         // The vertex light vector possibly became empty, so re-check
                         if (!vertexLights.Empty())