Hi!
I’ve created a voxel object, applied greedy meshing to it, exported it as FBX with the FBX Exporter package and then applied Unity’s default Normal and Lightmap UV generation settings to it. When I generate lightmaps, I can see visible color differences between adjacent faces that’re looking in the same direction.
My voxel object has a (1,1,1) Scale and the scene’s lightmapping parameters are as follows:
I couldn’t find any topics about lightmapping used with voxel meshes, so I couldn’t find useful information about what I might be doing wrong with my mesh. Your help would be appreciated!
This might be a difficult issue to solve. Your best bet is the brute force method: disable filtering and bake using high sample counts. That should eliminate seams between segments.
Thank you for the swift answer! I’ve set sample counts to Direct:512, Indirect:16384, Environment:256 and tried different Bounce Count, Filtering, Ambient Occlusion combinations (never increased the lightmap size). I got better results but IMO not very acceptable ones. I guess it isn’t possible to get decent lightmap results in my setup without either giving up the greedy meshing optimization or increasing the lightmap size. To my understanding, if adjacent faces don’t share vertices, then this issue occurs (though I don’t know why that is). So the most plausible approach would be to bake ambient occlusion to vertex data similar to Minecraft and not use lightmapping, I suppose?
(Please ignore the dark faces at the bottom)
You’d need to set filtering field to “None” in order to disable all filters. As mentioned earlier, you’d need a lot of samples.
In your voxel modeling tool, check whether it is possible to subdivide the mesh to prevent n-gons. I can see that there are many overlapping edges that will result in lightmap UVs that will be impossible to merge. This will make lightmap seams more visible.
Thanks again! The best result I got was this:
Lightmap Compression had a huge impact on the visual quality and the lightmap size. Your overlapping edge suggestion is probably the way to go here.