Download

How to set point lights to not cast dynamic shadows on pawns, but cast shadows for everything else?

By setting a LightEnvironment object on each of my pawn skeletal mesh components has always allowed them to cast shadows from DominantDirectionalLights, but not from normal PointLights.

I’ve never really known why this is, but it’s what I want regardless.

However recently I’ve seen players on streams where their pawns are casting shadows from point lights (which causes a mess of shadows when there are lots of lights).

So how do it prevent point lights casting shadows on pawns (but still cast shadows for everything else)?

Have you tried to modify this?
LightAffectsClassification=LAC_DYNAMIC_AND_STATIC_AFFECTING
LightingChannels=(BSP=TRUE,Static=TRUE,Dynamic=TRUE,CompositeDynamic=TRUE,bInitialized=TRUE)

In my case they work fine with the lightenviroment, only a shadow is proyected, from the dominant light, or from one pointlight if no dominant is active.

I disable the dominant light in the night, so the point lights can cast shadows on the pawns. Only one.

But disabling the lightenviroment, all the point lighs casts shadows. It’s more realistic, but very expensive in performance.

Thanks for the input @CobaltUDK. The issue I’m having was since my last update. I added a moon during the night cycles, which uses a separate dominant directional light component. When the sun sets, I disable the main dominant directional light and then enable the one for the moon.

The issue seems fairly rare, but i’ve seen several streams (and had reports) where all the the pawns start casting shadows from all point lights. It’s as if the light environment component on their meshes becomes disabled. I’m yet to be able to reproduce it on dev machine.

You can see the exact moment it happens in this stream at 3:04:05: LINK

It seems that this would be around the time that the moon ddl would turn on. But why would that break the light environment for all the pawn skeletal mesh components? You can also see that the female character’s skin tone also changes (which also indicates that something has broken with the light environment).

Aha, I had a problem similar when the dominant light was enabled, an aditional vertical dark shadow appeared for each pawn.

It was resolved doing a lightcomponent.forceupdate(true) for each unhidden pawn, each time the dominant light was enabled or disabled.

Thank you! :pray: That sounds exactly like the problem I’ve been experiencing.

1 Like