How to adjust the lighting effect of heightmap

The following image is a ground I built using heightmap, but its lighting effect does not meet my expectations

The lighting effect I want is shown in the following picture, which looks more prominent in contrast. I don’t know how to set the lighting to achieve this effect

Here is an example of my playground
Babylon.js Playground (babylonjs.com)

It looks like lighting in second image is more occlusion that direct lighting.
idk if it can be ‘emulated’ with IBL. I did a quick try with hemisphere lighting without great success.
What do you think @PatrickRyan ?

@Kelede, I would tend to agree with @Cedric here that this does not look like direct lighting. To me this looks like a very simple custom shader. The reason being is that the lighting of faces whose normals point generally toward the camera are generally darker than those pointed away. But this lighting doesn’t seem consistent with the values you would get with something like a directional light. One of the main reasons is that the peaks of the mountains are lighter than the values of the rest of the mesh, which you won’t get with lighting.

Basically, this is how I would approach it. Choose your two base color values, one for faces whose normals point at the camera and one for those who don’t. Then take the dot product of the face normal and the view direction (or some forward direction if you want the camera to rotate around and the lighting to remain consistent) remapped to 0-1. Use this as the gradient value of an interpolation between the two colors. Then you want to add in a value based on the height map value to reach the peak color you desire. Take the maximum value you want to add and multiply it by your height map and add it to the interpolated colors.

There is a lot more you can do here, but this is the baseline I would start with and iterate upon. Hope this helps.

1 Like

Thank you for your reply. I tried using multiple light sources but couldn’t achieve this effect. I will try using the approach you provided

1 Like