x

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"

How do I get rid of shadow errors with lightmaps (with proper resolution)?

Hi,

So I tried to use lightmaps instead of dynamic lights and the results are awful. The resolutions is 1024 and I tried all the possible settings but non of them helped. Any ideas would be greatly appreciated! :)

alt text

alt text

alt text

Also the shadows on the wall is quite blurry, even though it has a 0.2 lightmap resolution (BSP).

Thanks, Fisher

Product Version: Not Selected
Tags:
more ▼

asked Aug 31 '14 at 10:26 PM in Rendering

avatar image

Fisher007
108 14 18 24

avatar image Fisher007 Sep 18 '14 at 03:14 PM

After more than 2 weeks, I'm still struggling with this. :( Really nobody has any idea?

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

1 answer: sort voted first

Hi Fisher,

For your object can you post a screen shot of your Lightmap UV? If you're having to pump your LM resolution that high the LM UV may need a little tweaking to better utilize the space for the best results.

With a model this size targeting a LM size of 128-256 should work best with a good UV layout.

Thank you!

Tim

more ▼

answered Sep 18 '14 at 06:41 PM

avatar image

Tim Hobson ♦♦ STAFF
48.9k 887 101 877

avatar image Fisher007 Sep 18 '14 at 08:02 PM

Hi Tim,

Thanks for the reply. Here is the 2 UV sets. The second one is the original hand made, after having the issue I made an automatic rearrange for more edge padding (the first one). It didn't help sadly, also it looks the same with different UVs so I doubt if it would be the source. I pumped the LM resolution so high to see if it helps.

alt text alt text

I also tried without SGs and with recalculated normals, non of them helped. The next ting to try is to bake in an older version and taking apart the mesh completely and see if it is really down to the relation between lightmass and the shape. If it is lightmass then I'm stuck as I have already tried to change the relevant settings.

Cheers, Fisher

(Btw why is your answer got marked as resolved? :) ) Edit: Nvm, it seems that it automatically marks it as resolved if there are no more comments? Sorry about the confusion. :D

avatar image Fisher007 Sep 21 '14 at 11:32 AM

So I narrowed down the issue. It is existing in 4.2 as well and it seems that it is caused by model.

alt text

alt text

The difference is only in the UV and the resolution. From left the first one is auto UVd in the editor, the second one in Max, the third one is the original. You can see that the 2nd and 3rd has identical normals, tangents and binormals. I don't really have any other idea to solve this so some help would be much appreciated. Also not sure if it is related, but this doesn't look normal either (3rd image).

alt text

Cheers, Fisher

avatar image Tim Hobson ♦♦ STAFF Sep 22 '14 at 09:05 PM

With the complexity of the object and how much is being packed into the 0,1 space for your second UV it may be necessary to pump the lightmap resolution up to get better results.

For the 3rd Image I'm not sure which lightmap UV you're using (looks like the second one that is hand made with the smaller geometry) but this looks like you need to pump up the resolution to get better results. you have a large face that is shrunk down and lighting isn't getting baked with an immense amount of detail.

Give that a shot and let me know how it goes.

Tim

avatar image Fisher007 Sep 23 '14 at 11:28 PM

"If you're having to pump your LM resolution that high the LM UV may need a little tweaking to better utilize the space for the best results.

With a model this size targeting a LM size of 128-256 should work best with a good UV layout."

This was your first post and now you are saying that the LM resolution is not high enough... I stated in my first comment that I pumped the resolution to 1024 to see if it helps, I'm still here so it obviously didn't help.

Two identical meshes, two LM resolution (256, 512).

alt text

The shadows look better on the BSP but far from being actually good or anything that I have seen in games.

alt text

LM resolution of 2048 on the normal mesh, looks terrible.

alt text

avatar image Tim Hobson ♦♦ STAFF Sep 25 '14 at 06:21 PM

This was your first post and now you are saying that the LM resolution is not high enough... I stated in my first comment that I pumped the resolution to 1024 to see if it helps, I'm still here so it obviously didn't help.

I was honestly just eyeing it. I suggested pumping it up when you want more resolution in your LM. The thing is you have a complex mesh with limited space in the 0,1 space for the LM. If you're not getting the results you like at a lower resolution then bumping it up is a potential solution.

LMs takes work to get right especially if you're trying to get a specific look.

Part of the issue I can see in the second to last image on the 1024 where it has the line in the middle of the shadow. Are you using a fully static light? This looks like a stationary that is switching between the static and dynamic at a distance which is why you're seeing a difference.

