| 1 |
#version 450 |
| 2 |
|
| 3 |
layout(location = 0) out float FragColor; |
| 4 |
layout(binding = 0) uniform sampler2DShadow uSampler2D; |
| 5 |
layout(binding = 1) uniform sampler2DArrayShadow uSampler2DArray; |
| 6 |
layout(binding = 2) uniform samplerCubeShadow uSamplerCube; |
| 7 |
layout(binding = 3) uniform samplerCubeArrayShadow uSamplerCubeArray; |
| 8 |
|
| 9 |
layout(location = 0) in vec3 vUVRef; |
| 10 |
layout(location = 1) in vec4 vDirRef; |
| 11 |
|
| 12 |
void main() |
| 13 |
{ |
| 14 |
float s0 = textureOffset(uSampler2D, vUVRef, ivec2(-1)); |
| 15 |
float s1 = textureOffset(uSampler2DArray, vDirRef, ivec2(-1)); |
| 16 |
float s2 = texture(uSamplerCube, vDirRef); |
| 17 |
float s3 = texture(uSamplerCubeArray, vDirRef, 0.5); |
| 18 |
|
| 19 |
float l0 = textureLodOffset(uSampler2D, vUVRef, 0.0, ivec2(-1)); |
| 20 |
float l1 = textureGradOffset(uSampler2DArray, vDirRef, vec2(0.0), vec2(0.0), ivec2(-1)); |
| 21 |
float l2 = textureGrad(uSamplerCube, vDirRef, vec3(0.0), vec3(0.0)); |
| 22 |
|
| 23 |
float p0 = textureProjOffset(uSampler2D, vDirRef, ivec2(+1)); |
| 24 |
float p1 = textureProjLodOffset(uSampler2D, vDirRef, 0.0, ivec2(+1)); |
| 25 |
|
| 26 |
FragColor = s0 + s1 + s2 + s3 + l0 + l1 + l2 + p0 + p1; |
| 27 |
} |