diff --git a/crates/bevy_pbr/src/pbr_material.rs b/crates/bevy_pbr/src/pbr_material.rs index e072a384e63d4..9146efa1711f8 100644 --- a/crates/bevy_pbr/src/pbr_material.rs +++ b/crates/bevy_pbr/src/pbr_material.rs @@ -599,6 +599,7 @@ pub struct StandardMaterialUniform { // /// The transform applied to the UVs corresponding to ATTRIBUTE_UV_0 on the mesh before sampling. Default is identity. // pub uv_transform: Mat3, pub uv_transform_x: Vec3, + pub uv_transform_y: Vec3, /// Linear perceptual roughness, clamped to [0.089, 1.0] in the shader /// Defaults to minimum of 0.089 pub roughness: f32, @@ -735,6 +736,7 @@ impl AsBindGroupShaderType for StandardMaterial { deferred_lighting_pass_id: self.deferred_lighting_pass_id as u32, // uv_transform: self.uv_transform.into(), uv_transform_x: self.uv_transform.x_axis.extend(0.0), + uv_transform_y: self.uv_transform.y_axis.extend(0.0), } } } diff --git a/crates/bevy_pbr/src/render/pbr_types.wgsl b/crates/bevy_pbr/src/render/pbr_types.wgsl index 9258e0d49c0bb..cdfcc277d5026 100644 --- a/crates/bevy_pbr/src/render/pbr_types.wgsl +++ b/crates/bevy_pbr/src/render/pbr_types.wgsl @@ -8,6 +8,7 @@ struct StandardMaterial { attenuation_color: vec4, // uv_transform: mat3x3, uv_transform_x: vec3, + uv_transform_y: vec3, perceptual_roughness: f32, metallic: f32, reflectance: f32, @@ -81,6 +82,7 @@ fn standard_material_new() -> StandardMaterial { // scale 1, translation 0, rotation 0 // material.uv_transform = mat3x3(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0); material.uv_transform_x = vec3(1.0, 0.0, 0.0); + material.uv_transform_y = vec3(0.0, 1.0, 0.0); return material; }