Mesh Attribute Position: Vec<[f32;3]> vs Vec<f32> #2651
-
So I'm playing with custom Mesh creation and I noticed something odd. First I created a plane using just a
But after reading the examples for a while I noticed that
My question is if I placed an example on Gist if anyone interested. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
We need to support every possible attribute value in |
Beta Was this translation helpful? Give feedback.
We need to support every possible attribute value in
mesh::set_attribute
. The "position" attribute might expect aVec<[f32;3]>
, but the "uv" attribute expects aVec<[f32;2]>
. We acceptedVec<f32>
because that is a valid attribute type (just not the right one for "position"). That being said, this should probably be a runtime warning / error. The rendering issue is probably because the shader consuming this expects avec3
type, but the mesh is providing afloat
type. This is where the "mismatch" occurs and where the validation should happen. We should try to fix this in the upcoming renderer rework (slated to land in Bevy 0.6).