SVG Asset Support
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- rust
- Ambito
- computer-graphics
Direzione di ricerca
The issue outlines four stages: start with exr_texture_loader.rs in bevy_image and the ktx2_buffer_to_image implementation in ktx2.rs. First identify the existing asset loader and image mipmap patterns, then choose one stage and check its scope with the maintainers. Done means completing a stage's stated behavior and its relevant checks; the full issue also includes vector assets, UI raster caching, and Feathers integration.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What problem does this solve or what need does it fill?
SVGs are a highly requested format for UI and 2D graphics. We should support them first-party with a particular emphasis on supporting pixel perfect rendering in UI.
We're going to use resvg as a cpu backend and implement two asset types; svg files loaded as Image Assets that can be used anywhere, and svg files loaded as Svg assets that can be used in UI.
Progressive implementation
Adding svg to support to bevy in four stages:
1. Minimal .svg -> Image at fixed size
Users can load svgs as images, but they rasterize at a single fixed size.
- Add an
svgfeature, likepng. Currently ony enabled in feathers - Add
SvgLoader(type Asset = Image) inbevy_image(see exr_texture_loader.rs for an example) - Use
resvgwithdefault-features = false(no text, no system fonts, no raster images, no svgz) -
asset_server.load("icon.svg")should work inImageNode,Sprite, anywhere an Image works.
2. Mip chain rasterizing
Svg image assets get mipmapping with reasonable defaults.
- Render the svgs at some fixed sizes and mipmap them
(Reference ktx2_buffer_to_image implementation in ktx2.rs) - OK looking svgs at multiple sizes.
3. Vector assets + Raster cache
Users can load svgs as svg assets, which can be rasterized to exact sizes.
-
Add an
Svgasset type andSvgAssetLoader- This holds the parsed tree in memory and allows consumers to request rasterizations
- Grabbing sections of the svg should be available too--ex using node_by_id to raster a specific node
-
Add a
SvgRasterCacheresource to hold a map from raster settings, assetid, and size to raster results. -
UI component that holds an svg handle and, after determining size, requests new rasters.
-
Use screen dpi
-
Pixel perfect svgs in UI!!
Edge cases Re-rasterizing on frequent size changes could be CPU intensive. This probably isn't an issue for our feathers use case.
4. Use SVGs in Feathers
Open svg workflow up to designers.
- Replace existing .pngs with svg sources
- Update
ThemedIconbehavior - svgs are in feathers!
Currently Out of Scope
- Swappable backends, GPU backend
- Build time baking with
LoadTransformAndSaveso games using svg image assets can ship withoutresvg DynamicTextureAtlasBuildersupport- Svg
<text>with bevy_text fonts - Svg window icons https://github.com/bevyengine/bevy/pull/21259
- Svg custom cursors
- SDF / MSDF
- Embedded images and hrefs,
.svgz
- Lingua principale
- Rust
- Stelle
- 50k
- Fork
- 5.1k
- Merge medio
- 2g 20h
- PR unite (30g)
- 129
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di bevyengine/bevy
-
C-Bug S-Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
bevyengine/bevy#26718 ·
I maintainer di solito rispondono entro 2 giorni
-
C-Bug S-Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
bevyengine/bevy#26689 ·
I maintainer di solito rispondono entro 2 giorni
-
Volumetric fog: a `FogVolume` with `Visibility::Hidden` is still renderedForse già presa @adityawrk l’ha presa 2 giorni fa. ApertaC-Bug S-Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
bevyengine/bevy#26688 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
bevyengine/bevy#26684 ·
I maintainer di solito rispondono entro 2 giorni
-
Create a bevy_fuzzy exampleForse già presa @Tatsuya0330 l’ha presa 1 giorno fa. ApertaA-UI C-Examples C-Feature D-Straightforward S-Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
bevyengine/bevy#26676 ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di bevyengine/bevy
Issue simili
-
area:ui effort:medium enhancement P7 source:agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
marketing
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
machine rename accepts a label already used by another machine, making --machine <label> ambiguousApertamaintainer-needed p2 remote triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug help wanted ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
userFRM/egui-charts#4605 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno