Hello.
I fight this problem already long time.
As we know naive z coordinate reconstruction from x and y coordinates doesn't work properly since there is a sign loss.
That is why i use cry engine approach:
The formulas are very simple:
Normal to GBufffer:
G=normalize(N.xy)*sqrt(N.z*0.5+0.5)
GBuffer to Normal:
N.z=length2(G.xy)*2-1
N.xy=normalize(G.xy)*sqrt(1-N.z*N.z)
I checked it in python and it gives very small error for normalized normal vector - 8.0e-07
But the image with this approach has visible problem. It looks like there is a cone for some reason.
You can see in the center of sphere there is a cone that has right direction.
I use RGBA16F texture format for framebuffer. There is no such artefacts if i use 3 components normal. Any ideas what can cause such strange effect?