Recalculate polygon normals in the shader in Unreal Engine

General / 06 December 2020

if you ever find yourself in a situation where you need to recalculate normals after displacing your mesh within the vertex shader. e.g. in conjunction with tesselation, there is a way to do this with the "normal from height" node

(I deactivated shadows on this object to show the effect more clearly)

it can be solved like this
note that you turn off tangent space normals in the main shader properties.

However the normals are then facetted

in order to get smoothed normals, you can use the "NormalFromHeight" node

the lower the normal offset, the higher you need to set the normal intensity.