Met a Shadow Problem

Hi everyone:
I met some problem about shadow:

The shadow is weird that make my clothes became darker & shadow looks like wrong when calculate…

I use this PG’s code to generate shadow, the codes in PG look like not thing wrong…


Hi @Zcating

This might be because your geometry is double sided. ping @sebavan

In close exponential mode you need to set your light minZ and maxZ as close as hou can from the model.

Self shadowing being really not forgiving on the setup you could try to play with PCF / bias / normalBias as well to obtain some better results.

Hi, @Cedric:
I have set single side as following:

It obviously show back side, but I can’t find some mesh’s API which can set the side.
My loading model function is as following:

const mesh = new BABYLON.Mesh('mesh', scene);
const geometry = new BABYLON.Geometry('geometry', scene, vertexes, undefined, mesh);
// mesh.material = material;
// mesh.material.backFaceCulling = false;
// mesh.material.sideOrientation = BABYLON.Mesh.DOUBLESIDE;
mesh.receiveShadows = true;
return mesh;

Hello, @sebavan, thx for helping & reminding it. I will test these API.

I make a PG to show how I build the model.