I’m trying to create an editor script to set the ‘scale in lightmap’ value to its maximum for any selected game object with a mesh renderer on it. So as a result each object that I do this to, will get a full light map allocated only for that particular object. I have noticed in the editor that, if we increase the scale above the max possible scale, it shows a warning that says ‘Object’s size in lightmap has reached the max atlas size’. Is there a way to see how they are actually calculating that limit in the mesh renderer component?? . I have tried pretty much everything else I can think of. If anyone is interested I can post my half done solution.
Number of texels for (the area of) a cube (length of side: 1 unit): Scale X * Scale Y * 2 + Scale X * Scale Z * 2 + Scale Y * Scale Z * 2 * Lightmap Resolution = ((1600 * 1300 * 2) + (1600 * 1000 * 2) + (1300 * 1000 * 2)) * 1
Number of texels for (the area of) a cube < Number of texels in a single lightmap
The “Scale In Lightmap” parameter allows to respect that constraint and it seems to be squared, so that the constraints becomes:
Number of texels for (the area of) a cube * (Scale In Lightmap*Scale In Lightmap) < Number of texels in a single lightmap