Lightmass Bug Leaving Small Black Gaps On Terrain

Hey Guys,

I’m trying to build my lighting for a test level with terrain and I keep getting these random holes. I’ve tried upping the Max LODLevel and also changing Static Lighting Resolution from 1, 2, to 4 and no luck. 4 actually takes a good 1hr+ and that’s on a Z97 with a Devils Canyon i7 4790K and 32 GB DDR3 RAM @ 1866Mhz. But nothing seems to work. I’ve read that Lightmass doesn’t work well with large terrains and mine is the following…

127x127 Quads
2x2 Sections
Resize Expand
16x16 Components
4065x4065 Overall Resolution
256 Total Components

When I build, this is unfortunately what I get… :frowning:

Hi MC Stryker,

Using a lightmass importance volume is very important to keep lighting build times down from the hours + build time.

That being said, using it on large terrains is not ideal either. The best solution is to build chunks of your terrain and combine them in our World Composition tool. This gives you the most control over your level by allowing you to stream in segments and stream out segments more easily through blueprints.

From your image posted it looks like you have some sharp upward/downward angles on your mesh. That can cause some of the artifacts in the shadows that you’re seeing. Try smoothing some of these areas out to reduce that effect.

If you have any questions feel free to ask! :slight_smile:

Tim

Thanks for the reply Tim!

I have a Blueprint in that level with a checkbox so I can see bounds of the level meaning the extent of where the world check/physics start to give out and my terrain is just a little more scaled up than that region. I wanted to probably edit more background scenery so I knew I’d probably have to use the World Composition Tool so might as well start now :wink:

I actually do have a lot of upward peaks but I’ve gone through and tried making sure none were directly up-facing as that would muck up the UVs and some holes actually showed up on flat surfaces in some of the terrain so I’m guessing it’s simply too big. But then again, even in the picture, I’m noticing there are some areas that are still a little to inclined that I’ll need to smooth out. Also as a note, I do currently have a LightmassImportanceVolume wrapping the primary area of the terrain that is visible by the player.

I do have one question, I know it was mentioned during the recent livestream what I think Epic recommends as far as each terrain section’s parameters, what is the recommended setup internally over there at Epic when you need to design a terrain?

I’ll start looking into the World Composition Tool today and I have to get back to TJ on another issue so I’ll probably start with that and if I end up with any questions later about it, we can address them tomorrow. Thanks again Tim and hope you have a great rest of the day today, take care.

Hi Matthew,

I reached out to one of our Senior Technical Artists and this was his response:

Landscape has can have so much to do
with the intended project that it is
hard to suggest a one size fits all
size.

But for most of my landscapes, I went
with a 4033x4033 resolution and that
seems to be enough to have a detailed
playable areas and some ‘vista’ space.

Using World Composition can also allow you to get better resolutions and tile your landscapes as well. You can now have them loaded in via BPs and unloaded to keep optimization up.

Feel free to ask anytime you have concerns or issues and I’ll gladly help out! :slight_smile:

Tim

p.s.

Thanks for your kind words in your Forums post in the feedback section! :slight_smile:

Thanks for the follow up Tim! And no problem on the kind words, you guys deserve it and work really hard at making the engine better. The least I could do was pay you guys that respect :wink:

If I come up with any other questions, I’ll let you know.

Take Care.

So what was the answer to this? I have the same problem on any terrain I build from World Machine and the holes seem random. I’ve seen plenty of places where the angles are just the same where I’m getting these exact random holes so it doesn’t seem to be the problem of sharp angles etc… besides this wouldn’t create these strange perfect holes like this. Something else is going on and it doesn’t happen on regularly sculpted terrain… it’s only when you import a height map and build lighting. I’ve seen others do it without this problem so why are we? As soon as I import the height map in and build lighting, it happens every single time and it’s nothing to do with the materials either from what I can tell as I’ve been round and round with every possible issue I can find with this and they are only related to blended layers within the material on the landscape etc. I’m getting this immediately after building the lighting right after importing the height map in and creating the terrain from it.

This happens even if I don’t use a lightmass volume. it is seriously annoying as I don’t want to use sculpted terrain, I want realistic terrain from a professional terrain generator. This does not happen in Unity which I just transitioned from and now I’m starting to wonder if that was a good idea seeing as how I can’t find a solution for this. I’ve only seen a few people mention this problem but there has to be a ton having the problem since it seems to be right out of the box when trying to use a heightmap for your terrain. I honestly cannot even use this engine if this is going to be the norm. But I know it’s not happening to everyone becuase I’ve seen people do tutorials on Youtube that I have followed exactly and I still get these same exact hole like artifacts scattered randomly all over the terrain. It makes no sense at all…

Could we please get some answers on what is causing this? It doesn’t matter what heightmap I use from any source, these crazy black dots always show up when I build lighting, has nothing to do with changing alpha blend layers etc. I’ve tried the obvious stuff and not so obvious. I meant to comment on this but accidentally put all the info into this exact same problem I’m having, and so are others, as an answer below. Please help it’s very discouraging not to be able to use a heightmap without getting this shadow acne of death effect. It doesn’t matter how smooth the angles are it is completely random from what I can tell.

Hey Jbgame01,

I didn’t get around to properly being able to test the World Composition Tool as Tim mentioned above if that solves this issue so you should try it and see if it helps. I personally sculpted together a prototype landscape very quickly so I could test a couple things in my game.

