diff options
author | jfons <joan.fonssanchez@gmail.com> | 2022-02-24 13:00:51 +0100 |
---|---|---|
committer | jfons <joan.fonssanchez@gmail.com> | 2022-02-24 13:00:51 +0100 |
commit | d0fd5fd3c787210fa584e4a933280bd82daaec02 (patch) | |
tree | 8fa6f7c162fca85f46ab5ed73cf2927f14591387 /modules | |
parent | 6c40d1ab9be9fcfc80ba1a35d3d8664070c697f8 (diff) |
Add sanity checks to lightmap unwrap texel size
Diffstat (limited to 'modules')
-rw-r--r-- | modules/xatlas_unwrap/register_types.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/xatlas_unwrap/register_types.cpp b/modules/xatlas_unwrap/register_types.cpp index 6f397fe285..139df9c735 100644 --- a/modules/xatlas_unwrap/register_types.cpp +++ b/modules/xatlas_unwrap/register_types.cpp @@ -120,6 +120,8 @@ bool xatlas_mesh_lightmap_unwrap_callback(float p_texel_size, const float *p_ver xatlas::ChartOptions chart_options; chart_options.fixWinding = true; + ERR_FAIL_COND_V_MSG(p_texel_size <= 0.0f, false, "Texel size must be greater than 0."); + xatlas::PackOptions pack_options; pack_options.padding = 1; pack_options.maxChartSize = 4094; // Lightmap atlassing needs 2 for padding between meshes, so 4096-2 |