Refactor: Use explicit loop for filtering and mapping foliage render LODs

This commit is contained in:
2026-05-02 10:50:40 +02:00
parent 2c09c4c3e1
commit a53de8a33d

View File

@@ -85,15 +85,22 @@ function cloneChunkBounds(
export function getFoliagePrototypeRenderLods(
prototype: FoliagePrototype
): FoliageRenderLod[] {
return prototype.lods
.filter((lod) => lod.source === "bundled")
.map((lod) => ({
const renderLods: FoliageRenderLod[] = [];
for (const lod of prototype.lods) {
if (lod.source !== "bundled") {
continue;
}
renderLods.push({
level: lod.level,
bundledPath: lod.bundledPath,
maxDistance: lod.maxDistance,
castShadow: lod.castShadow
}))
.sort((left, right) => left.level - right.level);
});
}
return renderLods.sort((left, right) => left.level - right.level);
}
export function resolveFoliageRenderLod(options: {