Download

Modular Asset Lighting Problem

Hello all! I just started working on my first set of modular assets (which are primarily different sized tiles) and I’ve gotten them to fit correctly and everything but now the problem is lighting. It is being lit differently on some tiles. Also, there are dark lines on some seams after building.
HighresScreenshot00000.png
HighresScreenshot00001.png
HighresScreenshot00002.png
How would I fix this? Thanks! :slight_smile:

Hi,
Make sure that your assets have a 2nd UVs channel, without overlapping.
It’s used to store the backed lighting map.

I’ve already done this as well. This is what my both UVs channels look like:
730218a11dd10d400fd9ec98dadca6d65368f982.jpeg
Does it just need to be bigger or something? Thanks! :slight_smile:

You should have some padding between faces(3-4 grid pixel, where grid size = 1/lightmap resolution), also was your light builded in production mode?

The images above and below were built using production lighting. Is this what you mean by having padding?
uv.jpg

If so, the problem is still occurring.
HighresScreenshot00000.png
HighresScreenshot00001.png

Am I doing this correctly? Thanks! :slight_smile:

By “padding” he meant the distance of the UV shells next to each other. If they are too close, one can influence the other, because it “bleeds” over the UV shell border. However, I think Lightmaps don’t do that (happens with Diffuse though).

The reason you see seams on your lightmap is because you haven’t connected the UV borders. When you make UVs for diffuse textures it is fine to separate them, when you make them for Lightmaps, you need to keep your object in one piece, if possible. Whenever you get the black seams, try connecting the UVs to make a single UV shell for your lightmap. Generally, try keeping lightmap Uvs together.

https://answers.unrealengine.com/questions/62360/how-to-fix-blocky-shadows-across-modular-walls.html

Depending on your lightmap resolution you can actually adjust the size of your grid in your modelling programs UV editor. Make sure ALL of your UV shells in your lightmap channel are snapped on the grid lines. It’s really importing to snap your shells on the grid lines because that stops light bleed and will give a better visual improvement for seams. To adjust the size of your grid in your modelling apps UV editor just divide the lightmap resolution by 1 e.g. 1 / 64 = 0.015625, this would be the size of your grid if you want your lightmap res at 64 (which I’ve found gives good results). If you are using Maya then put this in your ‘grid lines per unit’.

Getting your grid size right will help you determine the padding issue that everyone is explaining above. You can use the grid to your advantage to easily spot padding issues between shells, 2 - 4 pixels (or grid lines) is a good place. If you are doing modular assets I would keep in mind texel density as well so that everything is consistent across your map.

To me, this looks like the result of the meshes being rendered in separate threads…

Some of this information was covered above. There are ways to help alleviate and reduce this.

I’m going to be a little redundant here but just to make sure that a lot of the information is condensed into a single post.

  1. Make sure you have a second UV setup specifically for your Lightmap.

  2. (This is for modular hard edges like walls) Set up your grid spacing in your UV and snap the vertices to them.

  • Target a LM Resolution (If you target 64 you can adjust higher via power of two and you will not have to manually target each LM specifically)
  • Use the following formula to get the grid spacing for your UV: 1 / [LM Resolution] = Grid Spacing ie. 1 / 128 = 0.0078125
  • any edge that is not snapped along a grid line can be shadowed. This is why there will sometimes be jaggies or artifacts with the shadows
  1. For modular walls, the recommended workflow to not have seams is to have other meshes that cover this area or to have your edges meet at corners.

  2. If not your workflow, you can reduce the edge seams by doing the following. Some of these settings WILL increase light build times.

  • Place a lightmass importance volume in your scene covering your playable area.
  • Under World Settings you can adjust the following:
    -Indirect Lighting Quality 2 or higher should work (may need to be higher up to 4 but will increase light build times)
    -Indirect Lighting Smoothness to 0.6.
    -(Optional) Environment Color - change to anything other than full BLACK. This will lighten your shadows and increasing it just a little in the grey side will help sometimes.

If this isn’t working for you the last option is to adjust Static Lighting Level Scale under World Settings. Default is 1.0. If you adjust this lower you can get better results. This will significantly increase light build times in some cases. This is the scale which light is build. Default is the current UE4 scale of 1 unreal unit = 1cm.

Using these methods should help in going a long way to get the results you’re looking for.

Feel free to ask any questions you may have. :slight_smile:

Tim

Hey, so I went back into 3DS Max and re-created all my lightmaps. Here’s one in 3DS Max:
uv.png
options.png
As you can see, I have them snapped onto the grid lines and everything (I hope lol). This is what I have now:
HighresScreenshot00000.png
HighresScreenshot00001.png
HighresScreenshot00002.png
HighresScreenshot00003.png
I think it looks a little better now. All of my wall tiles are using the same material, but it still looks like some are different colors.

@Tim I’ve tried changing my world settings, and they still look different.

Now if I can get them to look the same color, I’ll be all good.

Forgot to add this, but I’ve lowered the Static Lighting Level Scale to 0.1 and this is the result:

It looks a lot better, but in dark corners it looks weird. lol

Hi,

when you snap your UV islands to the grid, make sure you have

  • a texture with that resolution showing in the UV editor (even if you unwrap UVs. the texture is just used as a dummy, see below)
  • you have activated the snapping, which you have not in your screenshot:

uveditor.jpg

You have to click the button and hold (the snap button is a fly out one). Just look for that snappy little box :slight_smile:

uvsnap.JPG

Here is the trap: You must do both of the above. Forget either to select and show a texture, or forget “activate” the snapping mode
and snapping will not work.

That checker like shading pattern… Is that consistent with the modular mesh geometry?
If so, it is caused by the lightmass parallel baking process. These artefacts can be attenuated and/or obscured by additional geometry, but not fully avoided.

Cheers,
Klaus

It looks like your Lightmap in the above screenshot still doesn’t have very good padding. Anything that is near the edge of the 0 - 1 UV space still needs to have padding. Lightmaps aren’t like texture UV’s. If you move all your shells that are near the edge of the 0 - 1 UV space and give everything around a 2 - 4 pixel space then that will definitely make your walls look a little better. Just some more tips, the orientation of your shells doesn’t matter with lightmaps so you can squeeze whatever space you can from your lightmap. You can scale down your shells a little smaller (if your going to be using a 64 resolution on your lightmaps) this should help you get more space to layout your shells and give everything 2 - 4 pixel spacing.

Everything that will be facing the same direction can be sewn together. By this I mean let’s say your modular walls get bigger, then if you have 2 parts of your wall that are going to be facing the same way (pointing in the same direction) then you can sew those parts together. Anything that isn’t facing the same way you will have to give it’s own space on your lightmap. This may not apply to a majority of your models if you are going modular but it is good to know :slight_smile: (I will try to get some screenshot examples for you so it will explain all this a little easier).

Hi KoldKam,

To better illustrate, I’ve setup a simple scene similar to yours with a single wall mesh where I can visibly see the modular wall seams.

This should help with seeing how to get rid of seams. This will still not get rid of them fully and this is why the recommended workflow is to have your walls as one single piece, use other meshes to cover seams, have your meshes seams meet at corners, or use the World Settings > Lightmass section to help reduce the seams.

In my following examples I’ve made a simple wall mesh.

LxWxH: 300x200x20 cm

I’ve set the lightmap UV to target a 64 lightmap resolution. I’ve set my UV grid for my UV to 0.015625 for vertex snapping.
I’ve placed a light in the scene with a intensity of 3500. Everything else is default.

WARNING!
Increasing some of these settings below will significantly increase light build times!!

In this first image here are my settings:

LM Resolution: 64
Light Build Quality: Preview

LM1_64_Pre_noChanges.PNG

In this second image here are my settings:

LM Resolution: 64
Light Build Quality: Production

World Settings:
Indirect Lighting Quality: 2
Indirect Lighting Smoothness: 0.6

59d2b22349b969a6e950db6680f7b2f973baf6e8.jpeg

In this third image here are my settings:

LM Resolution: 64
Light Build Quality: Production

World Settings:
Static Lighting Level Scale: 0.1
Indirect Lighting Quality: 2
Indirect Lighting Smoothness: 0.6

LM_64_Pro_scale.PNG

Attached below is my simple scene I’ve set up with the wall mesh.

https://www.dropbox.com/s/jk99sjq0d4vp1ic/LM_Seams.rar?dl=0

This scene is setup using the final settings in the above image.

There are a few artifacts in some corners, but this should be able fixed by adjusting the LM resolution up.

While this is a simple setup, by having a good UV layout with padding between UV islands can help get better results.

Tim

Hello all! First of all, I’d like to say that I love this community and thank you for all the help. Thanks Tim for the scene as well. I’ve adjusted some of the World Settings and my scene is looking a lot better. I also went back into 3DS Max and re-created all of my lightmaps again. I now have some spacing between each island:
uv.png
It is looking a lot better. I will post a picture later. I have to go somewhere. Thanks guys! :slight_smile:

Fantastic! I’m glad this is working for you. :slight_smile:

Tomorrow I’ll be carving out the time to get some notes and a lot of this stuff up on the Wiki to help others that are having issues. There have been a lot of questions lately regarding Modular seams for walls.

Tim

Back with pictures!
HighresScreenshot00000.png
HighresScreenshot00001.png
HighresScreenshot00002.png

Sounds good! :slight_smile: Thanks again guys! :slight_smile:

@KoldKam. Man that is looking sweet now! Good work dude, your lightmaps are much much better now :smiley:

Why are you use texture for this purpose? Just set up your grid size.