bevy/crates/bevy_core_pipeline/src
IceSentry 9de25ad330
Add AlphaMask2d phase (#14724)
# Objective

- Bevy now supports an opaque phase for mesh2d, but it's very common for
2d textures to have a transparent alpha channel.

## Solution

- Add an alpha mask phase identical to the one in 3d. It will do the
alpha masking in the shader before drawing the mesh.
- Uses the BinnedRenderPhase
- Since it's an opaque draw it also correctly writes to depth

## Testing

- Tested the mes2d_alpha_mode example and the bevymark example with
alpha mask mode enabled

---

## Showcase


![image](https://github.com/user-attachments/assets/9e5e4561-d0a7-4aa3-b049-d4b1247d5ed4)

The white logo on the right is rendered with alpha mask enabled.

Running the bevymark example I can get 65fps for 120k mesh2d all using
alpha mask.

## Notes

This is one more step for mesh2d improvements
https://github.com/bevyengine/bevy/issues/13265

---------

Co-authored-by: Kristoffer Søholm <k.soeholm@gmail.com>
2024-08-15 14:10:37 +00:00
..
auto_exposure Disallow empty cubic and rational curves (#14382) 2024-07-29 23:25:14 +00:00
blit Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
bloom Expose max_mip_dimension and uv_offset in BloomSettings. (#14512) 2024-08-13 15:01:42 +00:00
contrast_adaptive_sharpening Using Cas instead of CAS #14341 (#14357) 2024-07-20 18:12:24 +00:00
core_2d Add AlphaMask2d phase (#14724) 2024-08-15 14:10:37 +00:00
core_3d Don't ignore draw errors (#13240) 2024-07-22 19:22:30 +00:00
deferred Don't ignore draw errors (#13240) 2024-07-22 19:22:30 +00:00
dof Reflection for DepthOfFieldSettings (#14588) 2024-08-02 15:36:39 +00:00
fullscreen_vertex_shader Bevy Asset V2 (#8624) 2023-09-07 02:07:27 +00:00
fxaa Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +00:00
motion_blur Move Msaa to component (#14273) 2024-07-22 18:28:23 +00:00
post_process Start a built-in postprocessing stack, and implement chromatic aberration in it. (#13695) 2024-07-15 13:59:02 +00:00
prepass Don't ignore draw errors (#13240) 2024-07-22 19:22:30 +00:00
skybox Move Msaa to component (#14273) 2024-07-22 18:28:23 +00:00
smaa Fixup Msaa docs. (#14442) 2024-07-22 21:37:25 +00:00
taa Fix TAA on camera with viewport (#14582) 2024-08-07 23:59:38 +00:00
tonemapping Skip tonemapping in case it is none (#13679) 2024-06-05 11:32:46 +00:00
upscaling Set scissor on upscale to match camera viewport (#14287) 2024-07-20 16:45:04 +00:00
lib.rs Using Cas instead of CAS #14341 (#14357) 2024-07-20 18:12:24 +00:00
msaa_writeback.rs Move Msaa to component (#14273) 2024-07-22 18:28:23 +00:00