|
|
|
|
|
|
SAMPLER2D(sampler_CookieTextures); |
|
|
|
|
|
|
|
// Used by point lights |
|
|
|
#ifdef UNITY_NO_CUBEMAP_ARRAY |
|
|
|
TEXTURE2D_ARRAY(_CookieCubeTextures); |
|
|
|
SAMPLER2D(sampler_CookieCubeTextures); |
|
|
|
#else |
|
|
|
TEXTURECUBE_ARRAY(_CookieCubeTextures); |
|
|
|
SAMPLERCUBE(sampler_CookieCubeTextures); |
|
|
|
#endif |
|
|
|
TEXTURECUBE_ARRAY_ABSTRACT(_CookieCubeTextures); |
|
|
|
SAMPLERCUBE_ABSTRACT(sampler_CookieCubeTextures); |
|
|
|
#ifdef UNITY_NO_CUBEMAP_ARRAY |
|
|
|
TEXTURE2D_ARRAY(_EnvTextures); |
|
|
|
SAMPLER2D(sampler_EnvTextures); |
|
|
|
#else |
|
|
|
TEXTURECUBE_ARRAY(_EnvTextures); |
|
|
|
SAMPLERCUBE(sampler_EnvTextures); |
|
|
|
#endif |
|
|
|
TEXTURECUBE_ARRAY_ABSTRACT(_EnvTextures); |
|
|
|
SAMPLERCUBE_ABSTRACT(sampler_EnvTextures); |
|
|
|
|
|
|
|
TEXTURECUBE(_SkyTexture); |
|
|
|
SAMPLERCUBE(sampler_SkyTexture); // NOTE: Sampler could be share here with _EnvTextures. Don't know if the shader compiler will complain... |
|
|
|
|
|
|
// Returns the color in the RGB components, and the transparency (lack of occlusion) in A. |
|
|
|
float4 SampleCookieCube(LightLoopContext lightLoopContext, float3 coord, int index) |
|
|
|
{ |
|
|
|
#ifdef UNITY_NO_CUBEMAP_ARRAY |
|
|
|
return SAMPLE_TEXTURE2D_ARRAY_LOD(_CookieCubeTextures, sampler_CookieCubeTextures, DirectionToLatLongCoordinate(coord), index, 0); |
|
|
|
#else |
|
|
|
return SAMPLE_TEXTURECUBE_ARRAY_LOD(_CookieCubeTextures, sampler_CookieCubeTextures, coord, index, 0); |
|
|
|
#endif |
|
|
|
return SAMPLE_TEXTURECUBE_ARRAY_LOD_ABSTRACT(_CookieCubeTextures, sampler_CookieCubeTextures, coord, index, 0); |
|
|
|
} |
|
|
|
|
|
|
|
//----------------------------------------------------------------------------- |
|
|
|
|
|
|
// This code will be inlined as lightLoopContext is hardcoded in the light loop |
|
|
|
if (lightLoopContext.sampleReflection == SINGLE_PASS_CONTEXT_SAMPLE_REFLECTION_PROBES) |
|
|
|
{ |
|
|
|
#ifdef UNITY_NO_CUBEMAP_ARRAY |
|
|
|
return SAMPLE_TEXTURE2D_ARRAY_LOD(_EnvTextures, sampler_EnvTextures, DirectionToLatLongCoordinate(texCoord), index, lod); |
|
|
|
#else |
|
|
|
return SAMPLE_TEXTURECUBE_ARRAY_LOD(_EnvTextures, sampler_EnvTextures, texCoord, index, lod); |
|
|
|
#endif |
|
|
|
return SAMPLE_TEXTURECUBE_ARRAY_LOD_ABSTRACT(_EnvTextures, sampler_EnvTextures, texCoord, index, lod); |
|
|
|
} |
|
|
|
else // SINGLE_PASS_SAMPLE_SKY |
|
|
|
{ |
|
|
|