linebender / bevy_vello

An integration to render with Vello in Bevy game engine.
https://linebender.org/bevy_vello/
Apache License 2.0
117 stars 12 forks source link

Bridge between Bevy and Vello types #46

Open cpetzold opened 3 months ago

cpetzold commented 3 months ago

I'm wondering if this crate would be the right place to provide mappings between Bevy and Vello primitives. Being able to use Bevy's Color and math types would make it feel more integrated when using the Scene API.

simbleau commented 3 months ago

I'm a little concerned about overhead performance, personally.

We export vello,

https://github.com/loopystudios/bevy_vello/blob/d25d787f14c77533b9b038ad153847b0f13e1c46/src/lib.rs#L20

Which, vello will export peniko, kurbo, etc.

In other words:

This gives you the Vello types

How would you expect to see Bevy types be used? I'm not against it.

cpetzold commented 3 months ago

Maybe this crate isn't the right place, but I was sort of thinking something along the lines of bevy's 2d gizmo API where you're working with glam Vec2 and bevy Color. And maybe it could also take bevy math 2d primitive shapes.

simbleau commented 3 months ago

Can you give an example?

Because currently, the bevy types are used for the most part.

I think you should only need peniko, kurbo, etc.. when you build or encode a VelloScene/vello::Scene

nixon-voxell commented 3 months ago

@cpetzold Is this what you are looking for? https://github.com/nixon-voxell/bevy_motiongfx/tree/main/crates/bevy_vello_graphics