#Weird effect on walls
1 messages · Page 1 of 1 (latest)
what happens if you increase the lightmap quality, did you try clear the light maps and a rebake
yes It's my second time rebaking and the lightmap resolution is set to 20 which should be enough no?
but I'll try rebaking with higher resolution
are these walls even been baked makre sure to include them in your bake
you cna do that by marking your gameobjects as static
but i guess you know that
Oh yeaaa ofc, they’re all static, sorry I didn’t see your answers
How did yo make those walls ?
Could it be that the objects have a negative scale ?
Do they have lightmap UVs ?
What does it look like in the lightmap preview ?
You can also refer to this documentation page : https://docs.unity3d.com/6000.3/Documentation/Manual/troubleshooting-lightmapping-artifacts.html
I just used probuilder and added textures on them, they haven't got a negative scale and yes they have lightmap uvs
Confirm that you've generated lightmap UVs from ProBuilder, as meshes under its control must be modified from the tool itself
I’m not sure what you mean but there was a message popping up saying the light maps were incorrect or something like this after I changed the mesh sizes and I just clicked on the fix button and then rebaked, so I don’t think it’s an issue
Does that mean you no longer have the issue after rebaking or that you do?
I still do
But that means its probably not the probuilder light maps the issue I think
It didn't confirm if there actually are valid lightmaps UVs, or if you enabled their generation where it's meant to
well the message disappeared after I fixed them so I suppose this is confirming, but what should I do to confirm it and see whether they are valid lightmaps uvs or not?
Use the scene view debug modes to check for UV overlap, and check that the lightmap UV generation is enabled in the right place
You only mentioned changing size
So the warning is unlikely to be related
sorry, I had a personnal issue which made me unable to answer, thank you so much for helping me, the uvs are indeed incorrect, after restarting and rebaking one more time, I see that there are no lightmaps generated for the walls, but they're static, contribute gl which is weird
It's not weird
Contribute GI means the mesh contributes to global illumination during baking
To additionally receive GI to lightmaps, the mesh needs valid UVs for them in its mesh data
how to make valid uvs?
should I use an external tool such as blender?
If the mesh is handled by ProBuilder, generate them from within ProBuilder
Probably this: https://docs.unity3d.com/Packages/com.unity.probuilder@6.0/manual/Object_LightmapUVs.html
If the mesh exists outside of ProBuilder's control, it uses the lightmap UV generation defined in model import settings
https://docs.unity3d.com/6000.3/Documentation/Manual/FBXImporter-Model.html
thank youu so much, so I should just enable the "generate lightmap uvs in model import settings right?
...Only if your mesh isn't controlled by ProBuilder as it overrides those settings
oh okay, thank you for helping me.
I'll have to rebuild everything😭
Why?
because it will modify the prefab only right? and the actual prefabs in the scene won't be fixed?
isn't there a way to generate the lightmaps without replacing the prefabs?
I don't follow
Every mesh, whether in a prefab or not, gets its data from the original mesh asset
Either that's managed by model import settings, or by ProBuilder
yeee, sorry I'm kinda lost today, but I just enabled the generate lightmap uvs and it didn't fix anything
You can convert a probuilder mesh into a "real" imported model asset managed by import settings
Or an imported model into probuilder's own ephemereal format managed by the tool
Both work for lightmapping, you just need to know which one you're working with
actually, the probuilder meshes don't have the issue anymore but the imported meshes are the one problematic
and I don't really wanna convert them to probuilder meshes, that sounds like a lot of work for nothing
They are managed by model import settings so no need for that
Double check that you're changing the correct mesh's model import settings, that you apply, and that you rebake
Then verify with UV overlap scene window debug view
yes so I just need to enable the "generate lightmap uvs" and apply right? I just did this and it hasn't fixed anything
It's possible there's other lightmapping issues besides UVs, but you want to make sure they're correct
Not just, you do have to bake again
it's indeed the right mesh model and here's the UV overlaps
yes I did
The translucent walls which appear darker have not been lightmapped, possibly they've not been set to receive GI to lightmaps
You should take a screenshot of the same spot in contributors/receivers debug view
Red means UV overlap, and it can indicate missing lightmap UVs, but overlap can happen for other reasons too
Mainly that the mesh's "minimum lightmap resolution" in lightmap UV generation settings is larger than the resolution you're baking them with
ohhh ok , I didn't know this, and yee the minimum lightmap res in the model import settings is larger than the baked resolution, this causes them uvs to overlap and that's why they miss their lightmap uvs?
I just set the min resolution to 20 and also to 20 in the scene baked lighting so that would work but it doesn't help
so the issue isn't this one but the fact they miss lightmap uvs as you said, but I did enable the generate lightmap uvs on the model import settings so I don't understand
oh no my bad, they weren't red lol, sorry I'm really dumb today
so if I refer to what you said, it's because they haven't been lightmapped but how to lightmap them? because I did it as you told me and it doesn't work
can you fold out this field from the arrow
And also tick this
The above screenshot seems to indicate that the have not been included in the last bake
Maybe the bake didn't properly start/finish
But seeing the Baked Lightmap field may give some kind of clue
where is this if you don't mind? I can't find it lol
Scene window in GI contributors/receivers view
Since according to GI debug views those walls don't exist, it's hard to draw any kind of conclusion
On top of all that it looks like your lights could be clipping into the walls so can't tell if the lighting that isn't fully bugged out is correct either
At this point I'd go fully emprical and test what truly works and what does not
New scene with one wall, one floor, one default cube and one light
ohh okay I'll do this, thanks for helping
In a big scene there could be five different light baking problems, each of which obfuscates the others
And there's many steps to follow to do the bake right to begin with
well, at first before baking, they weren't bright enough so I thought adding these lights would help and it indeed did even if it's kinda wrong
could you tell me them please? I'll make a new scene right away when i'll be back home
So a test scene with no unknown or unpredictable variables is your best ally
You should always double check from documentation (and tutorials won't hurt either), but off the top of my head
- Set meshes as contribute GI static, receive GI to lightmaps
- Enable lightmap UV generation on meshes or otherwise confirm they have valid lightmap UVs
- Set lights that should be baked to type Baked
- Enable Baked Global Illumination in Lighting Settings
- Bake
Important to note: - Not all meshes need lightmapping, small and complex meshes should receive GI from light probes, if they need to contribute to GI at all (Light probes are also very important, but practice lightmapping alone first)
- Meshes should not have exposed backfaces
- Lights should not be too close to geometry, and their ranges should be sufficiently high
- Don't enable Realtime Global Illumination, it's a different lightmapping system with a whole another set of quirks
- The simpler scenes you practice bakes with, the less time you spend waiting as well as hunting issues arising somewhere from the complexity