TheGameCreators / GameGuruRepo

The GameGuru Repository For Community Collaboration
http://www.game-guru.com
137 stars 56 forks source link

Lightmapping some models produces artefacts #214

Open LeeBamberTGC opened 6 years ago

LeeBamberTGC commented 6 years ago

I have attached some of the models causing problems, townwall09 is the original and townwall09t is one I was experimenting with to eliminate the loop cuts, it sort of worked but when turned off its normal plane the problems start again, townwall01 is one of the 4 keeps which all have the same problems where they are fine in one plane only. townwalltest.zip

ghost commented 6 years ago

OK, tried these out and am seeing the same thing with F3 lightmapping. https://puu.sh/Ac4Aq/b14175c5ac.jpg https://puu.sh/Ac4DJ/396bec94b5.jpg https://puu.sh/Ac4ES/6372b8267e.jpg https://puu.sh/Ac4Fy/560a95f9ff.jpg

I remade the wall in 3ds max and here are my results: https://puu.sh/Ac7r0/7dcfe74700.jpg https://puu.sh/Ac7C0/03aea60a29.jpg Most directions seem fine, except for the left one. This may be do to a mirrored UV island. I will flip these uv islands and see if it evens out.

Townwall09tMyke.zip

Granada1 commented 6 years ago

https://forum.unity.com/threads/ending-the-confusion-about-mirrored-normal-mapping.409698/

This might be interesting to youbalso

ghost commented 6 years ago

OK, Flipped the UV on the wall, but no difference. After light mapping the sunside on this one on the left is still shadowed or dark all around.

https://puu.sh/AcE0E/4011c85a2d.jpg

Here is the new file for testing. Townwall09tMykeFix.zip

ghost commented 6 years ago

Reloaded the map file with the Lightmapping and get this image. The ones on the right are DNSI, The ones on the left are PBR. https://puu.sh/AcExH/9aa34617bf.jpg

townwalltestCompare_PBRFiles.zip

LeeBamberTGC commented 6 years ago

I have also recently pitched into this issue, with my first stab taking the X file into Unwrap3D Pro, welding all faces together and auto generating new smoothing groups (normals) to get nice flat walls. My theory was that two polygons shared the same space and the weld would combine and eliminate them. The current lightmapper would treat a second polygon exactly overlapping another as a blocker. It would either block or not block based on which side the 'maths' determined it to be on, which explains why you get Z-clash like stripes. I am inclined to put this down to model geometry issues, but happy to keep the issue open so we can resolve it for the artist and add to our knowledge of what not to give to the lightmapper.

LeeBamberTGC commented 5 years ago

Changing this to a FEATURE request which can 'auto clean' geometry being imported so that this artefact is removed during the lightmapping process, though may be impossible to catch all cases as its very much a case of providing good geometry to lightmap.