浏览代码

Prevent division by zero.

Lasse Öörni 12 年之前
父节点
当前提交
4d6b9c2061
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Source/Engine/Graphics/Batch.cpp

+ 1 - 1
Source/Engine/Graphics/Batch.cpp

@@ -348,7 +348,7 @@ void Batch::Prepare(View* view, bool setModelTransform) const
         {
             Vector3 worldFogHeightVec = zoneNode->GetWorldTransform() * Vector3(0.0f, zone_->GetFogHeight(), 0.0f);
             fogParams.z_ = worldFogHeightVec.y_;
-            fogParams.w_ = zone_->GetFogHeightScale() / zoneNode->GetWorldScale().y_;
+            fogParams.w_ = zone_->GetFogHeightScale() / Max(zoneNode->GetWorldScale().y_, M_EPSILON);
         }
         
         graphics->SetShaderParameter(PSP_FOGPARAMS, fogParams);