Light effect specific layer

In the Layer property of the Light object, I set the “Background” (custom)layer instead of the “World” layer, in hope it will only affect specific objects that have a “Background” layer, but it’s not.
Do I have the wrong logic or I made mistake in the process?

Hi @Dava,

No you actually got it right, a light will affect models rendered on that layer only.

If you are seeing other behavior that may be a bug. Are you able to share a sample project that reproduces the issue?

1 Like

Since Camera is not working as well ,it’s possible that i am doing something wrong
I sent you project just in case , thank you for helping me again @Leonidas

1 Like

Resolved through PMs.

Models that use custom shaders aren’t affected by lights, unless they implement their own lighting system.

If you would like to write a custom shader and continue using PlayCanvas lighting and shadows, consider overriding the material program by using shader chunks.

1 Like

Actually , it’s shader chunk

If you are able, try to create a simple sample project that reproduces the light/layer issue, as a first step.

So you can see if that’s the issue or something else.

Make sure to follow the recommended set up for meshes (and cameras): Layers | Learn PlayCanvas

Lights should be set up similarly to a camera … it should list all layers it affects.

1 Like