**Add Box Projection to Environment Probe** for better indoor areas

This commit is contained in:
Wojtek Figat
2026-01-14 09:49:01 +01:00
parent b7e32e13ab
commit 18778aa511
15 changed files with 176 additions and 78 deletions

View File

@@ -11,6 +11,7 @@
#include "Engine/Content/Assets/SkinnedModel.h"
#include "Engine/Core/Log.h"
#include "Engine/Core/Math/Packed.h"
#include "Engine/Core/Math/OrientedBoundingBox.h"
#include "Engine/Engine/Time.h"
const Char* ToString(RendererType value)
@@ -620,6 +621,15 @@ void RenderTools::ComputeSphereModelDrawMatrix(const RenderView& view, const Flo
resultIsViewInside = Float3::DistanceSquared(view.Position, position) < Math::Square(radius * 1.1f); // Manually tweaked bias
}
void RenderTools::ComputeBoxModelDrawMatrix(const RenderView& view, const OrientedBoundingBox& box, Matrix& resultWorld, bool& resultIsViewInside)
{
// Construct world matrix
Matrix::Transformation(box.Transformation.Scale * box.Extents * 2.0f, box.Transformation.Orientation, box.Transformation.Translation, resultWorld);
// Check if view is inside the sphere
resultIsViewInside = box.Contains(view.Position) == ContainmentType::Contains;
}
Float3 RenderTools::GetColorQuantizationError(PixelFormat format)
{
Float3 mantissaBits;