|
|
|
|
|
|
uint cacheType = index & 1; |
|
|
|
index = index >> 1; |
|
|
|
|
|
|
|
float4 color = float4(0.0, 0.0, 0.0, 1.0); |
|
|
|
|
|
|
|
// This code will be inlined as lightLoopContext is hardcoded in the light loop |
|
|
|
if (lightLoopContext.sampleReflection == SINGLE_PASS_CONTEXT_SAMPLE_REFLECTION_PROBES) |
|
|
|
{ |
|
|
|
|
|
|
ndc *= rcp(ndc.w); |
|
|
|
ndc.xy = ndc.xy * 0.5 + 0.5; |
|
|
|
|
|
|
|
float4 color = SAMPLE_TEXTURE2D_ARRAY_LOD(_Env2DTextures, s_trilinear_clamp_sampler, ndc.xy, index, 0); |
|
|
|
color.a = any(ndc.xyz < 0) || any(ndc.xyz > 1) ? 0 : 1; |
|
|
|
color.rgb = SAMPLE_TEXTURE2D_ARRAY_LOD(_Env2DTextures, s_trilinear_clamp_sampler, ndc.xy, index, 0).rgb; |
|
|
|
color.a = any(ndc.xyz < 0) || any(ndc.xyz > 1) ? 0.0 : 1.0; |
|
|
|
return float4(ndc.xy, 0, color.a); |
|
|
|
color = float4(ndc.xy, 0, color.a); |
|
|
|
return color; |
|
|
|
float4 color = SAMPLE_TEXTURECUBE_ARRAY_LOD_ABSTRACT(_EnvCubemapTextures, s_trilinear_clamp_sampler, texCoord, index, lod); |
|
|
|
color.a = 1; |
|
|
|
color.rgb = SAMPLE_TEXTURECUBE_ARRAY_LOD_ABSTRACT(_EnvCubemapTextures, s_trilinear_clamp_sampler, texCoord, index, lod).rgb; |
|
|
|
return float4(texCoord.xyz * 0.5 + 0.5, color.a); |
|
|
|
color = float4(texCoord.xyz * 0.5 + 0.5, color.a); |
|
|
|
return color; |
|
|
|
return float4(0, 0, 0, 0); |
|
|
|
return SampleSkyTexture(texCoord, lod); |
|
|
|
color.rgb = SampleSkyTexture(texCoord, lod).rgb; |
|
|
|
|
|
|
|
return color; |
|
|
|
} |
|
|
|
|
|
|
|
//----------------------------------------------------------------------------- |
|
|
|