summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pbr.cginc8
1 files changed, 7 insertions, 1 deletions
diff --git a/pbr.cginc b/pbr.cginc
index cf1706d..b6375cc 100644
--- a/pbr.cginc
+++ b/pbr.cginc
@@ -204,8 +204,8 @@ float4 getLitColor(
}
#if defined(_LTCGI)
+ ltcgi_acc acc = (ltcgi_acc) 0;
if ((bool) round(_LTCGI_Enabled)) {
- ltcgi_acc acc = (ltcgi_acc) 0;
LTCGI_Contribution(
acc,
i.worldPos,
@@ -213,6 +213,8 @@ float4 getLitColor(
view_dir,
1.0 - smoothness,
0);
+ direct_light.color += acc.diffuse;
+ direct_light.color += acc.specular;
indirect_light.diffuse += acc.diffuse;
indirect_light.specular += acc.specular;
}
@@ -245,6 +247,10 @@ float4 getLitColor(
indirect_light).xyz;
}
+#if defined(_LTCGI)
+ pbr.rgb += (acc.specular + acc.diffuse) * metallic;
+#endif
+
return float4(pbr, albedo.a);
}