bevy/crates
davier c2da7800e3 Add 2d meshes and materials (#3460)
# Objective

The current 2d rendering is specialized to render sprites, we need a generic way to render 2d items, using meshes and materials like we have for 3d.

## Solution

I cloned a good part of `bevy_pbr` into `bevy_sprite/src/mesh2d`, removed lighting and pbr itself, adapted it to 2d rendering, added a `ColorMaterial`, and modified the sprite rendering to break batches around 2d meshes.

~~The PR is a bit crude; I tried to change as little as I could in both the parts copied from 3d and the current sprite rendering to make reviewing easier. In the future, I expect we could make the sprite rendering a normal 2d material, cleanly integrated with the rest.~~ _edit: see <https://github.com/bevyengine/bevy/pull/3460#issuecomment-1003605194>_

## Remaining work

- ~~don't require mesh normals~~ _out of scope_
- ~~add an example~~ _done_
- support 2d meshes & materials in the UI?
- bikeshed names (I didn't think hard about naming, please check if it's fine)

## Remaining questions

- ~~should we add a depth buffer to 2d now that there are 2d meshes?~~ _let's revisit that when we have an opaque render phase_
- ~~should we add MSAA support to the sprites, or remove it from the 2d meshes?~~ _I added MSAA to sprites since it's really needed for 2d meshes_
- ~~how to customize vertex attributes?~~ _#3120_



Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2022-01-08 01:29:08 +00:00
..
bevy_app Bevy app docs (#3539) 2022-01-06 23:16:47 +00:00
bevy_asset Documented Handles and Assets (#3348) 2022-01-04 23:38:39 +00:00
bevy_audio Complete inline documentation for bevy_audio (#3510) 2022-01-05 22:30:15 +00:00
bevy_core Remove Bytes, FromBytes, Labels, EntityLabels. Document rest of bevy_core and enable warning on missing docs. (#3521) 2022-01-02 20:36:40 +00:00
bevy_core_pipeline Add 2d meshes and materials (#3460) 2022-01-08 01:29:08 +00:00
bevy_crevice Update nalgebra requirement from 0.29.0 to 0.30.0 (#3540) 2022-01-03 08:33:15 +00:00
bevy_derive Remove Bytes, FromBytes, Labels, EntityLabels. Document rest of bevy_core and enable warning on missing docs. (#3521) 2022-01-02 20:36:40 +00:00
bevy_diagnostic Fix doc_markdown lints in bevy_diagnostic (#3472) 2021-12-29 17:38:08 +00:00
bevy_dylib Add missing closing ticks for inline examples and some cleanup (#3573) 2022-01-07 09:25:12 +00:00
bevy_dynamic_plugin Bevy app docs (#3539) 2022-01-06 23:16:47 +00:00
bevy_ecs Add missing closing ticks for inline examples and some cleanup (#3573) 2022-01-07 09:25:12 +00:00
bevy_ecs_compile_fail_tests Fix clippy lints for 1.57 (#3238) 2021-12-02 23:40:37 +00:00
bevy_gilrs enable wasm-bindgen feature on gilrs (#3420) 2021-12-23 19:19:14 +00:00
bevy_gltf gltf loader: do not use the taskpool for only one task (#3577) 2022-01-07 07:19:22 +00:00
bevy_input Fix doc_markdown lints in bevy_input (#3475) 2021-12-29 17:38:10 +00:00
bevy_internal Added missing docs to bevy_internal and added warn on missing docs (#3514) 2022-01-01 21:22:04 +00:00
bevy_log Fix doc_markdown lints in bevy_log (#3476) 2021-12-29 17:38:11 +00:00
bevy_macro_utils Use fully-qualified type names in proc macro. (#3544) 2022-01-04 19:49:37 +00:00
bevy_math Replace old renderer with new renderer (#3312) 2021-12-14 03:58:23 +00:00
bevy_pbr Add 2d meshes and materials (#3460) 2022-01-08 01:29:08 +00:00
bevy_reflect Implement ReflectValue serialization for Duration (#3318) 2021-12-29 21:04:26 +00:00
bevy_render Add 2d meshes and materials (#3460) 2022-01-08 01:29:08 +00:00
bevy_scene Renamed Entity::new to Entity::from_raw (#3465) 2021-12-29 20:49:00 +00:00
bevy_sprite Add 2d meshes and materials (#3460) 2022-01-08 01:29:08 +00:00
bevy_tasks Fix doc_markdown lints in bevy_tasks (#3481) 2021-12-29 17:38:13 +00:00
bevy_text Add 2d meshes and materials (#3460) 2022-01-08 01:29:08 +00:00
bevy_transform Fix doc_markdown lints in bevy_transform (#3483) 2021-12-30 09:23:17 +00:00
bevy_ui Add 2d meshes and materials (#3460) 2022-01-08 01:29:08 +00:00
bevy_utils Bevy app docs (#3539) 2022-01-06 23:16:47 +00:00
bevy_window Added set_cursor_icon(...) to Window (#3395) 2021-12-20 22:04:45 +00:00
bevy_winit Added set_cursor_icon(...) to Window (#3395) 2021-12-20 22:04:45 +00:00