No Description

debug.frag 807B

1234567891011121314151617181920212223242526
  1. #version 450
  2. #extension GL_ARB_separate_shader_objects : enable
  3. #extension GL_ARB_shading_language_420pack : enable
  4. layout (binding = 1) uniform sampler2D samplerPosition;
  5. layout (binding = 2) uniform sampler2D samplerNormal;
  6. layout (binding = 3) uniform sampler2D samplerAlbedo;
  7. layout (location = 0) in vec3 inUV;
  8. layout (location = 0) out vec4 outFragColor;
  9. void main()
  10. {
  11. vec3 components[3];
  12. components[0] = texture(samplerPosition, inUV.st).rgb;
  13. components[1] = texture(samplerNormal, inUV.st).rgb;
  14. components[2] = texture(samplerAlbedo, inUV.st).rgb;
  15. // Uncomment to display specular component
  16. //components[2] = vec3(texture(samplerAlbedo, inUV.st).a);
  17. // Select component depending on z coordinate of quad
  18. highp int index = int(inUV.z);
  19. outFragColor.rgb = components[index];
  20. }