summaryrefslogtreecommitdiffstats
path: root/pbr.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2024-04-25 15:52:24 -0700
committeryum <yum.food.vr@gmail.com>2024-04-25 15:52:24 -0700
commit6eed98ff4e57326ebf7a41f0c180635a7bcac626 (patch)
tree67f5e269bafb49608cab8a6b22534d83fd09b58b /pbr.cginc
parentb9671b47df8b17fa3143d4b0dbdecf9b77cc7607 (diff)
Add LTCGI
Also begin trying to fix fallback shaders.
Diffstat (limited to 'pbr.cginc')
-rw-r--r--pbr.cginc6
1 files changed, 6 insertions, 0 deletions
diff --git a/pbr.cginc b/pbr.cginc
index 182c1ff..a699a53 100644
--- a/pbr.cginc
+++ b/pbr.cginc
@@ -57,7 +57,13 @@ UnityIndirect CreateIndirectLight(float4 vertexLightColor, float3 view_dir, floa
indirect.specular = 0;
#if defined(FORWARD_BASE_PASS)
+
+#if defined(LIGHTMAP_ON)
+ // Avatars are not static, don't use lightmap.
+ indirect.diffuse = 0;
+#else
indirect.diffuse += max(0, ShadeSH9(float4(normal, 1)));
+#endif
float3 reflect_dir = reflect(-view_dir, normal);
Unity_GlossyEnvironmentData env_data;
env_data.roughness = GetRoughness(smoothness);