I have the following problems with the lighting of a static mesh. I am sure it is due to a lack of knowledge on my part, so if anyone knows what I may have missed or left out, please let me know.
What I do is:
I create a static mesh in 3dsMax. A simple wall, thus a simple 6 sided mesh.
As I want to save texture space / have more detail, the front and the back share the same texture space, as well do the sides.
Top and botton are separate though due to their different coloring.
After creating a material from the texture (incl a normal map), I export the mesh as FBX and import it to UE4
It looks OK so far. I have then added a simple box collision.
I do know that lightmaps need their own, strictly non overlapping, set of UV coordinates, which makes absolutely sense, since the texture may be shared between front and back wall, the shaddow will surely cast different on both surfaces.
So I created a second set of UV coordinates via the UE4 mesh editor:
And it seemed to have been successfull. Here are the two UV channels:
I managed to set the lightmap index to 1 in the static mesh properties. So no more error there…
Must have just missed that … Ooops… :mad:
However, there is still a small issue.
Can someone give me a short pointer on how to avoid the edges of the mesh showing shadow seams at greater distances…
When I put two of these meshes side by side and view it from closeup, it looks like this:
By default the lightmap resolution is 32 (32x32 pixels) which is very low, you can see on some places where the corners are rounded which means the lightmap resolution is too low.
When a lightmap is too low then a pixel can also overlap the edges of the UV’s so if there’s black there then it overlaps a bit, so the UV’s need to have enough space between pieces so that it can add padding. If the lightmap is too low, then it doesn’t have enough room.
It’s also best to create your lightmap by hand in your 3D software, the automatic results in UE4 are OK, but you can improve results greatly by doing it by hand. That way you can reduce the number of seams and pack things together better.
@ayjolnerub :
I will definitely have a look at your post.
However I think using the emissive for that (and basically eliminating the shadows at all) sounds questionable.
In the meantime I managed to export the second, in 3dsMax created, set of UV coordinates. They look indeed now a bit “cleaner” as to what the UE4 mesh editor produces:
Both screenshots were taken with the standard lightmap resolution and the lighting quality set to preview.
What remains is the different shading on both meshes in the indirect light.
Appearently this is due to objects being rendered in different threads, thus inherent to UE4.
Did you check, if all your vertices on the model are merged? It’s absolutely crucial that you don’t have any double geometry, as that will always cause lightmap errors. You may also find that the light itself can cause problems (e.g. too many lights in a scene). I had best results without any direct lighting source, for example. At least with interiors. Of course, not everyone makes a map in darkness/space.
However, try reducing the lights in your scene and switch between the different light types to see if that makes a difference in your bakes. The first thing to do, however is to check your mesh for errors. With plain cubes like these, I don’t really understand why you don’t simply use CSG, though.
The only light in the scene is a directional light.
The mesh geometry is absolutely ok. Since it is the most primitive mesh imaginable.
I created a box, punched in the correct dimensions. - Editable poly - UVW unwrap - center pivot in the world - export as fbx.
Good question
I am currently blocking out a map and running into the following issue:
The map is about 40% done and contains already 1200+ brush actors. It has only one directional light and with preview quality, a build takes now 2 minutes and more.
I just think with meshes, the lighting build times will not be that high anymore.
I estimate that, if created by CSG, the final level would have 3000+ brush actors…
How do you block out bigger levels?
Cheers,
Klaus
ps: Is not only the lithing build time, also while changing geometry, the editor lacks incredibly and an undo takes between 6 and 8 minutes to perform…
I group brushes or put them in folders and copy and paste everything that repeats. In architecture that is usually a lot. I try to use as few pieces as possible and use them over and over again. In Maya, I also found it useful to place the (left, front) corner edge of my meshes on 0,0,0 Position, as that will make them snap more easily than when the pivot is in the center (hold v to snap and drag in UnrealED). Later on, I replace the BSP/CSG with the actual models, after exporting the BSP to use it as a template. Some BSP, such as floors often remains in the final version of a map.
This map must be extremely hard to work with, if you have so many actors. You might want to figure out small and large modules first and make a list + sketches of everything, before starting the in-editor work. I often also make a list of materials I need and start grouping my brushes/models accordingly, so I know which assets belong in the same material group. I find organisation extremely important when working with the Editor, so I use a lot of Groups and Folders.
I already use tiling for walls. I use 500 wide, 40 thick and 460 high slabs for outer walls (covering the floor and ceiling) and a version that is 380 high for inner walls.
There is also a 540 wide version of the wall to cover edges. Only the floors/ceilings are “custom” at the moment.
If I group the brushes, they will still be separate objects. In what way would that affect buld times / editor lag…
The map is not that hard to work with. Actually it is fairly easy (because nothing is grouped). I can easily pull a window from nearby and duplicate it on the spot without having to fiddle it out of the group first)…
Maybe I should make a little tour video of the level so far and show how it is constructed brushwise…
I also use a well organized folder structure for my assets. As I dont care for brush groupings and they are just for blocking purposes, i didnt bother establishing a folder structure there, especially since so much is in the flow there…