Lights through walls

I have an staticmeshactor, a house, with some torches in it, using point lights movables. All the illumination is dynamic. Works fine, the lights casts shadows correctly.

Then I replace the staticmeshactor by a custom actor, extended from actor.uc, with a staticmeshcomponent that is the same staticmesh used in the above example. The torches placed exactly in the same locations, all the variables related to lights and shadows the same, etc.

The lights are working in the same way with the rest of the walls, floors, etc. BUT, the pawns are being illuminated by lights through walls, The light only affects to the pawn, not to the static meshes placed in the same room.

Disabling the pawn light enviroment, the light don’t affect to the pawn… but the result is some ugly.

Placing a staticmeshactor with the same house model, in the same place that the custom actor, with hiddengame on, then works correctly.

I tried changing the custom actor properties, with tick, whitout, movable, etc.

So, I don’t know what is the difference between using a staticmeshactor and a custom actor using a staticmeshcomponent, if both has the same options for lights and shadows, and only affects to the pawns.
If the problem is the light enviroment, why is working in a different way with the two actors? Some idea to how fix this?

I’m not sure I fully understand your setup/problem but…
make sure the staticmeshcomponent has “use precomputed lighting” off - otherwise it tries to force static shadows and will ignore dynamic shadows. this variable gets activated automatically for any new or duplicated staticmeshactors in-editor

in any case characters (or any dynamic mesh) that use a LightEnvironment will expect some sort of baked lighting - this is because LightEnvironments get the localized light information from light probes which are only created when you bake lights. Dynamic LightEnvironments are supposed to gather light from dynamic lights (and can in theory update at runtime) but I don’t think they can work without some static lighting information as a base (I might be wrong)

for this reason I have disabled all the LightEnvironments in my game, since the lighting is fully dynamic and the geometry is also dynamic (procedural / spawned). I rely on a SkyLight for some ambient light information

I don’t understand too… I had bUsePrecomputedShadows set to false, as it’s suppossed to be using dynamic lights… and was that. Setting to TRUE it works fine… seems to not have any logic… but it works.

In the staticmeshactor was true by default (I only use to place the furniture, lights, etc), and then in the custom actor was set to false, as I have in all the staticmeshes on the map. Yesterday I tried changing a lot of properties, but not that one, because it must be set to false with dynamic lights… so I don’t understand.

About light enviroment, I still use it, the models looks better in the dark side, and the performance is good. I was thinking about disable it when the pawns are far, but the gain was insignificant. This is the setup I’m using:

Begin Object Class=DynamicLightEnvironmentComponent Name=MyLightEnvironment
bIsCharacterLightEnvironment=true
bSynthesizeSHLight=true
bUseBooleanEnvironmentShadowing=false
AmbientShadowColor=(R=0.0,G=0.0,B=0.0) //to avoid ambient shadow in the night (no dominant light)
End Object

Thanks for the help.

the gain might or might not be insignificant. check ‘stat dle’ and you’ll see the cpu cost of it

btw you could also try the bDynamic property in the DLE, which is what tells it to update dynamically

With 100 bots visibles, with bDynamic, 0.25 ms, without 0.18 ms. That is at 60 fps, at 120 fps is the double.

Perhaps in other machines is more significant. It’s easy to make it optional.

Also, without fps lock, 155 fps without light enviroment, and 141 fps with it. Its about 10% slower, but 100 visible bots in front the camera will not be frecuent. Anyway I think it will be optional.

I’m surprised you even get something out of the LightEnvironment in such a fully dynamic scenario.
for me enabling the LightEnvironment of a dynamic mesh produces no change unless I enable ‘character light environment’ and change the WorldInfo’s character light environment Contrast (the other 4 properties don’t change anything). perhaps it’s related to using a dominant directional light (I don’t use one)

In my case the LE makes a very noticeable difference:

The left one is using LE, and second without. I tried to achieve the same result by adjust the Skylight (upper and lower), but I can’t. The LE gives a more soft result.

I use a dominant light for the sun, but at the night is disabled, and the LE continues working in the same way.

I have the Worldinfo character light environment Contrast set to default (1.5), but changing it to other values does not change the result. Here is my setup:

The only thing that affects to the LE is the EnviromentColor and EnviromentIntensity, in Lightmass (when I’m not using it…)

weird, I’ll have to give it another try but I’m suspecting the DominantDirectionalLight is more tied to the LE than the rest of the lights. my scenes consist of a skylight and then many pointlights and spotlights, and the LE makes zero difference

ok looks like it’s really not related to the DirectionalLight
the LE color seems to come from the WorldInfo Lightmass -> Environment Color. if you change that color and disable/enable the actor’s LightEnvironment it will update the LE color
aside from that in the WorldInfo you can control the intensity (via Environment Intensity), but really no other parameter changes anything else.

I find that using a SkyLight gives you more control since you can change the Upper and Lower color and brigness, while the LightEnvironment only allows changing one global color and brightness.
While exprimenting I found that the LightEnvironment with WorldInfo -> SomeColor and 1.0 Intensity, gives me the same result as putting a SkyLight with the UpperColor = SomeColor, UpperBrightness = 1.0, LowerColor = SomeColor, LowerBrightness = 0.075

in the LE using SynthesizeSHLight gives me no result (but that’s expected, SHLight cannot be computed without Lightmass samples), and IsCharacterLightEnvironment gives me no change at all now. Only UseBooleanEnvironmentShadowing gives me a slight change in the way shadows are received.


Yeah, I did a lot of tests with the skylight, most with the lower light, but I don’t like the results, for example:

I can get the same light intensity without LE (but the enviroment is too bright then), but the appearance is different, there are areas over illuminated, the normals seems exagerated in some areas, etc. I have lights controls in the gui, so I can adjust easily in game to find the best values.And in that image you can see the best adjust that I can achieve. Luckily LE is not too expensive.