[SOLVED] Issues with Lightmass

This is in the docs for Lightmass Global Illumination:

" Distance field shadow maps maintain their curvy shape very well even under lower resolutions; however they do not support area shadowing or translucent shadows…With Lightmass, all lights with Static Mobility are area lights by default."

So, if the mobility of the lights is static in that scene, it’s casting area shadows, which aren’t supported by Distance Field Shadow Maps (DFSMs). If DFSMs are disabled in the directional light, they still have settings in World Settings…which could be altered to correct the problematic shadow(s). That is one idea.

Another idea has to do with the static lighting level scale. According to the experts and experienced, it’s suggested to lower it to get more accurate lighting / shadowing, especially for smaller scale meshes and details. However, that may be a catch-22 in this case because lowering it, or perhaps maintaining it at 1 (default), in combination with certain other settings (not sure which) and the shadowmap resolution, produces the inverse result expected. IOW, it’s supposed to enhance detail and get sharp shadows rendered, but it’s conflicting with other data in shadows / light in the scene, resulting in distortions. I suggest increasing it to 2, or 1.5 at least, and then modifying shadow bias settings and if there’s any reflection captures in the scene, lowering their influence radius and placing them closer to where they’re pivotal to the result. I read in the docs and in forum posts about reflection captures, that having huge reflection captures can distort lighting and thus shadowing, similar to how they distort reflection images. It’s probably not the sole causal factor in the distorted shadow, but could be one involved in the problem. With a level scale lower, it’s probably trying to account for a smaller level of detail, so the approximations are finer in detail than would be at a larger level scale. Make any sense?

Note: I also read in the docs that reflection captures’ influence radius should not be intersecting geometry, not just walls/ceilings/floors. If the scene is fully static lighting (no stationary or movable lights at all), then it could be better to use capture cubes to render reflections. That’s especially if the geometry is mostly square / rectangular in design.

@Bits360 You missed his previous post. He said he had it set to a default of 1024, after it was at default 64.

Presto423 is correct. I did tick the option when I tried overriding the resolution :slight_smile:

I haven’t actively disabled/enabled distance field shadow maps. I’ll investigate this once I’m back at my workstation.

I like how you ask if this makes any sense :D. This is somewhat jumble to me, but I’ll research further and see if I can make any sense of what you’re saying.

I do have reflection spheres in my scene, but nowhere near the storage rack that I’m focusing on at the moment. I’ll look at the rest of the scene once I have the sotrage rack problem solved. One problem at a time :slight_smile:

I don’t know whether this is relevant or not, when talking Lightmass, but my light is not static: it’s stationary. I want the light to affect static assets as well as moveable assets. I’ve read that static light is ONLY for Lightmass, whereas stationary is for Lightmass as well as moveable assets. Did I get something wrong here? could this perhaps be the culprit?

“…that static light is ONLY for Lightmass, whereas stationary is for Lightmass as well as moveable assets. Did I get something wrong here? could this perhaps be the culprit?”

It could be. I’ve had issues switching from one to another, even if it’s only one light I changed from movable to stationary, or static to stationary. According to the popup of the stationary option on a light, indirect lighting and shadowing is baked into a lightmap while direct lighting / shadowing is dynamic. So, after the first bounce of light from the light (the direct portion), the lighting / shadowing is not dynamic and cannot change at run-time because it’s in a lightmap. Hence, only having 3 bounces of indirect lighting might mean it is not sufficiently applying to the lightmap to get a correct shadow. When looking at the Lightmass Global Illumination doc page, it shows a scene pre-indirect, and then after 1, 2, and 4 bounces. The results after 1 and 2 bounces show somewhat undeveloped shadows, and low quality of resolution in shadows, whereas after bounce 4 it’s looking fine. That’s with static though, as far as I recall, not stationary.

So, if the first casting of light is dynamic, and the rest are static Lightmass maps, then isn’t it mixing the two and could result in incoherent shadows / light? I think so. There is little in the docs in terms of how the two work together, and how to get best results for different scenarios. There’s more information and guidance on static-only lighting than mixed or fully dynamic. It’s why I attempt to hypothesize and test different settings in combination to understand how things are working within it all. It’s a slow approach, but potentially faster than strictly trying to get answers in the forums. Another aspect that is not often discussed is the volumetric lightmap, which is used whether there’s all static, all stationary, or all movable lights and objects, or a mix. It takes samples from Lightmass and other lighting information, and interpolates it across the volumetric map, where near surfaces and areas of greater shadow/light detail it contains more samples. The visualization of it shows a 3D grid of spheres, and so closer to surfaces and areas of greater detail the grid is denser with more spheres per cubic unit. That itself could easily be something that causes mis-shaped shadows and incorrect lighting if samples aren’t interpolated correctly or something.

Wrong again: static lights CAN affect movable assets!! :S This is the reason for volumetric lightmaps…
…the rest is too long to read…

What happens for the sake of simplicity: set everything to static, override the lightmap either in the mesh’s properties or in the details tab and build your light in medium quality: anything has changed?

I’m not sure. I’ll try it once I’m back at my workstation and post the results here.

Doesn’t seem to make any difference. The results are still the same.

Could you upload your scene somewhere by any chance?

I hope I’m not being to picky, but I’d rather not upload my entire scene. Sorry. I do really appreciate the help though :slight_smile:

I just tried making a fresh project from the empty template. When baking lighting, this is the result I’m getting:

new-proj-res.JPG

This seems to look alright considering it’s preview quality. I tried setting the exact same values on my atmospheric fog, as well as the directional light. Still getting bad results in my project.
This seems pretty strange to me. I must have some different setting somewhere.

Sure thing! …I thought all you have in your scene is this mesh…
Yeah that wouldv’e been my next advise: to start a fresh new project… this looks totally perfect to me…
I’m sure you’ve just clicked or inlclicked some settings (or many! :S)… tuning things… who knows! :wink:

Yeah I think you might be right. I managed to click on SOMETHING that messed this up. Now to investigate exactly what it was. I think I’ll delete the assets and reimport with same settings as the new project. We’ll see how this turns out then.

Okay, so I managed to find my issue. At this moment, I no longer know whether to cry or laugh…

So under General Settings in the static mesh editor, if you press the little arrow down, you get to set the Light Map Coordinate Index. This was set to 0 (my texture uv) and NOT 1 (my lightmap uv). I just changed it from 0 to 1 as that’s where my lightmap is located, build the lighting, and now everything seems to look perfect.

I really appreciate the time you put into helping me solve this issue guys. Thank you very much!

…that’s strange because you were setting the resolution to 1024 so even if you had a very bad lightmap laid on 0, when setting higher you should’ve seen the change…
well…

No it does make sense. I’m using a texture atlas so the UV on index 0 is veeeeery small.