From 1cfb30faea60169c7b9cb3a08610247047d8a639 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Thu, 2 Jan 2020 21:40:48 +0800 Subject: [PATCH] update Spheremap Transform algorithm --- SpheremapNormal.cpp | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/SpheremapNormal.cpp b/SpheremapNormal.cpp index c0d8914..ddcc795 100644 --- a/SpheremapNormal.cpp +++ b/SpheremapNormal.cpp @@ -6,7 +6,7 @@ Normal to GBufffer: - G=normalize(N.xy)*sqrt(N.z*0.5+0.5) + G=normalize(N.xy)*sqrt(-N.z*0.5+0.5) GBuffer to Normal: @@ -19,7 +19,7 @@ namespace hgl void normal_compress(uint8 *x,uint8 *y,const uint8 *rgb,const uint count) { Vector3f in; - Vector2f in_xy; + float f; Vector2f out; for(uint i=0;i