Is there an easy way to do that effect ?
I’m pretty sure the solution would be hard shadow cast without lighting the stuff with light that produces it. Question is can it be done easily?
Yes, but the light itself shines over the surface, what is needed is something that only blackens the area with shadow but does not brighten the visible area.
you can remove some of it by setting specular to 0,0,0 and reducing intensity https://playground.babylonjs.com/#1Z71FW#144
i don’t know if you can get rid of all the “shine” with this method
It works by computing a global shadow value: if this value is strictly less than 1, it means the pixel is at least partly in shadow and so will be displayed full black. You can change this color in line 49 if you want something a bit smoother.
Note that I have set the intensity of the point light to 0.
Out of curiosity:
Is there something, some shader include that would allow me to handle shadows for custom shader material (shadow receving not casting) quickly?
I mean i want to write my own shadow receiving material, reusing as much from StandardMaterial as possible.
You can use the CustomMaterial material if you want to extend the standard material with custom code, as I did in the PG. You can also use a node material created in the NME.
That’s strange I’ve got 4.2 on my server straight from github repo and BABYLON.CustomMaterial is undefined.
To my understanding the whole ShadowDepthWrapper thing works for defining how shadows are casted, if you have a custom material.
Not in case when you want to have shadow received on a custom one.
I’ll recheck the things with the custom material