Issue with Static Lights

Hey,

i am currently trying to set all my lighting in my scene to static. as soon as i do that all of my lighting “disapears” and almost all materials go black.

Here is an ScreenShot:

BR :slight_smile:

Hi @Sinlyu,

Are you baking any lightmaps with your static light? Would you be able to provide a project link?

Are you using batching?

@eproasim i dont bake any lightmaps.
@yaustar i did use batching, and disabled it after i saw the issue, but the issue still remained.

Hmm try refreshing the tab, sometimes it gets in a state where it renders incorrectly.

Also check if the lights and models are on the same layer?

@yaustar reloading didnt help and everything should be on the same layer.

i also noticed that my drawcalls went from around 180 - 200 to around 400 - 420

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: