Open
Description
Bevy version
0.12.1
Relevant system information
cargo 1.74.0 (ecb9851af 2023-10-18)
Ubuntu 22.04
`AdapterInfo { name: "NVIDIA GeForce RTX 2080 Ti", vendor: 4318, device: 7684, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "535.129.03", backend: Vulkan }`
What you did
I added some PBR mesh in the examples/shader/shader_instancing.rs.
What went wrong
When I add a PBR Mesh, there is an issue where the coordinates of the instance mesh are changing.
Additional information
After several trial and error attempts, I modified 'instancing.wgsl' as follows:
// original
out.clip_position = mesh_position_local_to_clip(
get_model_matrix(0u), vec4<f32>(position, 1.0)
);
// changed
out.clip_position = mesh_position_local_to_clip(
mat4x4<f32>(
vec4<f32>(1.0, 0.0, 0.0, 0.0),
vec4<f32>(0.0, 1.0, 0.0, 0.0),
vec4<f32>(0.0, 0.0, 1.0, 0.0),
vec4<f32>(0.0, 0.0, 0.0, 1.0)
),
vec4<f32>(position, 1.0)
);
by forcing model_matrix as identity it resolved.
Modified example to reproduce this issue is here:
https://github.com/wk39/temporary/blob/4acf99b967d3f5ab678177502db71523eb0f2e59/shader_instancing.rs
Be careful. bevy version is v0.12.1
(shader_instancing.rs in latest commit has some change)