summaryrefslogtreecommitdiffstats
path: root/pbr.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2024-10-09 03:44:11 -0700
committeryum <yum.food.vr@gmail.com>2024-10-09 03:44:11 -0700
commit5b0b45f9e4892c8e66f36211ebcb1039dd012b1b (patch)
tree834e5881829273ec43bf36bee808202a9d5a268d /pbr.cginc
parenta396182815db14f5a6eed26799dd425506a70686 (diff)
Add emitter texture to fog
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);