summaryrefslogtreecommitdiffstats
path: root/pbr.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2024-12-30 18:31:06 -0800
committeryum <yum.food.vr@gmail.com>2024-12-30 18:31:06 -0800
commit4880e4125f529496a48269eda545ca006db17646 (patch)
treeef0264bae58c0c1f8b2b33c1100502e75dc502a2 /pbr.cginc
parent2743c9640efcf79843b9c985e0b48dd4403fb804 (diff)
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
Diffstat (limited to 'pbr.cginc')
-rw-r--r--pbr.cginc10
1 files changed, 7 insertions, 3 deletions
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,9 +395,10 @@ 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
// Break up color banding by adding some dithering to shaded color.