Add SortOrder to Environment Probe

This commit is contained in:
Wojtek Figat
2025-06-24 19:25:18 +02:00
parent 8d62a13cbc
commit dbd8297612
4 changed files with 19 additions and 4 deletions

View File

@@ -335,12 +335,17 @@ void ReflectionsPass::Dispose()
bool SortProbes(RenderEnvironmentProbeData const& p1, RenderEnvironmentProbeData const& p2)
{
// Compare by radius
int32 res = static_cast<int32>(p2.Radius - p1.Radius);
// Compare by Sort Order
int32 res = p1.SortOrder - p2.SortOrder;
if (res == 0)
{
// Compare by ID to prevent flickering
res = p2.HashID - p1.HashID;
// Compare by radius
res = static_cast<int32>(p2.Radius - p1.Radius);
if (res == 0)
{
// Compare by ID to prevent flickering
res = p2.HashID - p1.HashID;
}
}
return res < 0;
}