-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
UV of Float32x3 causes GPU buffer issue in 0.6.0 (works fine in 0.5.0) #3604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Nice find. This also killed my voxel renderer! |
Same issue occurs if UV attribute does not exist. |
…rly. Issue was caused by bevyengine/bevy#3604
Same issue occurs if TANGENT attribute is not a vec4 |
should be fixed by #3959 |
Kind of sort of. That enables flexible layouts, but it also standardizes the formats of specific vertex attributes. Users are free to create a new "three dimensional" UV attribute and use that in their custom shaders with custom meshes. They can even use that in our built in shaders (provided they also provide a 2d UV attribute). But we cant (and won't) allow using three dimensional uvs in places where our core shaders expect two dimensional uvs. Same goes for all of the "core" vertex attributes defined on Mesh. |
I guess "can't" and "won't" are strong words. I'm open to discussing solutions to specific scenarios. |
Bevy version
Release 0.6.0
Operating system & version
Tested: Windows 10, MacOS 12.1
What you did
Follow duplication steps in https://github.com/WAFFO/bevy_0.6.0_mesh_issue
I originally ran into this issue migrating my project and encountered a computer killing monster where my heightmap mesh once was. (Pictured below)
This was OS breaking, and I had to hold my power button to escape.
What you expected to happen
To draw a flat square made of two triangles, 4 vertices. (Pictured: 0.5.0)

What actually happened
One triangle, standing. (Pictured: Same mesh code in 0.6.0)

Additional information
If the mesh is really big (like for a heightmap) my computer comes to a halt and I have to hold the power button to reset. I suspect something is not aligned in the GPU buffer.
The Culprit!
It's this line here: https://github.com/WAFFO/bevy_0.6.0_mesh_issue/blob/v6/src/main.rs#L83
Change it from a
[f32; 3]
to a[f32; 2]
And now it works perfectly!
This shouldn't be allowed to happen :(
It took a long time for me to figure out why my mesh was breaking in 0.6.0.
Since it worked in 0.5.0, I have to ask if it's intended for
[f32; 3]
to not work for the UV attribute. If so, a type check or some error is needed. Otherwise, it's a bug!The text was updated successfully, but these errors were encountered: