Issue with Static Lights

Hmm… I can’t replicate your black materials issue in a new project: https://playcanvas.com/editor/scene/1122796

Does it still happen if you use a new default material?

I think i found the issue, our Materials dont use “useSkybox”, non static lights do work fine, but as soon i enable the static property and the useSkybox flag is false, the material goes black.

Interesting that I’m not getting the same result with useSkybox disabled: https://playcanvas.com/editor/scene/1122796

Edit: Does the light have Affect Dynamic disabled?

Yea, it is disabled on most of the lights. But turning it on and off dosent do anything in that case.

That is the issue I believe. It’s a not great named property. If disabled, it doesn’t ‘light’ up any non lightmapped models

It will need to be enabled unless the entities are lightmapped.

Edit: Just read that enabling it doesn’t seem to change anything :thinking:

2 Likes

I’m at a lost if that’s not the issue either then :confounded:

Well i just turned it off and on for all lights and reloaded the editor. that worked!

Ah, nice that reloading the editor helped :sweat_smile:

@yaustar Ohh, i forgot to enable static. after enabling that, its all back agian.

@yaustar i added you to the project, if you want to take a look.

Looks like it’s related to using non directional lights like Spot.

Issue created for this: https://github.com/playcanvas/engine/issues/3052

1 Like

we have similar issue opened with some details on why the number of draw calls is increased

on the separate note, we’re working on different lighting solution which might replace / solve this in the future https://github.com/playcanvas/engine/pull/2990 - but that’s still way off to be done.

1 Like

@mvaligursky Thank you for the info.
@yaustar Thank you for your time and help :slight_smile:

Just wanted to check if there was any movement on this. I have a set of static lights and geometry, but what’s weird is that the first time the scene is loaded, the static lights light the area correctly, but after leaving the scene and returning. They no longer work.

do your static lights need shadows? If not, you could use clustered lights instead … that’s where we’re heading with the engine - but the shadows are still missing there.

Hi @mvaligursky,

Unfortunately, yes. The Static lights produce shadows. Any ideas why it works the first time the scene is loaded?

Nope, no ideas … I have not worked on that part of the code base … it’d need some investigation. Would you have a simple repro we could use?

Unfortunately I’m a bit strained for time today as I try to work through some issues with the project. I will do my best to get one tomorrow.

1 Like

Hi @mvaligursky,

Here is a repro: https://playcanvas.com/editor/scene/1194604

Use Spacebar to change scenes. Scene1 has dynamic lights and geometry, while Scene2 is static. You will see that the first time Scene 2 is loaded the lights are rendered, but every subsequent return to the scene does not render the static lights.

Before I changed Scene1 to be dynamic, and had both of them static, I noticed that after loading Scene1 all of the Static lights would stop working even when Scene2 was loaded for the first time.

It makes me wonder if something is clearing the list of static lights array/object at the app level and never repopulating it.

I hope this is helpful!

2 Likes

Thanks, I’ll have a look when I get some time. I created an issue for it here:

3 Likes