Vertex Shader: How to recalculate surface normals for correct light mapping??

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Macryc

Hi. Does anyone know how to recalculate normals in vertex shader using central differences, as explained here but with a noise that is an image (not generated in shader code)?

I have a grid mesh with a vertex shader for terrain displacement but the shadows are all wrong because the base mesh’s normals are all pointing up. I need the normals recalculated. Please help…