diff options
| author | yum <yum.food.vr@gmail.com> | 2025-03-31 21:50:39 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-03-31 21:50:39 -0700 |
| commit | 2dfd6322587eb095a5a4f7b22d70e1abcc14d5e3 (patch) | |
| tree | 76b6f84628e07c722b74ce58b34e70d672e9541d /yum_lighting.cginc | |
| parent | 3f1915bbd0e6176e625c484cf24a460cc88bfeac (diff) | |
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.
Diffstat (limited to 'yum_lighting.cginc')
| -rw-r--r-- | yum_lighting.cginc | 6 |
1 files changed, 1 insertions, 5 deletions
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.
|
