summaryrefslogtreecommitdiffstats
path: root/pbr.cginc
diff options
context:
space:
mode:
Diffstat (limited to 'pbr.cginc')
-rw-r--r--pbr.cginc29
1 files changed, 14 insertions, 15 deletions
diff --git a/pbr.cginc b/pbr.cginc
index 886ee66..38b2f35 100644
--- a/pbr.cginc
+++ b/pbr.cginc
@@ -254,21 +254,6 @@ float4 getLitColor(
direct_light.color *= (1 - e);
}
-#if defined(_LTCGI)
- ltcgi_acc acc = (ltcgi_acc) 0;
- if ((bool) round(_LTCGI_Enabled)) {
- LTCGI_Contribution(
- acc,
- i.worldPos,
- normal,
- view_dir,
- GetRoughness(smoothness),
- 0);
- indirect_light.diffuse += acc.diffuse;
- indirect_light.specular += acc.specular;
- }
-#endif
-
direct_light.color = RGBtoHSV(direct_light.color);
indirect_light.specular = RGBtoHSV(indirect_light.specular);
indirect_light.diffuse = RGBtoHSV(indirect_light.diffuse);
@@ -460,6 +445,20 @@ float4 getLitColor(
#endif
#endif
+#if defined(_LTCGI)
+ ltcgi_acc acc = (ltcgi_acc) 0;
+ if ((bool) round(_LTCGI_Enabled)) {
+ LTCGI_Contribution(
+ acc,
+ i.worldPos,
+ normal,
+ view_dir,
+ GetRoughness(smoothness),
+ 0);
+ pbr.rgb += acc.diffuse + acc.specular;
+ }
+#endif
+
UNITY_APPLY_FOG(i.fogCoord, pbr.rgb);
return float4(pbr.rgb, albedo.a);