Skip to content

Commit

Permalink
Lightmapper: Ensure the atlas is big enough to fit padded UV maps
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueCube3310 committed Jul 11, 2024
1 parent 26d1577 commit 14877d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/lightmapper_rd/lightmapper_rd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ Lightmapper::BakeError LightmapperRD::_blit_meshes_into_atlas(int p_max_texture_
MeshInstance &mi = mesh_instances.write[m_i];
Size2i s = Size2i(mi.data.albedo_on_uv2->get_width(), mi.data.albedo_on_uv2->get_height());
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);
Expand Down

0 comments on commit 14877d1

Please sign in to comment.