From 5b0b45f9e4892c8e66f36211ebcb1039dd012b1b Mon Sep 17 00:00:00 2001 From: yum Date: Wed, 9 Oct 2024 03:44:11 -0700 Subject: Add emitter texture to fog --- pbr.cginc | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'pbr.cginc') 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); -- cgit v1.2.3