|
|
|
|
|
|
|
|
|
|
// Used by directional and spot lights |
|
|
|
TEXTURE2D_ARRAY(_CookieTextures); |
|
|
|
SAMPLER(sampler_CookieTextures); |
|
|
|
SAMPLER(sampler_CookieCubeTextures); |
|
|
|
SAMPLER(sampler_EnvTextures); |
|
|
|
|
|
|
|
TEXTURE2D(_DeferredShadowTexture); |
|
|
|
|
|
|
|
|
|
|
// Used by directional and spot lights. |
|
|
|
float3 SampleCookie2D(LightLoopContext lightLoopContext, float2 coord, int index) |
|
|
|
{ |
|
|
|
return SAMPLE_TEXTURE2D_ARRAY_LOD(_CookieTextures, sampler_CookieTextures, coord, index, 0).rgb; |
|
|
|
return SAMPLE_TEXTURE2D_ARRAY_LOD(_CookieTextures, s_linear_clamp_sampler, coord, index, 0).rgb; |
|
|
|
return SAMPLE_TEXTURECUBE_ARRAY_LOD_ABSTRACT(_CookieCubeTextures, sampler_CookieCubeTextures, coord, index, 0).rgb; |
|
|
|
return SAMPLE_TEXTURECUBE_ARRAY_LOD_ABSTRACT(_CookieCubeTextures, s_linear_clamp_sampler, coord, index, 0).rgb; |
|
|
|
} |
|
|
|
|
|
|
|
//----------------------------------------------------------------------------- |
|
|
|
|
|
|
// This code will be inlined as lightLoopContext is hardcoded in the light loop |
|
|
|
if (lightLoopContext.sampleReflection == SINGLE_PASS_CONTEXT_SAMPLE_REFLECTION_PROBES) |
|
|
|
{ |
|
|
|
return SAMPLE_TEXTURECUBE_ARRAY_LOD_ABSTRACT(_EnvTextures, sampler_EnvTextures, texCoord, index, lod); |
|
|
|
return SAMPLE_TEXTURECUBE_ARRAY_LOD_ABSTRACT(_EnvTextures, s_trilinear_clamp_sampler, texCoord, index, lod); |
|
|
|
} |
|
|
|
else // SINGLE_PASS_SAMPLE_SKY |
|
|
|
{ |
|
|
|