AdjustTranslucentFS.glsl 418 B

123456789101112131415161718192021222324
  1. #ifdef MRT
  2. #extension GL_EXT_draw_buffers : enable
  3. #endif
  4. uniform vec4 u_bgColor;
  5. uniform sampler2D u_depthTexture;
  6. varying vec2 v_textureCoordinates;
  7. void main()
  8. {
  9. if (texture2D(u_depthTexture, v_textureCoordinates).r < 1.0)
  10. {
  11. #ifdef MRT
  12. gl_FragData[0] = u_bgColor;
  13. gl_FragData[1] = vec4(u_bgColor.a);
  14. #else
  15. gl_FragColor = u_bgColor;
  16. #endif
  17. return;
  18. }
  19. discard;
  20. }