Generate lightmap UVs taking forever
So, I've finally found my problem when baking my light : my mesh had lightmap UVs all wrong.
I imported a model from Google Sketchup, a quite simple building, not very detailed either. I've tried baking the light and realized something was off : black marks over the textures here and there, really ugly stuff. After browsing hours between the whinning about Enlighten being not as good as Beast for baked lightmap, I finally found out that what I was missing was generating lightmap UVs.
I've tried doing that on a small sample project with a 20 poly SU model, evrything was fine. It took a little time to calculate the lightmap UVs and some more time to bake the light and that was it.
So I tried doing just that for my model, but the thing is that generating the lightmap UVs takes forever. It freezes Unity in the process too : I can't even open it, it's stuck loading.
I'm using : Google Sketch Up Make 2016 (free version), Unity 5.3.4f1 32 bit and I'm on Windows 7.
Bottom line is the following questions : Is this normal? Do I have to wait longer than one hour? Why are there no progress bar of what's happening? Did anyone also encounter this problem on this version of Unity? Is there a solution (possibly other than mapping the light UVs myself)?
How large is the mesh? Is all of the geometry included in one mesh? It might be worth breaking down your mesh into seperate meshes/fbxs. Unity will struggle to generate a lightmap uv for large meshes. Another option would be to lightmap the mesh yourself by creating a second uv channel.
What is the file size of the mesh? Attach it here if possible or at least provide a wireframe screenshot of it.
It's a single FBX file, but there are several meshes in it (3017 meshes), but some of these doesn't count more than 4 triangles (they are double sided semi transparent quad for windows). I don't know how can I get the triangle count for my model, but there might be a lot : Sketch Up exports tends to add a lot of triangles where they are not necessary...
(Added : picture of the wireframe, as I can't post the model here) EDIT : BTW, I left the default parameters in "Generate Lightmap UVs" -> "Advanced" EDIT2 : A friend of a friend whose job is to optimize models told me $$anonymous$$e is too complicated, I gotta rework it. Apparently, I shouldn't exceed 70$$anonymous$$ poly, and I'm currently around 500k
Do you need those parts to be separate? Can you merge them into a single mesh?
I thought it was better to have them separated, to use occlusion properly, but apparently I can optimize my model in many ways by merging a couple surfaces.
For example, as we can see in the wireframe (sorry, it didn't upload correctly by the time you answered !), I have 2 triangles for each and every single window, but I could actually use one bigger glass covering each whole external wall, merging something like 100 triangles into 2.
Why do you ask if I can merge my meshes into a single one though? I need to have different materials on these mesh, and I thought it was a bad thing to have a single mesh use different materials.
Answer by GuardFromUA · Jul 04, 2017 at 07:51 AM
Faced this problem too... I can't see even the progress bar, but can view new UnwrapCL process in the windows inspector. I was waiting for a loooong time and nothing happened. Did you find the solution?
Sorry, I haven't used Unity in a while now, I can't remember well.
For this problem, I think it was slow because 1 - $$anonymous$$y model was complex 2 - $$anonymous$$y PC wasn't good enough 3 - (and that might be what you are looking for) : my baking parameters were too high.
The main thing to change in the baking settings is the "baked resolution", wich defaults to 40.
Whenever you are testing, you should set it to 2~4 (and even then, it's a bit slow). The result is absolutely UGLY, but you get an idea of wich piece is properly lit and wich isn't.
Only during your final baking will you set it at 40~80, and you might want to let your computer deal with that during your sleep or something. Definitely not something you'll wait behind your computer (and you won't be able to run anything requiring your GPU).
I hope this helps.
Your answer
Follow this Question
Related Questions
problem with lightmap in prefabs 0 Answers
Unity3d 5.3 Baked GI error? 1 Answer
2000+ objects without unwrapping. Bake lightmaps? 0 Answers
Point/spot lights dont bake 0 Answers
Reflection probes makes some objects look darker than others (URP) 1 Answer