summaryrefslogtreecommitdiffstats
path: root/pbr.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2024-06-15 17:49:14 -0700
committeryum <yum.food.vr@gmail.com>2024-06-15 17:49:14 -0700
commit46fab0a9c4eee236f15f35296d49d72ab4aefdb9 (patch)
tree74e7fb62147885a953c426838349a4b2664b0f73 /pbr.cginc
parent1b3623383d246be29ae9bbb7db904290f02f284a (diff)
More LTCGI tuning
Matches the visual behavior of mochie now.
Diffstat (limited to 'pbr.cginc')
-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);
}