From 5b039816c803efb9cdeaaa956bbc7b8eb0764e03 Mon Sep 17 00:00:00 2001 From: gamebabyrocksun <41750362@qq.com> Date: Thu, 13 Apr 2023 09:40:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=A8=E5=AE=8F=E5=AE=9A=E4=B9=89=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E4=BA=86shader=E4=B8=AD=E7=9A=84=E5=B8=B8=E6=95=B0?= =?UTF-8?q?=EF=BC=8C=E4=BD=BF=E5=BE=97=E4=BB=A3=E7=A0=81=E8=A1=A8=E8=BE=BE?= =?UTF-8?q?=E6=84=8F=E6=80=9D=E6=9B=B4=E6=B8=85=E6=99=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Shader/0-2 GRS_PBR_Function.hlsli | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/27-IBL-With-Material-Texture/Shader/0-2 GRS_PBR_Function.hlsli b/27-IBL-With-Material-Texture/Shader/0-2 GRS_PBR_Function.hlsli index 6ca6b8b..178256a 100644 --- a/27-IBL-With-Material-Texture/Shader/0-2 GRS_PBR_Function.hlsli +++ b/27-IBL-With-Material-Texture/Shader/0-2 GRS_PBR_Function.hlsli @@ -43,9 +43,9 @@ float2 SampleSphericalMap(float3 coord) float theta = acos(coord.y); float phi = atan2(coord.x, coord.z); phi += (phi < 0) ? 2 * PI : 0; - - float u = phi * 0.1591f; - float v = theta * 0.3183f; + // to [0,1] + float u = phi * INV_TWO_PI; + float v = theta * INV_PI; return float2(u, v); } -- GitLab