I am new to Unreal engine and I have some issues with the baked lighting. It bakes black faces sometimes and I would like to understand why. Here is an exemple :
The lighting setup here is still the stock lighting when creating a blank scene (I think):
I’ve read here and there that it is often related to UV unwrap. I am using Blender and, as it is advised, I created 2 UV channels on my mesh.
Here is the first UV channel for my trims:
And here is the second UV channel for the lightmap:
I have also read on another thread that it could be flipped faces or mirrored UVs. So I made sure to double check that as well.
None of the UVs are mirrored on either channel and this is how the normals look inside Blender:
Finally, I’ve read that it could be an [export/import related issue] and here, we reach the extent of my knowledge as I am not used to export for Unreal.
Basically selecting Tangent Space option in the Geometry tab of Blender’s FBX exporter breaks tangent bounds in FBX and causes this issue. After I unchecked that option and re-exported my "problematic"meshes, artifacts went away (after rebuilding lighting).
So I tried that, as well as trying out different import settings inside the engine. None of that worked.
Well, this is everything I’ve tried and I am starting to be sad
If someone has an idea on how I could fix this, that would help me a lot.
Thank you for your time
I found the start of an answer. UV rotation is involved. The UV island on the texture UV isn’t rotated in the same direction (rotated 180° to be precise not mirrored just rotated) which is leading to a shading error in Unreal. I don’t have a clue why to be honest ?
It should not cause a problem (different rotation) if you have high enough lightmap resolution or enough padding between the uv islands!
Looking at your lightmap uvs… could you explain to me please how can it has 16 faces? …even if you’ve kept all the faces and these are just 2 boxes snapped together it’s all together 12 faces…
But you can be kind of sure: if you have completely black faces after build, those faces don’t have lightmap uv assigned to them, they can’t visualise lighting information…
…if it’s not completely black it can be reflection problem too…
So let’s just stick to this one object!
How is it mmodelled? How many faces does it have? Any overlapping parts?
What is your padding at the sides and between the islands?
What is your lightmap resolution?
Ah yes, the object is bigger than what you can see on the screenshot. There is another set of two trims on the other side of the building (2x8 faces). I agree rotation shouldn’t be an issue still it fixes the problem here. I posted another thread on Blender’s forum cause this seems related to my 3d package…
I wouldn’t expect lighting working on open meshes… they should be 3d meshes with thickness… I can’t help you with these…
I eventually found a convincing answer. In the shader I made, I used 2Dsampler parameters as inputs. I was then pluging different textures in each material instances. Since the default texture type when you drop a 2D sampler is color and not normal, the normal textures in the material instances were considered color and not normals, which led to this shading error. I think fixing this will do the trick (crossing my fingers here but I think that’s the issue :'D)