Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Baked Lighting Discontinuity, leaks and seams

Hi! I've been messing around with a very simple test level to try and work out how UE4's baked lighting behaves. I was planning on using some procedurally generated rooms consisting of multiple static meshes - however, constructing a very crude mockup shows a whole bunch of odd looking lighting behaviour. There is light seeping, and in one example an entire bsp displaying the wrong lighting level.

Some of this is previously logged - I know that lightmass doesn't like multiple static meshes, so seam covering can be a good idea - but I am wondering what the best steps to take to avoid this type of problem would be.

The only light active in this scene is a single directional light.

alt text

Product Version: Not Selected
answer1.jpg (341.2 kB)
answer2.jpg (352.9 kB)
more ▼

asked Aug 16 '14 at 03:19 PM in Rendering

avatar image

325 18 22 33

avatar image ChristopherPC64 Aug 16 '14 at 04:48 PM

How thick are the walls?

avatar image TinyAngryCrab Aug 16 '14 at 04:54 PM

I used the default example wall static meshes to avoid any possibility of errors caused by my poor uving!

avatar image ChristopherPC64 Aug 16 '14 at 05:00 PM

Open up the static meshes you are using for the walls and increase the lightmap resolution to at least 512 for what you are doing. The default is 64 or even 32 Your light maps look too small for the map and you get leaking because of that.

avatar image TinyAngryCrab Aug 16 '14 at 05:17 PM

Thank you! That nailed the leaking. I also cranked down the resolution on the bsp parts, and that sorted out the bizarre bsp lighting too. However, the meshes edging out into the main light still display problems.



avatar image ChristopherPC64 Aug 16 '14 at 06:00 PM

Say what. Can you reword your "meshes edging out into the main light still display problems."

avatar image TinyAngryCrab Aug 16 '14 at 07:19 PM

Absolutely! The end of both hallways has a wall section which is bright white, but is nonetheless inside the hall and sealed. Here is a closer view.


And this is the outside of the room.


avatar image Luos Aug 16 '14 at 06:57 PM

That actually might be bad UV lightmap placement. Try editing the lightmaps.

avatar image TinyAngryCrab Aug 16 '14 at 07:20 PM

Apologies, but I am unsure how to edit the lightmap directly - how would I go about doing that?

avatar image ChristopherPC64 Aug 16 '14 at 07:27 PM

You'll need a 3d modeling program. What UV are trying to edit?

avatar image TinyAngryCrab Aug 16 '14 at 07:39 PM

I am unsure. He appears to be suggesting that the lightmap UV might be malformed on the meshes. I think this is unlikely as they are assets packaged with ue4, and I would have thought the lightmap uv would have all shells suitably padded and lined up, especially given it's just a 6-sided poly!

I do know how to edit the second channel uv in maya, say, and I know that it is a good idea to make a lightmap uv channel for meshes you import to ue4 for that reasons. But I do not know how to edit an already-baked lightmap, which appears to be what he is suggesting!

avatar image Luos Aug 16 '14 at 08:20 PM

A lot of the meshes that come with the ue4 stuff have (and im sorry to say this) very unoptimal lightmap uv's. you could either export the ue4 mesh and edit the uv in maya, make your own mesh and work on the lightmap or try to auto generate a new lightmap inside ue4 (there is an option somewhere in the mesh browser). Basically you want to make sure the lightmap uv's are on grid to get rid of most lighting/shadow bleeding. That said, be sure ALL meshes have a higher lightmap resolution. (256/512 or 1024 if needed) though for a simple wall with proper lightmap uv's 256 should suffice.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

This is actually a known issue resulting from lighting be baked on different threads. The best solution is to have seams at corners or have other meshes that are used around these seams.

This has been discussed multiple times on the forums and here on AnswerHub.

This is a solution that will help some: https://forums.unrealengine.com/showthread.php?8491-Baked-Lighting-Variation-Between-Static-Meshes

Also adjusting the Static Lighting Level Scale to .75 or .5 will help but this will increase your light build times.

AnswerHub Post: https://answers.unrealengine.com/questions/55062/lighting-issues.html

more ▼

answered Aug 19 '14 at 07:09 PM

avatar image

Tim Hobson ♦♦ STAFF
48.7k 888 103 880

avatar image TinyAngryCrab Aug 19 '14 at 07:38 PM

I have read these, and these certainly explain the tiling. However, is it the case that any mesh with two dramatically different lighting environments affecting it will render incorrectly?



http://i.imgur.com/7cI2v5Z.jpg (this is the outside view showing the projecting wall)

Looking at the example level design map in content examples, some of the meshes appear not to behave like this even though they have two different lighting environments affecting them.

avatar image Tim Hobson ♦♦ STAFF Aug 20 '14 at 06:32 PM

Yes, This is the result and hopefully will be resolved in the future. The main thing is to build your meshes with thicker walls or to have some overlapping or a closed model to keep the light bleed from happening. If you're using dynamic lighting you can tweak the Cascaded shadow map distance to help with the light bleed.

If you notice in the level design content example that there is a mesh to cover the seams that are present. Also using thicker walls will help.

Here is an example of me replicating (somewhat) what you've gotten: This one is using two walls at the end vs a single alt text

Single wall at the end with some overlap: alt text

Here are some additional links to help:

Light Leaking from forums post

Lightmap Bleed in Dark AnswerHub Post

shadow2.png (486.0 kB)
shadows1.png (414.3 kB)
avatar image TinyAngryCrab Aug 20 '14 at 06:49 PM

Thanks for taking the time out to reply! I know you guys are working hard on this stuff, Ticking this resolved.

avatar image TinyAngryCrab Aug 20 '14 at 06:50 PM

(A question for content creation and level design, in the end).

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I want to add an additional comment here that I don't think is in the above. Bias for lighting has been a long known problem in all work CG related, and is no different here. Yes, having goodish UVs is important. If your UVs are for a gigantic structure, you won't get many pixels devoted to any single part. I generally break things down quite a bit.

Additionally, there is known problems with your UVs being too close, creating bleed. So a face on one side of the object may interfere with another face elsewhere that is tangent to it.

But mostly what I wanted to say is that BIAS is a problem. It causes shadows to move off the surface, and cause gaps between objects. The bias is found on the light that is creating the shadow. The default bias is .5 I believe. I have had to make my bias .1 to close that gap. Now if you go too small, you will get artifacting, or self shadowing. The polygon faces will get sort of diagonal striations of shadows as it tries to cast shadows on itself. The lower the number the worse it will get. You need to find the sweet spot, between making the shadow move away from where the objects meet, to creating self shadow artifacts.

Bias. Don't underestimate it.


more ▼

answered Oct 24 '14 at 03:57 AM

avatar image

66 4 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question