A game about forced loneliness, made by TACStudios
1#ifndef UNITY_COMMON_SHADOW_INCLUDED
2#define UNITY_COMMON_SHADOW_INCLUDED
3
4// Ref: https://mynameismjp.wordpress.com/2015/02/18/shadow-sample-update/
5// Calculates the offset to use for sampling the shadow map, based on the surface normal
6real3 GetShadowPosOffset(real NdotL, real3 normalWS, real2 invShadowMapSize)
7{
8 real texelSize = 2.0 * invShadowMapSize.x;
9 real offsetScaleNormalize = saturate(1.0 - NdotL);
10 // return texelSize * OffsetScale * offsetScaleNormalize * normalWS;
11 return texelSize * offsetScaleNormalize * normalWS;
12}
13
14#endif // UNITY_COMMON_SHADOW_INCLUDED