1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-02 16:48:55 +00:00

Merge pull request #94236 from BlueCube3310/lightmap-pad-loop-fix

Lightmapper: Ensure the atlas is big enough to fit padded UV maps
This commit is contained in:
Rémi Verschelde
2024-07-17 11:43:28 +02:00

View File

@@ -233,7 +233,7 @@ Lightmapper::BakeError LightmapperRD::_blit_meshes_into_atlas(int p_max_texture_
MeshInstance &mi = mesh_instances.write[m_i]; MeshInstance &mi = mesh_instances.write[m_i];
Size2i s = Size2i(mi.data.albedo_on_uv2->get_width(), mi.data.albedo_on_uv2->get_height()); Size2i s = Size2i(mi.data.albedo_on_uv2->get_width(), mi.data.albedo_on_uv2->get_height());
sizes.push_back(s); sizes.push_back(s);
atlas_size = atlas_size.max(s + Size2i(2, 2)); atlas_size = atlas_size.max(s + Size2i(2, 2).maxi(p_denoiser_range));
} }
int max = nearest_power_of_2_templated(atlas_size.width); int max = nearest_power_of_2_templated(atlas_size.width);