Merge pull request #54510 from pycbouh/lightmapper-respect-maximum-size-3.x

This commit is contained in:
Rémi Verschelde 2021-11-02 14:18:22 +01:00 committed by GitHub
commit 4b7d1aed66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -166,7 +166,7 @@ Error LightmapperCPU::_layout_atlas(int p_max_size, Vector2i *r_atlas_size, int
}
float mem_utilization = static_cast<float>(mem_occupied) / mem_used;
if (slices * atlas_size.y < 16384) { // Maximum Image size
if (slices * atlas_size.y <= 16384) { // Maximum Image size
if (mem_used < best_atlas_memory || (mem_used == best_atlas_memory && mem_utilization > best_atlas_mem_utilization)) {
best_atlas_size = atlas_size;
best_atlas_offsets = curr_atlas_offsets;