Hi all.
I am working on a software which creates planetary textures.
I am computing the planetary normals in HLSL (I am heavily using shader programming).
I compute my normals in a surface shader as follows:
float3 normal = float3(
heightLongitudeDelta * _NormalScale,
heightLatitudeDelta * _NormalScale,
1);
This goes into o.Normal on a Surface Shader.
Problem is, when I compute the normals like that, the result in the sphere is:

Looks good, right? But then, I navigate to the other side of the sphere, and what I have is this:

Do you see how all the rivers now look like veins? Their normals are inverted on the other side of the sphere.
How do I properly calculate normals for a spherical surface within HLSL?