I've created a very simple model in blender, exported it as FBX and imported in Unity. When I generate light maps on unity I got these strange artifacts (check the images attached here). I've verified the normals and they seems to be correct, the model has been exported with rotation and scale set to 0... any idea where those artifacts are coming from?
-
\$\begingroup\$ Have you tried adjusting the shadow bias and shadow normal bias on the light source? \$\endgroup\$– tyjkennAug 11, 2017 at 19:33
-
\$\begingroup\$ Looks like z-fighting to me. Check that you don't have any overlapping faces. \$\endgroup\$– samblerAug 12, 2017 at 5:57
-
\$\begingroup\$ @sambler i double checked and there are not overlapping faces. \$\endgroup\$– MatterGoalAug 12, 2017 at 9:07
-
\$\begingroup\$ @tyjkenn nope, I'll try today! it souds strange to me that bias and ls could produce these result. \$\endgroup\$– MatterGoalAug 12, 2017 at 9:08
-
\$\begingroup\$ @MatterGoal, I didn't think it would, but a low bias can create a different kind of artifact when a surface casts a shadow on itself. That kind of artifact looks a little different, so I wasn't confident enough to post it as an actual solution. It's good to hear you got it working, though! \$\endgroup\$– tyjkennAug 14, 2017 at 6:17
1 Answer
Hello I was able to fix this issue. Actually the problem was related to the UVs. For this model I had some overlapping UVS and since I haven't selected the option to generate UV lightmap from Unity the final lightmaps were a mess.
You have three options to fix this issue:
1) Avoid overlapping UVs
2) Create a new UV channel from your 3d editor annd be sure that those UVs don't overlap. unity will automatically pick the second channel for the lightmap and uses the first channel for texture etc.. (I'm not sure about that but this is what I'm reading... I can't find it in the documentation though, please confirm that in case!)
3) With the model selected in unity go to the inspector and select "Generate lightmap UVs" unity will generate a new uv set for lightmap for you (this solution for me doesn't work really well... I choosed option 1.