ShadowOnlyMaterial work in different way

Hi,there.
I’m using ShadowOnlyMaterial for my job and found a bug (may be).

https://playground.babylonjs.com/#N43T8H#2 (no shadow)

https://playground.babylonjs.com/#N43T8H#3 (shadow ok)

the above two links has the same code , what the different is code order.

HemisphericLight first then the DirectionalLight , the shadow is miss.
DirectionalLight first then the HemisphericLight, the shadow is ok.

I think this is a bug, but may be some rules i havn’t read.

thank you

By default, ShadowOnlyMaterial takes the first created light to generate shadows. If the light doesn’t support shadows (like hemispherical lights), you won’t have any shadow. You can use the activeLight property to specifically choose the light that ShadowOnlyMaterial should use: