This can't be done via a Vertex Shader (although you could generate it via the Pixel / Fragment Shader as a World-Object Normal Transformed to a World-View-Projected Normal Map.
Now you can do Normal Calculation one of two ways.
Either:
a) within a Mesh Memblock when you're creating the initial Mesh
b) within a Geometry / Hull Shader (but AFAIK only AppGameKit Studio Supports that without a 3rd Party Plug-In)
Calculating Surface Normals is fairly simple though
Type Triangle_Type
Verts As Vector3_Type[3]
Normal As Vector3_Type
EndType
Type Vector3_Type
x As Float
y As Float
z As Float
EndType
Function VectorSub( Ref In As Vector3_Type, A As Vector3_Type, B As Vector3_Type )
In.x = A.x - B.x
In.y = A.y - B.y
In.z = A.z - B.z
EndFunction
Function CalculateSurfaceNormal( Ref Triangle As Triangle_Type )
Local U As Vector3_Type
Local V As Vector3_Type
VectorSub( U, Triangle.Verts[2], Triangle.Verts[1] )
VectorSub( V, Triangle.Verts[3], Triangle.Verts[1] )
Triangle.Normal.x = (U.y * V.z) - (U.z * V.y)
Triangle.Normal.y = (U.z * V.x) - (U.x * V.z)
Triangle.Normal.z = (U.x * V.y) - (U.y * V.x)
EndFunction