Any idea where to look to make shadows darker on an imported GLB. I figure it’s something to do with the material - but have toggled every toggle i can think of in the inspector and haven’t found the right one. Just wondering why the shadow is so super light on anything i import via GLB, whereas it’s dark on the ground. Will put together a PG unless someone has a quick suggestion for the property to look at? Thx!
Shadow on ground at left and then moving onto the imported GLB at right.
Just like that, I’d say it’s likely because the materials from blender are PBR by default and the ground is not. What happens is the env is lowering your shadow. I would start by making the emissive black on the material and lower directIntensity. You can also use contact hardening shadows.
@Evgeni_Popov might have a clue or a PG would be nice ?
I think @mawa must be right in that the ground must be a standard and not PBR material.
Shadows are always lighter on PBR material because you have the environment map which is adding light everywhere. You can try to use negative values for
darkness, because we clamp the value to 0 if it is negative when using the
darkness getter!). However, it’s a bit of a hack and it will also darken the shadows on the standard materials…
Ok - i was able to put together a PG:
Set toggle at top to false and you can see shadows on a regular ground:
Set toggle at top to true and it loads the GLB where you can see the shadows are just perceptible:
this.shadowGenerator._darkness = -2; (as well as other negative values), as you suggested @Evgeni_Popov, and it does make for a much nicer shadow on the GLB, but a worse shadow on the regular ground.
Is this one of those scenarios where i get it nice on one and not the other?
The ground (sand) is using a PBR material meaning that the lights have to be more powerful (check this doc: Mastering PBR Materials | Babylon.js Documentation (babylonjs.com))
So you can simply boost your light.intensity to solve your issue
Yes. That’s exactly what it is. The standard texture will process the shadow without the environment and (obviously) the PBR parameters (such as metallic, roughness, etc…).
Though, it seems your ground is now also PBR. If everything is PBR it will be less trouble to have the same shadows on all (obviously). As said, there are a number of tricks to make shadows on PBR mat look stronger. Higher the light intensity, lower the environment are the two I would start with when not using a texture. Something like this: