Download

Lightmapping; Generating Unique UVs horribl/unusable results compaired to Unity3D

I’ve been toying with the Generate Unique Uv’s tool to generate Lightmaps UVs and have not been able to have usable results.

Long shadows on walls bend;

http://puu.sh/7G6T0.jpg

Shadows are improperly placed;

http://puu.sh/7G71D.jpg

Artifacts appear even where there shouldn’t be any shadow;

http://puu.sh/7G794.jpg

I tried a lot of parameters and options to no avail, it just looks wrong all the time, sometime it’s less visible but it isn’t as perfect as in Unity.

We come from Unity3D and their automatic Lightmap UVs are just working the way it should, no tweaking required. In rare occasions there’s some light bleeding but that’s all that can happen and when it does, and you don’t want to UV manually you can still increase the resolution.

I understand why you recommend doing it manually but to be honest Unity does a great job automatically, 99% of unity users are using it, the gain in time is substantial so why couldn’t Unreal engine do it?

Are there any plans to improve it? Is there a trick that makes it 100% effective? Perhaps a 3rd party tool that does this instantly on a mesh?

Thank you

The bending is because pixels are square, thus diagonal lines are jaggy, and due to distance field shadow rendering those pixels will then get blended with a dynamic shadow leading to a sharp but curvy line. In other and simpler words I think your lightmap is possibly too low resolution. Resolution is set in the mesh viewer. That or it is heavily distorted by your generation.

And also the generate lightmap UV tool should be used solely for organic/natural objects and never for anything with hard edges. It will absolutely not handle that properly as are finding out, and should be done in a 3D package.

One thing that however proof some help is if you don’t generate uvs, but pack the existing ones instead. Use option Layout Using 0 channel. That will give you better results usually, but still it would be way way better to do this in a 3D package. Your workflow and asset pipeline will be damaged by doing it in the editor on the long run.

What version of FBX exporter did you use?

Make sure t use version 2013, not 2014

@Hourences, thanks the jaggy issue on the wall has been fixed with the Lightmap resolution, as for the others well, I suppose we’ll have to add this in our workflow.
Thanks for the help

@CharlestonS; it’s not a FBX import issue but thanks for the suggestion.

The bending you see there is caused by low Lightmap Density, which is the same as Unity’s Lightmap Scale.

https://docs.unrealengine.com/latest/INT/Engine/UI/LevelEditor/Viewports/ViewModes/index.html

If the Lightmap Density is extremely low, as I suspect it is in your screenshots, then you will see artifacts elsewhere.

View the lightmap density View Mode (cahnge Lit to Lightmap Density). This shows the texels, the same as Unity’s Lightmap Scale preview (only better as it colour codes density).

You will want to override the density per object (as you’d set per object lightmap scale in Unity’s Lightmap panel)

The docs have a lot of info on this.
https://docs.unrealengine.com/latest/INT/Engine/Rendering/LightingAndShadows/Lightmass/index.html

edit: I see you got it already :slight_smile:

Like Hourences says this is definitely the lightmap resolution. Default is 32x32 which is way to little for meshes this size if a shadow this sharp is cast on it , especially if you use auto-uvs. You will probably need 128x128 to get rid of the waviness.

You can also make the shadows smoother by increasing the Light Source Angle on the directional light. The waviness should be less apparent with a smoother shadow.