As for the differences of the LM resolution you're comparing apples to oranges in this one. The BSP has it's own LM at it's own resolution that the shadows are being baked to.

The Mesh you have static shadows being baked to it's own LM and not another LM.

Try using fully static lighting and build lighting in production level.

avatar image Fisher007 Sep 29 '14 at 10:58 AM

You were right, fully static lighting works perfectly. The only problem -and that's why I haven't even thought to try it- that if you use static light, dynamic objects won't cast shadows, right? That is really not an option in a modern game so the problem is still open. I can't really understand why would stationary make such an awful lightmaps, in the docs it is stated that actually stationary has the better quality. So I still have a feeling that this isn't the way it should work. :(

avatar image Tim Hobson ♦♦ STAFF Sep 29 '14 at 03:33 PM

There is a fine balance here for getting good lighting. It's just liking being a good artist. Good lighting is an art in itself.

You are correct, If you use a fully static light it will not cast dynamic shadows on movable objects.

First thing, There is no difference in quality in the lightmap bake between stationary and static lights. The difference you're seeing is the fade in distance of the dynamic lighting vs the lightmap bake. This is where the discrepancy is coming. You can adjust the cascaded shadow distance and quality to get better results and set the distance you're happy with the transition.

Secondly, It's key to remember that Stationary lights are a new thing. They are a balance between full static and full Dynamic lighting. This allows for using your lightmap shadows at distances where dynamic shadows would not be present.

Another powerful feature is to limit how each mesh is affected by lighting. If you select your mesh you can look in the details panel and adjust what type of shadows it is affected by.

For instance, on your mesh, you can use stationary lighting for everything, but for your mesh uncheck the box that says Cast Dynamic shadow. This will only use the static lighting from the stationary light rather than switching to dynamic as you get closer.

I hope this helps clarify some. Give this a test and let me know how it turns out. I'd certainly like to see you getting the results that work best for you! :)

Tim

avatar image Fisher007 Sep 29 '14 at 07:55 PM

Static:

alt text alt text

Stationary:

alt text alt text

I checked if the stationary is using dynamic shadows and no, those are the baked ones so there is no fade in. Also, cascaded shadow distance is only for the directional light. What if the scene is indoor (as it was originally)? I'm using a point light for the above 4 pictures, as far as I'm aware there is no such option for that light type.

As for the per mesh settings, as I mentioned there are only baked lights, so changing any settings affecting dynamic lights and shadows has no effect. (I checked all of them just to be sure) The strange thing is that stationary lights aren't that new, I was using them in UDK and they worked perfectly. Well I agree with you that creating good lighting is rather an artform but they have been quite better than this. :)

Also, thanks for the efforts Tim! :) I really hope to get better results as well because UE4 is just so much better than UE3 was, but this really sets it back at the moment.

avatar image Tim Hobson ♦♦ STAFF Sep 29 '14 at 08:33 PM

So I made a simple mesh with a extruded section similar to your exhaust.

Here are my results. Static is getting slightly lower res than stationary static Lightmap. Barely though. I'm not seeing the difference you are though. My mesh is using a 128 res lightmap and it's using more UV space than yours is though.

Here are the results using a Directional Light: This is the stationary light with the mesh set not to receive dynamic shadows

alt text

This is the static light

alt text

Next up, I did the same with a point light:

This is the stationary point light with the mesh set to not receive dynamic shadows

alt text

This is the static light:

alt text

avatar image Fisher007 Oct 01 '14 at 12:34 PM

As I showed you earlier, the BSP had more acceptable shadows, the real problem existed only on the mesh. I uploaded my fbx to Dropbox, if you could take a look that would be grand. :)

https://www.dropbox.com/s/pg7tvdg344pya1m/VM_LP12.FBX?dl=0

Also, just to make my dreams better I screwd more things. :'( Dynamic lighting doesn't work with a directional light anymore. Well it works at first if I open a new project, but then if I bake lighting and then move the light it switches back to dynamic but it is super low res.

alt text alt text

I didn't do much, just opened a new project, imported the mesh, dropped on the scene (first picture), baked lighting (second), rotated the light a tiny bit (third).

alt text

avatar image Tim Hobson ♦♦ STAFF Oct 02 '14 at 10:13 PM

I was able to do a test with your mesh and have made a simple test scene with different LM resolutions and lights. I specifically turned off Stationary lights ability to cast dynamic lights and baked only the static for both a static and Stationary light. I was able to see the quality difference between the two and have submitted a bug report for this. (TTP: 348502)

Here is my sample test scene.

Tim

(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