Description
What problem does this solve or what need does it fill?
I'm doing 2D vector graph rendering and don't need uv/normals (basically what bevy_lyon_prototype
is doing now), but need a material for masking. Before the recent material rework with #5053 and #5312 , a custom pipeline would suffice. After the new material system is landed, I think I could use a custom material, and take advantage of the SpecializeMeshPipelines<Material2dPipeline<CustomMaterial>>
instead of manually copy all the code of them just to remove uv/normal vertex data. Because the new Material2dPipeline is quite different and contains a lot of new code, copy-pasting them seems so dumb.
But the problem is, Material2dPipeline<M>
wraps a Mesh2dPipeline
, which currently asks for vertex position, uv, normals to create the default layout. If any of the 3 is missing, an error is returned, which makes Material2dPipeline::<M>::specialize
to return before calling M::specialize
, which makes my approach fail. Code here
What solution would you like?
I think maybe Material2dPipeline could just log the error and continue, at least call M::specialize()
? Currently the error is propagated to SpecializedMeshPipelines
and is also logged. So I think this is tolerable?
What alternative(s) have you considered?
- Rethink the whole thing about specialization and make it even easier to customize everything.
- Make
Mesh2dPipeline
accept optional uv / normal.
Additional context
N/A