I have a few meshes that keep turning black when I rebuild the lighting. I have tried reimporting the base mesh, followed videos with a similar issue, checked my UV channels, and did everything else I could find documentation for. But this mesh and one other keep turning black when I rebuild the lighting. If I put a light up next to it, it shows the material and reflects light. So obviously it’s working at least partially. Why does my mesh keep turning black??
Hi!
Almost 100% (with static lighting) that it’s the lightmap uv!
Could you show us the lightmap uv of this mesh? Do you have more uv channels? Are you sure you’re using the correct one for lightmapping?
Normals? Coluld be also flipped ones and it turns the lighting inside out…
I was having a similar issue with a mesh in the 3rd person shooter template level. After modifying its settings in the mesh editor, it became black in the main viewport. The scene is all dynamic lighting, and I was trying to set up a Light Propagation Volume, so not sure if I was doing it incorrectly. Then I enabled “Dynamic Inset Shadow”, and it was lit. That was associated with the scene having dynamic lighting, I think. So, perhaps it’s a setting(s) associated with the lighting setup, and not UVs. Have you tried using Visualization Show flags, or debug overlays? They’re all in the Viewport buttons at the top.
I had already done all of the things you guys suggested but I found the answer. The way I had modeled my walls was with only one layer of surfaces but I had made the material used for them two sided. So basically the directional light had to compute an entirely lit surface on one side and an entirely unlit surface on the other side, resulting in the unlit side being completely black. Once I wrapped the building with the external layer of the walls and ceilings, the inside was lit well. I guess unreal can’t compute the directional lighting on a surface with a two sided material when the photons only hit one side (even with windows with light portals).
That sounds a bit complicated. I’ve seen a different problem where two-sided solved a sliding door generating a dark area in the shape of the door when it was slid into the wall (like an actual sliding door, but when it’s in the wall and not closed it causes a shadow of the door to be visible on one side of the wall). So, setting it to two-sided somehow lit the one side of the door so it was not resulting in a shadow of it in the wall. That’s how I imagined two-sided would work, but lightmaps and shadowmaps obviously aren’t that simple in how lighting is calculated.
By “wrapped the building with the external layer of the walls and ceilings”, was it another set of meshes on the outside or the inside of the initial set of meshes for walls and ceilings? And all meshes had two-sided disabled when it worked?
Basically, one set of meshes for the face seen from the interior and one set of meshes for the face seen from the exterior. Neither set of meshes are two-sided, and the lighting generated correctly.
That’s interesting. Thanks for the info. Glad it worked.
I visited this thread for my own problem which turned out to be flipped polygons. I was doing some symmetry in max and forgot to flip those normals. Meshes ended up being black when building static lighting. No overlapping errors and using 2-sided material made it impossible to spot in Unreal.
Two-sided means the normal is taken into account for lighting on the outside of the mesh and on the inside of it (normals pointing into the mesh, which are not visible unless it’s translucent, and can cause errors in lighting / shadowing). I think there’s an issue when exporting from an external app like 3DSMax or Blender and importing to Unreal sometimes. It seems even if certain meshes are completely closed and don’t have double vertices / edge gaps / face fold-in or other incomplete geometry…that the calculated lighting in Unreal upon import turns some shading wrong. One thing to remember about Unreal is it defaults to tangent space for materials, yet for meshes without materials yet…it’s probably not calculating lighting based on tangent space only. There’s world and local space, view and screen space, and those handle lighting / rendering in particular ways that are different. For reflections, it’s suggested to enable the GBuffer Format > Use High Precision Normals in Project Settings, and then enable “Use Full Precision UVs” and/or “Use High Precision Tangent Basis” for any mesh needing high-quality reflections in the mesh editor Build Settings for those meshes.
I say this because it appears that a large percentage of the lighting issues (such as meshes appearing dark rather than lit in-editor) are derived from unknown causes, and are not well-understood as far as the deeper, inner workings of Unreal Engine lighting. Building a level with meshes that contain NO MATERIALS is hazardous to lighting because they utilize a base material that has settings and interaction with the lighting / shadowing quite different from the materials that are going to comprise the level’s geometry. So, if the geometry isn’t bad, and the correct material is on the mesh, how is the engine capable of producing wrong lighting and shadows if settings aren’t incorrect or are at defaults. Other meshes, whether imported or dragged into a scene from the Starter Content, don’t have these lighting issues often. Why are those more reliable with static, stationary, and/or dynamic lighting?
I have fixed the issue guys,
in 3dsmax create a simple box and convert it to an editable poly,
with the box selected go to the modifier panel and attach your black object to the box using attach button,
then delete the box element.
Export your mesh one more time and enjoy.