Browse Source

Do not draw a shadow for an object if its draw distance is exceeded.

Lasse Öörni 13 years ago
parent
commit
401d5348d8
1 changed files with 4 additions and 0 deletions
  1. 4 0
      Engine/Graphics/View.cpp

+ 4 - 0
Engine/Graphics/View.cpp

@@ -1885,6 +1885,10 @@ void View::ProcessShadowCasters(LightQueryResult& query, const PODVector<Drawabl
         
         // Check shadow distance
         float maxShadowDistance = drawable->GetShadowDistance();
+        float drawDistance = drawable->GetDrawDistance();
+        if (drawDistance > 0.0f && (maxShadowDistance <= 0.0f || drawDistance < maxShadowDistance))
+            maxShadowDistance = drawDistance;
+        
         if (maxShadowDistance > 0.0f && drawable->GetDistance() > maxShadowDistance)
             continue;