Ground disappears momentarily when going towards a lit mesh

Hey,

I think this issue has to do with lights, hence the mention of the mesh being lit in the title. When I animate the camera towards this object 80 units away, there is a short time the ground disappears.
In further events activating the same animation there is no disappearing.

There are 2 more clickable machines. Each have 2 spotlights facing them (with shadow generators) and also hitting the ground.
In total there should be 8 lights affecting the ground.
I tried upping maxSimultaneousLights on all affected materials, but to no avail.

Since the disappearing hiccup doesn’t happen after travelling towards a machine once, I could also live with loading whatever is happening on that first time beforehand. I just need to know why it happens and what gets calulated.

Thanks

Looks like lit parts of the mesh also disappear shortly. Theres obviously something that has to render/compile once, so is there a way to do just that?

This probably comes from shaders recompiling Adding @Evgeni_Popov as he helped a lot with this previously :slight_smile:

Are you modifying the includedOnlyMeshes / excludedMeshes properties of the lights?

If not and if setting the number of simultaneous lights to 8 you should not have a shader recompilation when you move, the compilation should happen right at start and be ok for the whole duration of the program.

If you are able to setup a repro somewhere it would be easier to help.

3 Likes

Hey, thanks for the help.

I have some including/excluding but disabling that had no effect.

But then it dawned on me. There is a spotlight parented to one of the machines. And the machine gets disabled when another is clicked. That is the culprit of the recompilation. I wasn’t even thinking about this light, because it’s not supposed to affect ground/other machines anyway (and has no shadow generator).
When I exclude the ground from it, the ground isn’t disappearing anymore, Hurray! However the meshes of the other machines still do. Is this spotlight with an angle of 360° affecting them although it’s super far away and it’s not visibly affecting them? If that’s the case, I should then include only the meshes that are supposed to be affected for a performance boost, right? Or lower the angle? I would appreciate if you could enLIGHTen me about this :grinning:

Well, I think I won’t disable the machines at all to go about this issue. Thanks for leading me in the right direction!

Objects are not automatically removed from the area of influence of a light even if they can’t receive light from it: the computation will simply yield 0. You should indeed remove those objects from the light if you know they are not impacted by it.

1 Like