I have 2d sprite using PBR material and affected by spotlight, but not affected by shadow from other meshes

const material = new PBRMaterial(“spritePBRMat”, scene);

material.albedoTexture = spriteTexture;

material.albedoColor = new Color3(2, 2, 2);

material.albedoTexture.hasAlpha = true;

material.useAlphaFromAlbedoTexture = true;

material.directIntensity = 9;

material.roughness = 0;

material.metallic = 0.0;

material.disableLighting = false;

material.backFaceCulling = true;

material.usePhysicalLightFalloff = false

material.transparencyMode = PBRMaterial.PBRMATERIAL_ALPHABLEND;

plane.material = material;

plane.billboardMode = Mesh.BILLBOARDMODE_ALL;

Note: if I added plane.receiveShadows = true; then the light is no longer affecting this sprite, I found out that when I dont use albedoTexture, just albedoColor it works great light and shadows, is this the limitation of babylonjs, or I missed something

TIA

Hello and welcome!

Can you create a Playground example please?

However at first glance I suppose since your plane is in billboard mode (it always faces the camera) it just can’t recieve the shadows correctly.

Hi, thanks for answering, I thought so, so I was testing it by using without albedoTexture, and it works perfectly. About the playground, since I new at this babylonjs, maybe I need sometime to create it (figure it out how to attach sprite etc)

This could probably help Babylon.js docs

Thanks @sebavan