Increase shadow on ground mesh itself

I have a wave surface which I created by updating the positions of a ground mesh. To make the surface more visible I added shadows. Unfortunately the shadow effects are still very little.

I tried already to optimize light.shadowMinZ and light.position. When using light.shadow.useBlurCloseExponentialShadowMap = false the shadow is more prominent but rendered wrong.

Here is the playground:
https://www.babylonjs-playground.com/#Q1IR1D#2

I think the easiest is to only rely on shading and not shadows here as self shadowing such kind of mesh will be tricky.

Your issue is the normal generation as your ground is not updatable so it keeps the old flat normals. by adding updatable: true in the mesh creation options:
https://www.babylonjs-playground.com/#Q1IR1D#5

Also by settings bias and lighting a bit more precisely you could have self shadow:
https://www.babylonjs-playground.com/#Q1IR1D#4

1 Like

@sebavan Hey, thanks that looks great!