Lightmap Density not matching UVs from Maya

Hiya,

My last post just crashed so I’m writing this again.

I’ve looked at a few threads but I’ve not seen anyone post this issue. I’m using modular pieces for a ceiling from Maya that tile and have blending shaders on them. I have set up the LM UV set on them to 64x64 and laid out the UV shells snapped to the grid with 0.015625 spacing. They have come through to Unreal successfully but when I bake the Lightmap Density seems incorrect to me, the Pixel guides overlap the edge of the geometry and it’s causing seams in my geometry. Is there some UV compression going on?

Thanks,

HI!

Do not worry about preview grid. UE4 does not aligned this grid. It use just for visualise of texel density and ratio.

In MAYA i would recommended use grid setup with Subdivision. Because “Grid lines every:” little buggy. Sometimes Grid get little offset.

Set padding around patches minimum 2 pixel. Because, compression algorithm use this 2 pixels for interpolation.

Test grid

And result.

Build → Light Quality → Production. Other parameters you can see on the picture.

Thanks for the swift response, I’ve followed the steps suggested and still getting the same results. I’ve added some updated screen shots below. I’m planning a project with this modular workflow. Any other suggestions are much appreciated.

A lightmap size of 8 would mean you have a 8x8 lightmap texture. or 0,125 per pixel in a 0-1 space.
A lightmap of 64 would mean a 16x16 pixel lightmap texture or 0,015625 per pixel in 0-1 space. so far so good.
Thing is, ue4 needs a one pixel buffer on each edge of the 0-1 space.

It took me a while to fully understand the math behind it untill I found this:

(Something Epic should take note of)

Most noteworthy:

The solution and the numbers ! :
You need to substract 1+1 to all your lightmaps grids that you use in your UV editors.
32x32 Lightmap ? Grid has to be 30x30
64x64 >> 62
128x128>>126
256x256>>254
etc… of course…
So how do I set my grid size ?
Well here are the values, internet will tell you 1/32 1/64, don’t listen to them !! :smiley:
1/30 : 0.033333
1/62 : 0.0161290322
1/126 : 0.00793650
1/254 : 0.003937007874
1/510 : 0.0019607843172
1/1022 : 0.0009765625

Which helped me to get smooth lightmaps all the time.

Your UVs is OK. Try to set parameter Lightmass → Lightmass Setting → Static Light Level Scale to 0.1. And random luminosity on modular meshes should disappear.

I checked lightmap with 62 and 64 grid setup. I think 62 looks is too dark in contact places.

This is 62

This is 64

So I’m not fully getting the grid settings to test out the 62x62. I’ve tried two ways.

Setting the subdivs to 62 which still resulted in seams in the game.

And then with the number suggested but wouldn’t let me go to the amount of digits you had, and also I couldn’t snap to the grid with that setting:

I also tried the Static Light Level Scale to 0.1 and my build times rocketed but not fixed the issue.

So I have tried a number of combinations of grid settings. Our graphics coder has suggested that because the format is compressed to DXT in Unreal, and DXT works in chunks of 4 pixels that the padding may be 2x2 pixels at the edge so if they are butted together in a large map that you get 4x4 between them. So I’ve tried working with 4x4 gaps between shells which equates to working at a grid of 30x30 in Maya for a 128 map (with a 4pixel pad).

So the best result in Production bake is below, but the modular pieces look like they’re coming from different lighting setups now, which suggests it’s more than just an edge issue.

I have done a simple test, one modular static mesh set to have a 128x128 LM in a new empty level with 1 Directional light.

The result is it has created a 256x128 map which I don’t understand why, and also it seems the edge padding isn’t true!

Thoughts?

In UE4 Shadowmap and Lightmap not created for each object. Lightmass create atlases for all objects with different lightmap resolution.