Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.
C++ 3d3d-sculptingcppdear-imguidigital-sculptingfbxgame-developmentgaussian-splattinggltfimage-to-3dmcpopenglopenusdsculptingtext-to-3dunreal-engine
Grid bake test: 64 px maps (the minimum); paint check allows the border gutter
islandmed1b12228151fb
diff --git a/tests/test_mesh_maps.cpp b/tests/test_mesh_maps.cppindex 36dac57b..61a6efb6 100644--- a/tests/test_mesh_maps.cpp+++ b/tests/test_mesh_maps.cpp@@ -231,7 +231,8 @@ TEST(nightly_mesh_maps_live_update_is_faster_than_a_full_bake) {TEST(bake_udim_grid_ten_by_two) {// #135: twenty squares packed into a 10 x 2 UDIM grid bake as tiles 1001-1020 (the second row too), each- // tile's own island; texture painting skips the tiles past 1001 rather than wrapping them in.+ // tile's own island; texture painting skips the tiles past 1001 rather than wrapping them in (only the gutter+ // of an island touching 1001's border reaches its edge texels).Mesh low;for (int i = 0; i < 20; ++i) {const uint32_t b = uint32_t(low.positions.size());@@ -257,22 +258,23 @@ TEST(bake_udim_grid_ten_by_two) {for (glm::vec3& p : high.positions) p.y = 0.01f * std::sin(p.x * 9.0f);high.recomputeAllNormals();BakeSettings st;- st.size = 32;+ st.size = 64;st.maps = bakeBit(BakeMap::Normal);std::vector<BakeResult> results;CHECK(bakeMapsUdim(low, {&high}, st, results, err));CHECK(results.size() == 20);for (size_t k = 0; k < results.size(); ++k) {CHECK(results[k].udim == want[k]);- CHECK(results[k].islandTexels > 300); // (one square nearly fills its 32 x 32 tile)+ CHECK(results[k].islandTexels > 2000); // (one square nearly fills its 64 x 64 tile)}- // Paint: only tile 1001's triangles reach the texture.+ // Paint: tile 1001's triangles reach the texture; none from a tile two columns or more away, nor from row 2.int tx0, ty0, tx1, ty1, reach = 0;- for (uint32_t t = 0; t < low.triangleCount(); ++t)- if (triangleTiles(low, 256, 256, t, tx0, ty0, tx1, ty1)) {- ++reach;- CHECK(udimTile((low.uvs[t * 3] + low.uvs[t * 3 + 1] + low.uvs[t * 3 + 2]) / 3.0f) == 1001);- }+ for (uint32_t t = 0; t < low.triangleCount(); ++t) {+ const int tile = udimTile((low.uvs[t * 3] + low.uvs[t * 3 + 1] + low.uvs[t * 3 + 2]) / 3.0f);+ const bool reaches = triangleTiles(low, 256, 256, t, tx0, ty0, tx1, ty1);+ if (tile == 1001) reach += reaches;+ else if ((tile - 1001) % 10 >= 2) CHECK(!reaches);+ }CHECK(reach == 2);}