|
|
|
|
|
|
float2 cookieUV = mul(_WorldToLight, float4(worldPos, 1.0)).xy; |
|
|
|
return tex2D(_MainLightCookie, cookieUV).a; |
|
|
|
#elif defined(_MAIN_SPOT_LIGHT) |
|
|
|
float3 projPos = mul(_WorldToLight, float4(worldPos, 1.0)).xyz; |
|
|
|
float4 projPos = mul(_WorldToLight, float4(worldPos, 1.0)); |
|
|
|
float2 cookieUV = projPos.xy / projPos.w + 0.5; |
|
|
|
return tex2D(_MainLightCookie, cookieUV).a; |
|
|
|
#endif // POINT LIGHT cookie not supported |
|
|
|