fs_oit_wb_blit.sc 441 B

123456789101112131415161718
  1. $input v_texcoord0
  2. /*
  3. * Copyright 2011-2025 Branimir Karadzic. All rights reserved.
  4. * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
  5. */
  6. #include "../common/common.sh"
  7. SAMPLER2D(s_texColor0, 0);
  8. SAMPLER2D(s_texColor1, 1);
  9. void main()
  10. {
  11. vec4 accum = texture2D(s_texColor0, v_texcoord0);
  12. float opacity = texture2D(s_texColor1, v_texcoord0).x;
  13. gl_FragColor = vec4(accum.xyz / clamp(accum.w, 1e-4, 5e4), opacity);
  14. }