| 1 |
#version 450 |
| 2 |
|
| 3 |
layout(set = 0, binding = 0) uniform texture2D uTexture; |
| 4 |
layout(set = 0, binding = 1) uniform sampler uSampler; |
| 5 |
layout(set = 0, binding = 2) uniform samplerShadow uSamplerShadow; |
| 6 |
|
| 7 |
layout(location = 0) out float FragColor; |
| 8 |
layout(location = 0) in vec3 vUV; |
| 9 |
|
| 10 |
float sample_normal2(texture2D tex) |
| 11 |
{ |
| 12 |
return texture(sampler2D(tex, uSampler), vUV.xy).x; |
| 13 |
} |
| 14 |
|
| 15 |
float sample_normal(texture2D tex) |
| 16 |
{ |
| 17 |
return sample_normal2(tex); |
| 18 |
} |
| 19 |
|
| 20 |
float sample_comp(texture2D tex) |
| 21 |
{ |
| 22 |
return texture(sampler2DShadow(tex, uSamplerShadow), vUV); |
| 23 |
} |
| 24 |
|
| 25 |
void main() |
| 26 |
{ |
| 27 |
FragColor = sample_normal(uTexture); |
| 28 |
FragColor += sample_comp(uTexture); |
| 29 |
} |