From 4880e4125f529496a48269eda545ca006db17646 Mon Sep 17 00:00:00 2001 From: yum Date: Mon, 30 Dec 2024 18:31:06 -0800 Subject: Begin adding gimmicks for downstairs map Included changes: * Update LTCGI includes * Add toggle to force world lighting * Unity fucking sucks dick and balls and doesn't set LIGHTMAP_ON consistently * Add some more sdfs for raymarching * Add separate LTCGI lighting mode for avatar vs. world --- pbr.cginc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'pbr.cginc') diff --git a/pbr.cginc b/pbr.cginc index 8dda05d..c839dcc 100644 --- a/pbr.cginc +++ b/pbr.cginc @@ -245,7 +245,8 @@ float4 getLitColor( direct_light.color *= (1 - e); } -#if 0 && defined(_LTCGI) +#if defined(_LTCGI) +#if !defined(LIGHTMAP_ON) && !defined(_FORCE_WORLD_LIGHTING) ltcgi_acc acc = (ltcgi_acc) 0; if (_LTCGI_Enabled_Dynamic) { LTCGI_Contribution( @@ -259,6 +260,7 @@ float4 getLitColor( indirect_light.specular += acc.specular; } #endif +#endif #if defined(_BRIGHTNESS_CLAMP) || defined(_PROXIMITY_DIMMING) direct_light.color = RGBtoHSV(direct_light.color); @@ -382,7 +384,8 @@ float4 getLitColor( #endif -#if 1 && defined(_LTCGI) +#if defined(_LTCGI) +#if defined(LIGHTMAP_ON) || defined(_FORCE_WORLD_LIGHTING) ltcgi_acc acc = (ltcgi_acc) 0; if (_LTCGI_Enabled_Dynamic) { LTCGI_Contribution( @@ -392,8 +395,9 @@ float4 getLitColor( view_dir, 1.0 - smoothness, i.uv2); - pbr.rgb += acc.diffuse * pbr.rgb + acc.specular; + pbr.rgb += (acc.diffuse * pbr.rgb + acc.specular) * albedo.a; } +#endif #endif // TODO formalize with parameters -- cgit v1.2.3