فهرست منبع

Surface materials weren't checking regions correctly. (#8490)

This was causing the materials to intermittently not show up. The region comparisons needed to use a 2D AABB check instead of a 3D one with height set to 0, because the camera height could cause the checks to fail.

Signed-off-by: Mike Balfour <[email protected]>
Mike Balfour 3 سال پیش
والد
کامیت
cfca9d6d95
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.cpp

+ 2 - 1
Gems/Terrain/Code/Source/TerrainRenderer/TerrainDetailMaterialManager.cpp

@@ -18,6 +18,7 @@
 #include <Atom/Utils/MaterialUtils.h>
 
 #include <SurfaceData/SurfaceDataSystemRequestBus.h>
+#include <SurfaceData/Utility/SurfaceDataUtility.h>
 
 namespace Terrain
 {
@@ -999,7 +1000,7 @@ namespace Terrain
     {
         for (const auto& materialRegion : m_detailMaterialRegions.GetDataVector())
         {
-            if (materialRegion.m_region.Contains(AZ::Vector3(position.GetX(), position.GetY(), 0.0f)))
+            if (SurfaceData::AabbContains2D(materialRegion.m_region, position))
             {
                 return &materialRegion;
             }