From 2dfd6322587eb095a5a4f7b22d70e1abcc14d5e3 Mon Sep 17 00:00:00 2001 From: yum Date: Mon, 31 Mar 2025 21:50:39 -0700 Subject: Overhaul wrapped lighting Now: * k=0 -> lambertian * k=0.5 -> half lambertian * k=1.0 -> flat All three points should be energy conserving, but I haven't done the actual analysis yet. --- yum_lighting.cginc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'yum_lighting.cginc') diff --git a/yum_lighting.cginc b/yum_lighting.cginc index 5e627d5..3af5654 100644 --- a/yum_lighting.cginc +++ b/yum_lighting.cginc @@ -202,11 +202,7 @@ YumLighting GetYumLighting(v2f i, YumPbr pbr) { // normalize has no visibile impact in test scene light.view_dir = -i.eyeVec.xyz; -#if defined(POINT) || defined(POINT_COOKIE) || defined(SPOT) - light.dir = normalize((_WorldSpaceLightPos0 - i.worldPos).xyz); -#else - light.dir = _WorldSpaceLightPos0; -#endif + light.dir = getDirectLightDirection(i); light.direct = _LightColor0.rgb; // TODO filament's spherical harmonics look nicer than this. -- cgit v1.2.3