- Home /
How to calculate surface area of a Mesh for Lightmapping
I am an artist and was wondering if there was a way to query the surface area of a Mesh and have it display inside the lightmapping tools? The reason I was wanting to do this was so I could optimize my light map usage. This way I can calculate before bake how much space an object would take Tiling X,Y for a given Size 512-4k BEFORE baking the object.
I know the numbers exist Unity uses them in determining the Max Object size in lightmap per the atlas. But it would be great to know the math beforehand.
Case in point, if I had global scale set to 1 and I wanted to know the tiling order of individual objects as I adjust the "Scale in Lightmap" attribute on a per object basis. Then I am just missing the surface area figure for the object in order to finalize my calculations. This is under the assumption that I am only calculating 1 single map and that the global scale does not change.
I get the feeling Unity retains this information already however it is not displayed. =/