summaryrefslogtreecommitdiffstats
path: root/pbr.cginc
diff options
context:
space:
mode:
Diffstat (limited to 'pbr.cginc')
-rw-r--r--pbr.cginc12
1 files changed, 12 insertions, 0 deletions
diff --git a/pbr.cginc b/pbr.cginc
index 68e26e9..770db07 100644
--- a/pbr.cginc
+++ b/pbr.cginc
@@ -105,6 +105,18 @@ float3 BoxProjection (
return direction;
}
+float4 getIndirectDiffuse(v2f i, float4 vertexLightColor) {
+ float4 diffuse = vertexLightColor;
+#if defined(FORWARD_BASE_PASS)
+#if defined(LIGHTMAP_ON)
+ diffuse.xyz = DecodeLightmap(UNITY_SAMPLE_TEX2D(unity_Lightmap, i.uv2));
+#else
+ diffuse.xyz += max(0, BetterSH9(float4(0, 0, 0, 1)));
+#endif
+#endif
+ return diffuse;
+}
+
float4 getIndirectDiffuse(v2f i, float4 vertexLightColor, float3 normal) {
float4 diffuse = vertexLightColor;
#if defined(FORWARD_BASE_PASS)