Why are meshes with no UVs excluded from baking?

Maybe this has been the case before Unity 6 and I just noticed, but why are meshes with no UVs excluded from baking?

I have some meshes that are a single color and lit by lightprobes, therefore I don’t have UVs for them since they are not needed, but I would still like them to cast baked shadows, but that doesn’t seem to be possible.

I also have some black meshes that are only intended to block light and have lightmapping scale set to 0.

Not sure why they need UVs when I don’t intend for them to use any lightmap space.

I am adding empty UV channels now and that seems to work, which proves that UVs are not actually needed, I just need to do extra work because Unity has added arbitrary limitations on what kinds of meshes can partake in the baking process.

Is “Generate Lightmap UVs” checked for these meshes? This should add the UV2 channel, even if there is no UV1. This seems to be working for me in this case.

It’s a single file that contains some meshes that have UVs and others that don’t, therefore checking Generate Lightmaps UVs would destroy the UVs I’ve already made since it’s a file-wide process.

And regardless, I’d rather not have extra data on the mesh that take up ram at runtime just because the lightmapper decided it arbitrarily needs them (when it doesn’t).

I’m not sure if the use case has been considered. The meaning we associate with “Contribute GI” is “contribute emission, bounce albedo and occlusion to GI calculations”. With the way the lightmapper is implemented, we need UVs in order to calculate emission and bounced albedo. You are correct that if you only want a renderer to contribute occlusion and nothing else, you don’t need UVs.

I’m reluctant to enable this behavior without it being an explicit opt-in, like a “baked shadows only” mode, since users might neglect to provide UVs for a renderer they intend to contribute emission and albedo, then be surprised when it silently fails by only contributing occlusion. Do you concur?

Either way, I’ll ask my team what they think about this.

Why would it be silent? It could have the exact same warning, but instead of it saying that the mesh is excluded from baking it would say something along the lines of “mesh has no UVs, therefore it cannot contribute albedo and emission to the scene” and then it would contribute occlusion.

Assuming both situations have a warning to inform the user, from my perspective, it is more surprising to have a mesh marked as “contribute GI” contribute nothing at all, than it contributing something.

Or at the very least, I think the two situations:

  1. “Contribute GI” Mesh does nothing at all, there is a warning explaining why
  2. “Contribute GI” Mesh does occlusion only, there is a warning explaining why

are roughly equivalent in how clear / confusing they are, but the 2nd option is less limiting.

The only potential downside of 2 is that the fails might be somewhat more subtle: If the user intends for a mesh to contribute albedo, it would be more obvious that something went wrong when it contributes nothing in the scene than it contributing occlusion only (which will look more plausible), but again, that’s what the warning would be for.