summaryrefslogtreecommitdiffstats
path: root/pbr.cginc
diff options
context:
space:
mode:
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.