diff --git a/Source/Engine/Content/Assets/Model.cpp b/Source/Engine/Content/Assets/Model.cpp index b237f8a0e..34f27a27e 100644 --- a/Source/Engine/Content/Assets/Model.cpp +++ b/Source/Engine/Content/Assets/Model.cpp @@ -569,6 +569,12 @@ bool Model::GenerateSDF(float resolutionScale, int32 lodIndex) { if (!HasAnyLODInitialized()) return true; + if (IsInMainThread() && IsVirtual()) + { + // TODO: could be supported if algorithm could run on a GPU and called during rendering + LOG(Warning, "Cannot generate SDF for virtual models on a main thread."); + return true; + } PROFILE_CPU(); auto startTime = Platform::GetTimeSeconds(); ScopeLock lock(Locker); @@ -709,6 +715,7 @@ bool Model::GenerateSDF(float resolutionScale, int32 lodIndex) for (int32 x = 0; x < resolutionMip.X; x++) { // Linear box filter around the voxel + // TODO: use min distance for nearby texels (texel distance + distance to texel) float distance = 0; for (int32 dz = 0; dz < 2; dz++) {