From 1e39cf6788ce3c4cd04223807a4ed27e129a9e2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Wed, 28 Feb 2024 22:44:52 +0100 Subject: [PATCH] vec3 from xy + fixed --- crates/bevy_pbr/src/render/pbr_fragment.wgsl | 6 +++--- crates/bevy_pbr/src/render/pbr_prepass_functions.wgsl | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/bevy_pbr/src/render/pbr_fragment.wgsl b/crates/bevy_pbr/src/render/pbr_fragment.wgsl index bf10f33702672..2918d0ca521dc 100644 --- a/crates/bevy_pbr/src/render/pbr_fragment.wgsl +++ b/crates/bevy_pbr/src/render/pbr_fragment.wgsl @@ -76,9 +76,9 @@ fn pbr_input_from_standard_material( // let uv_transform = pbr_bindings::material.uv_transform; // let uv_transform = mat3x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0); let uv_transform = mat3x3( - pbr_bindings::material.uv_transform[0].x, pbr_bindings::material.uv_transform[0].y, 0.0, - pbr_bindings::material.uv_transform[1].x, pbr_bindings::material.uv_transform[1].y, 0.0, - pbr_bindings::material.uv_transform[2].x, pbr_bindings::material.uv_transform[2].y, 1.0, + vec3(pbr_bindings::material.uv_transform[0].xy, 0.0), + vec3(pbr_bindings::material.uv_transform[1].xy, 0.0), + vec3(pbr_bindings::material.uv_transform[2].xy, 1.0), ); var uv = (uv_transform * vec3(in.uv, 1.0)).xy; diff --git a/crates/bevy_pbr/src/render/pbr_prepass_functions.wgsl b/crates/bevy_pbr/src/render/pbr_prepass_functions.wgsl index 2dfd8d7bc5e41..9c28d259da20d 100644 --- a/crates/bevy_pbr/src/render/pbr_prepass_functions.wgsl +++ b/crates/bevy_pbr/src/render/pbr_prepass_functions.wgsl @@ -21,9 +21,9 @@ fn prepass_alpha_discard(in: VertexOutput) { // let uv_transform = pbr_bindings::material.uv_transform; // let uv_transform = mat3x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0); let uv_transform = mat3x3( - pbr_bindings::material.uv_transform[0].x, pbr_bindings::material.uv_transform[0].y, 0.0, - pbr_bindings::material.uv_transform[1].x, pbr_bindings::material.uv_transform[1].y, 0.0, - pbr_bindings::material.uv_transform[2].x, pbr_bindings::material.uv_transform[2].y, 1.0, + vec3(pbr_bindings::material.uv_transform[0].xy, 0.0), + vec3(pbr_bindings::material.uv_transform[1].xy, 0.0), + vec3(pbr_bindings::material.uv_transform[2].xy, 1.0), ); let uv = (uv_transform * vec3(in.uv, 1.0)).xy; if (pbr_bindings::material.flags & pbr_types::STANDARD_MATERIAL_FLAGS_BASE_COLOR_TEXTURE_BIT) != 0u {