Hi!
I am creating an engine on XNA 4.0 that utilizes deferred shading technique. My GBuffer is 4 R8G8B8A8 textures for Albedo, Depth, Normals and Lights, where Normals were stored like R - N.x, G - N.y, B - N.z. I was dissatisfied with the quality of my specular highlights, especially when I saw how they look when normals are stored with 16 bit precision so I started searching for other techniques. Right now I settled on CryEngine2 technique of Spheremap Transforms that stores only N.x and N.y and reconstructs N.z. Here is the link to the PPt file:
http://www.crytek.com/sites/default/files/A_bit_more_deferred_-_CryEngine3.ppt
I did it just like the slide #13 suggests and everything looks awesome, though a little different from the original approach, but I am in doubt whether I did it correctly. The problem is, their formula of normals deconstruction has this part: "N.z = length2(G.xy)" and I don't know what length2 means. I simply used "length(G.xy)" there and gave the formula a float2 vector (G.xy), just like in the slide. Is that correct? I also tried "length (G.x - G.y)" and it gives a totally different result.
Would be grateful for any advise/link.
Thanks!