It seems to be a problem with Lightmass which compiles the static lighting for the scene. I tried scaling down the landscape and that didn’t help but I did it using the transform on the object which is the final calculation of scale so it’s possible the starting quad sizes were the issue and maybe you have an issue there with Lightmass not being able to compensate for the resolution. I get these holes also on flat surfaces with normals facing upward so I’m sure it’s a possibility.

You can find the documentation on the Landscape Tool here…

And I think if you dig through that, there is a page that has Epic’s recommended sizes to create your terrain from.

But if you are interested in using the World Composition Tool, you can find the documentation here… World Composition in Unreal Engine | Unreal Engine Documentation. And if you let’s use a program like World Machine or an external terrain editor, you could break your image up into tiles for importing in. This may help and Lightmass probably will be able to manage the resolution much better.

And lastly, I ended up not testing because I enabled Distance Field Raytraced Soft Shadows and started going more dynamic but haven’t had the time to address it with Lightmass. So hope this helps you out and also take from me, this is a much better engine than Unity could ever strive to be. Also I believe UE4 is still considered somewhat pre-release so early adopters are bound to have issues.

Hope this helps and good luck.

Thank you for the reply. It’s just that it doesn’t matter what heightmap I use I get this same exact problem you show in that image and you’re the only one who can verify it’s happening. I’ve seen people do this in a youtube video and they don’t have this problem; I followed it perfectly even down to the recommended landscape size like 4033x4033 or 505x505 etc. But you make the splatmap texture to be the even power of 2 like normal, 4096 x 4096 or 512 x 512 and so on.

The thing is, without even messing with materials or textures, I get this same black-dot-from-hell issue just with the default material that is applied right after you import the heightmap file on a new landscape object, click import, and then build the lighting ( lighting quality: doesn’t seem to matter which one I choose either) . It doesn’t matter if I use a lightmass volume or not either. It is always there and apparently for you too.

Here’s a video where I followed every step which is pretty straightforward and he doesn’t have any issues. I’ve even tried heightmaps from google searches, creating them from Photoshop cloud filters etc… every single time, black dots from hell…
[World Machine terrain import into UE4][1]

If I sculpt my own terrain, I never have this problem. It’s something about the height maps the engine doesn’t like unless I sculpt them within the engine myself. Could we get a confirmed workflow on this and things to avoid that would cause problems these problems? Here’s a screenshot of a quick example, it’s just a quick crappy terrain to show you I’m getting the same thing.

I know the texturing sucks and it’s blocky because it’s a small terrain and I didn’t change my texture sizes to scale correctly etc… I’ve tried the alpha blend layer trick, lightmass settings, it’s not the angles…

That’s a bummer. If you are following the tutorials step by step the way it works for others, then I’m very confused if theirs lacks the holes. Yes it definitely was an issue for me but then again I didn’t test trying anything else that Tim mentioned and simply due to time, bypassed it and went straight to enabling Distance Field Generation and Distance Field Raytraced Soft Shadows. It adds to the perf but I’m liking the results so far with outdoor environments.

Black Dots From Hell LMAO, that’s exactly something I’d say lol. Yea that’s what I felt after attempting to address resolution changes to no avail. If you think about it, if it’s due to the low resolution of the Lightmass texture and if the landmass is big, I would think there still think there should be some level of interpolation going on keeping the value above 0 when stretching it across the terrain.

I can also clearly see there are no steep inclines in your image on the areas with black holes so that’s out the window. I can actually see some almost flat areas on some of those holes.

I didn’t get a lot of time to use the tool but I will be going deep very soon after getting a new company here in LA off the ground. And at that point, I’m going for World Machine to generate the tiles that I’ll use in the later production builds.

When you import I would assume you still specify the following: # of Quads, Sections Per Component, Number Of Components, and Overall Resolution. If so, what are those initial settings you are using and also what’s the overall transform scale you have set at the moment?

But then again, sounds like you followed Epics recommendations so I’m at a loss on this one until I get more time to test it out. I’ll keep an eye out on this thread to see if you find the root cause of the problem.

I had a moment and thought about this issue some more and this could be a little out there but it’s obvious that the issue lies with Lightmass. So let’s assume since Lightmass doesn’t need the real-time reliability and thus passes off all the calculations or at least the majority off to the CPU, and does it’s pass before compiling the final asset used in the Deferred Lighting Pass, I’m guessing there is a possibility NVidia maybe implemented some form of pre-visualization pass or pre-culling that maybe even though the final rendering pass uses interpolation (linear, anisotropic, etc.) maybe the pre-culling works like a point filter does so where there is no interpolation and it could be looking at the results on a per-pixel basis and decides maybe in a simple if statement if it needs to render a specific area and if a given set of rules aren’t met then it ignores it. It’s pretty wild speculation but who knows, hopefully Tim can chime in with some feedback.

@JBGame01:

I was able to get rid of the splotches by increasing the Static Lighting LOD level.

I started by loading up World Machine and exporting one of their example maps heightmaps. Linked below

Next I imported that and used the default settings. I then scaled the map in the Z axis to be ~30.

Next I built everything on Production Lighting Quality for the first image.
Then I set the Static LOD Lighting to 5 and built (Tried different levels until this one removed the splotches)

Here is the before shot with Static Lighting LOD at Default 0:

Here is the after with the Static Lighting LOD set to 5:

I hope this helps!

Tim