bevy-website
bevy-website copied to clipboard
0.12 Migration: Reduce the size of MeshUniform section shader code is broken
affine_to_square
isn't even in mesh_functions
anymore. It was moved in https://github.com/bevyengine/bevy/pull/9597.
But also, it seems that you want to use mesh_functions::get_model_matrix
for this now instead, due to it handling the details of some workaround for some DX12 bug.
Relevant bit of the migration guide:
https://github.com/bevyengine/bevy-website/blob/bf681add34a6c2351674afa29cf6859fe71e2317/content/learn/migration-guides/0.11-0.12/_index.md?plain=1#L923-L933
Relevant text from Discord:
robswain — Today at 7:11 AM yes. i'd recommend doing what mesh.wgsl does (if i'm remembering the correct file)
robswain — Today at 7:12 AM https://github.com/bevyengine/bevy/blob/4852fc7578b7a55db4c05a6fb9f8ebdd290571e1/crates/bevy_pbr/src/render/mesh.wgsl#L46 https://github.com/bevyengine/bevy/blob/4852fc7578b7a55db4c05a6fb9f8ebdd290571e1/crates/bevy_pbr/src/render/mesh_functions.wgsl#L15
robswain — Today at 7:27 AM and if you want to see a bit more about what the problem with instance index is, there's a comment here: https://github.com/bevyengine/bevy/blob/main/crates/bevy_render/src/instance_index.wgsl get_model_matrix was to abstract that away and give people something simpler to use
mesh[vertex.instance_index].model
seems to show up elsewhere in the migration guide as well...