I have created an editor window that communicates with an API to import mesh geometry (verticies, UVs, triangles, normals). I am trying to generate lightmap UVs on these objects using the following code:
When I export the object to an FBX and then re-import, the values are much more accurate. I’ve tried editing my script to just use the default values but that doesn’t seem to help either. Any ideas as to what I’m doing wrong?
I suggest you create your own UVs, although this isn’t what you’re asking.
I think your pack margin value is too high, although I’m not sure it warrants such a big difference. Try halving it, if there is a big difference, that’s probably the issue.
Thank you for your reply. I may look into creating my own UVs, are you familiar with any guides as to how I would go about this?
I commented out my line where I’m setting the pack margin so that it uses the default and it appears to work great. I noticed while debugging that the default value for pack margin is 0.00390625 ( = 4 / 1024) so really I think the documentation is incorrect: Unity - Manual: Generating lightmap UVs