Fix regression on Large Worlds build and bunch of warnings

This commit is contained in:
2026-03-30 23:50:03 +02:00
parent 7b695bf6bf
commit 8b383d4dbe
7 changed files with 8 additions and 6 deletions
+2
View File
@@ -69,10 +69,12 @@ API_STRUCT(InBuild) struct FLAXENGINE_API VariantType
MAX, MAX,
#if USE_LARGE_WORLDS #if USE_LARGE_WORLDS
Real = Double,
Vector2 = Double2, Vector2 = Double2,
Vector3 = Double3, Vector3 = Double3,
Vector4 = Double4, Vector4 = Double4,
#else #else
Real = Float,
Vector2 = Float2, Vector2 = Float2,
Vector3 = Float3, Vector3 = Float3,
Vector4 = Float4, Vector4 = Float4,
+1 -1
View File
@@ -198,7 +198,7 @@ void Foliage::DrawCluster(DrawContext& context, FoliageCluster* cluster, DrawCal
sphere.Center -= context.ViewOrigin; sphere.Center -= context.ViewOrigin;
if (Float3::Distance(context.LodView.Position, sphere.Center) - (float)sphere.Radius < instance.CullDistance && if (Float3::Distance(context.LodView.Position, sphere.Center) - (float)sphere.Radius < instance.CullDistance &&
context.RenderContext.View.CullingFrustum.Intersects(sphere) && context.RenderContext.View.CullingFrustum.Intersects(sphere) &&
RenderTools::ComputeBoundsScreenRadiusSquared(sphere.Center, sphere.Radius, context.RenderContext.View) * context.ViewScreenSizeSq >= context.MinObjectPixelSizeSq) RenderTools::ComputeBoundsScreenRadiusSquared(sphere.Center, (float)sphere.Radius, context.RenderContext.View) * context.ViewScreenSizeSq >= context.MinObjectPixelSizeSq)
{ {
const auto modelFrame = instance.DrawState.PrevFrame + 1; const auto modelFrame = instance.DrawState.PrevFrame + 1;
+1 -1
View File
@@ -507,7 +507,7 @@ namespace
return; return;
Spline::Keyframe* prev = spline->Curve.GetKeyframes().Get(); Spline::Keyframe* prev = spline->Curve.GetKeyframes().Get();
Vector3 prevPos = transform.LocalToWorld(prev->Value.Translation); Vector3 prevPos = transform.LocalToWorld(prev->Value.Translation);
float distance = Vector3::Distance(prevPos, DebugDraw::GetViewPos()); Real distance = Vector3::Distance(prevPos, DebugDraw::GetViewPos());
if (distance < METERS_TO_UNITS(800)) // 800m if (distance < METERS_TO_UNITS(800)) // 800m
{ {
// Bezier curve // Bezier curve
+1 -1
View File
@@ -425,7 +425,7 @@ void GBufferPass::DrawSky(RenderContext& renderContext, GPUContext* context)
BoundingSphere frustumBounds; BoundingSphere frustumBounds;
renderContext.View.CullingFrustum.GetSphere(frustumBounds); renderContext.View.CullingFrustum.GetSphere(frustumBounds);
origin = frustumBounds.Center; origin = frustumBounds.Center;
size = frustumBounds.Radius; size = (float)frustumBounds.Radius;
} }
Matrix::Scaling(size / ((float)box.GetSize().Y * 0.5f) * 0.95f, m1); // Scale to fit whole view frustum Matrix::Scaling(size / ((float)box.GetSize().Y * 0.5f) * 0.95f, m1); // Scale to fit whole view frustum
Matrix::CreateWorld(origin, Float3::Up, Float3::Backward, m2); // Rotate sphere model Matrix::CreateWorld(origin, Float3::Up, Float3::Backward, m2); // Rotate sphere model
+1 -1
View File
@@ -704,7 +704,7 @@ void RenderList::AddDrawCall(const RenderContextBatch& renderContextBatch, DrawP
if (drawModes != DrawPass::None && if (drawModes != DrawPass::None &&
(staticFlags & renderContext.View.StaticFlagsMask) == renderContext.View.StaticFlagsCompare && (staticFlags & renderContext.View.StaticFlagsMask) == renderContext.View.StaticFlagsCompare &&
renderContext.View.CullingFrustum.Intersects(bounds) && renderContext.View.CullingFrustum.Intersects(bounds) &&
RenderTools::ComputeBoundsScreenRadiusSquared(bounds.Center, bounds.Radius, renderContext.View) * (renderContext.View.ScreenSize.X * renderContext.View.ScreenSize.Y) >= minObjectPixelSizeSq) RenderTools::ComputeBoundsScreenRadiusSquared(bounds.Center, (float)bounds.Radius, renderContext.View) * (renderContext.View.ScreenSize.X * renderContext.View.ScreenSize.Y) >= minObjectPixelSizeSq)
{ {
renderContext.List->ShadowDepthDrawCallsList.Indices.Add(index); renderContext.List->ShadowDepthDrawCallsList.Indices.Add(index);
} }
+1 -1
View File
@@ -443,7 +443,7 @@ bool ModelTool::GenerateModelSDF(Model* inputModel, const ModelData* modelData,
minDistance *= -1; // Voxel is inside the geometry so turn it into negative distance to the surface minDistance *= -1; // Voxel is inside the geometry so turn it into negative distance to the surface
const int32 xAddress = x + yAddress; const int32 xAddress = x + yAddress;
formatWrite(voxels.Get() + xAddress * formatStride, minDistance * encodeMAD.X + encodeMAD.Y); formatWrite(voxels.Get() + xAddress * formatStride, (float)minDistance * encodeMAD.X + encodeMAD.Y);
} }
} }
}; };
@@ -230,7 +230,7 @@ namespace Flax.Build.Bindings
case "uint32": return "VariantType(VariantType::Uint)"; case "uint32": return "VariantType(VariantType::Uint)";
case "int64": return "VariantType(VariantType::Int64)"; case "int64": return "VariantType(VariantType::Int64)";
case "uint64": return "VariantType(VariantType::Uint64)"; case "uint64": return "VariantType(VariantType::Uint64)";
case "Real": case "Real": return "VariantType(VariantType::Real)";
case "float": return "VariantType(VariantType::Float)"; case "float": return "VariantType(VariantType::Float)";
case "double": return "VariantType(VariantType::Double)"; case "double": return "VariantType(VariantType::Double)";
case "StringAnsiView": case "StringAnsiView":