From 46fab0a9c4eee236f15f35296d49d72ab4aefdb9 Mon Sep 17 00:00:00 2001 From: yum Date: Sat, 15 Jun 2024 17:49:14 -0700 Subject: More LTCGI tuning Matches the visual behavior of mochie now. --- pbr.cginc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); } -- cgit v1.2.3