AdjustTranslucentFS.glsl 519 B

123456789101112131415161718192021222324252627
  1. #ifdef MRT
  2. layout (location = 0) out vec4 out_FragData_0;
  3. layout (location = 1) out vec4 out_FragData_1;
  4. #else
  5. layout (location = 0) out vec4 out_FragColor;
  6. #endif
  7. uniform vec4 u_bgColor;
  8. uniform sampler2D u_depthTexture;
  9. in vec2 v_textureCoordinates;
  10. void main()
  11. {
  12. if (texture(u_depthTexture, v_textureCoordinates).r < 1.0)
  13. {
  14. #ifdef MRT
  15. out_FragData_0 = u_bgColor;
  16. out_FragData_1 = vec4(u_bgColor.a);
  17. #else
  18. out_FragColor = u_bgColor;
  19. #endif
  20. return;
  21. }
  22. discard;
  23. }