mirror of
https://github.com/bevyengine/bevy
synced 2025-02-16 14:08:32 +00:00
Fix Mesh2d normals on webgl (#10967)
# Objective A workaround for a webgl issue was introduced in #9383 but one function for mesh2d was missed. ## Solution Applied the migration guide from #9383 in `mesh2d_normal_local_to_world() Note: I'm not using normals so I have not tested the bug & fix
This commit is contained in:
parent
7a42e9de4d
commit
2b9c97d203
1 changed files with 2 additions and 2 deletions
|
@ -31,8 +31,8 @@ fn mesh2d_position_local_to_clip(model: mat4x4<f32>, vertex_position: vec4<f32>)
|
||||||
|
|
||||||
fn mesh2d_normal_local_to_world(vertex_normal: vec3<f32>, instance_index: u32) -> vec3<f32> {
|
fn mesh2d_normal_local_to_world(vertex_normal: vec3<f32>, instance_index: u32) -> vec3<f32> {
|
||||||
return mat2x4_f32_to_mat3x3_unpack(
|
return mat2x4_f32_to_mat3x3_unpack(
|
||||||
mesh[instance_index].inverse_transpose_model_a,
|
mesh[get_instance_index(instance_index)].inverse_transpose_model_a,
|
||||||
mesh[instance_index].inverse_transpose_model_b,
|
mesh[get_instance_index(instance_index)].inverse_transpose_model_b,
|
||||||
) * vertex_normal;
|
) * vertex_normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue