ShadowOnlyMaterial work in different way

I’m using ShadowOnlyMaterial for my job and found a bug (may be). (no shadow) (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: