|
|
|
|
|
|
TEXTURECUBE_ARRAY(_CookieCubeTextures); |
|
|
|
SAMPLERCUBE(sampler_CookieCubeTextures); |
|
|
|
|
|
|
|
// Use texture array for reflection |
|
|
|
// Use texture array for reflection (or LatLong 2D array for mobile) |
|
|
|
#ifdef CUBE_ARRAY_NOT_SUPPORTED |
|
|
|
TEXTURE2D_ARRAY(_EnvTextures); |
|
|
|
SAMPLER2D(sampler_EnvTextures); |
|
|
|
#else |
|
|
|
#endif |
|
|
|
|
|
|
|
TEXTURECUBE(_SkyTexture); |
|
|
|
SAMPLERCUBE(sampler_SkyTexture); // NOTE: Sampler could be share here with _EnvTextures. Don't know if the shader compiler will complain... |
|
|
|
|
|
|
// This code will be inlined as lightLoopContext is hardcoded in the light loop |
|
|
|
if (lightLoopContext.sampleReflection == SINGLE_PASS_CONTEXT_SAMPLE_REFLECTION_PROBES) |
|
|
|
{ |
|
|
|
#ifdef CUBE_ARRAY_NOT_SUPPORTED |
|
|
|
return SAMPLE_TEXTURE2D_ARRAY_LOD(_EnvTextures, sampler_EnvTextures, DirectionToLatLongCoordinate(texCoord), index, lod); |
|
|
|
#else |
|
|
|
#endif |
|
|
|
} |
|
|
|
else // SINGLE_PASS_SAMPLE_SKY |
|
|
|
{ |
|
|
|