Files
nunuhara_xsystem4/shaders
kichikuou 484f383826 Parts: fix multiply/screen draw_filter to respect alpha
The multiply and screen blend functions used in render_flat_item
ignored the source alpha, so transparent pixels still modulated the
destination color instead of leaving it untouched.

Add a draw_filter uniform to the parts fragment shader and have it
output an alpha-baked source color, so that the framebuffer result
after the GL blend equation interpolates correctly in alpha:

- multiply: shader outputs src = mix(vec3(1.0), mod_color, alpha)
  blend (GL_DST_COLOR, GL_ZERO) gives src*dst,
  i.e. mix(dst, mod_color*dst, alpha)
- screen: shader outputs src = mod_color * alpha
  blend (GL_ONE, GL_ONE_MINUS_SRC_COLOR) gives src + (1-src)*dst,
  i.e. mod_color*alpha + (1 - mod_color*alpha)*dst

In both cases alpha=0 leaves the destination untouched, alpha=1
gives the full multiply/screen result.

Also switch the surface-area mask from multiplication to discard,
so pixels outside the rect leave the destination intact under
multiply blending (where multiplying src by 0 would otherwise
zero out dst).
2026-05-03 12:39:41 +09:00
..
2025-03-23 08:22:16 +09:00
2021-06-20 17:12:35 +09:00
2026-02-24 08:38:45 +09:00
2021-06-20 17:12:35 +09:00
2021-06-20 17:12:35 +09:00
2021-06-20 17:12:35 +09:00
2021-06-20 17:12:35 +09:00
2021-06-20 17:12:35 +09:00
2021-06-20 17:12:35 +09:00
2021-06-20 17:12:35 +09:00
2026-04-26 10:03:09 +09:00
2026-04-26 10:03:09 +09:00
2025-09-09 09:19:38 +09:00