Skip to content

Commit

Permalink
another vec3
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Feb 28, 2024
1 parent 68f194f commit 91d4dde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/bevy_pbr/src/pbr_material.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -735,6 +736,7 @@ impl AsBindGroupShaderType<StandardMaterialUniform> 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),
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions crates/bevy_pbr/src/render/pbr_types.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ struct StandardMaterial {
attenuation_color: vec4<f32>,
// uv_transform: mat3x3<f32>,
uv_transform_x: vec3<f32>,
uv_transform_y: vec3<f32>,
perceptual_roughness: f32,
metallic: f32,
reflectance: f32,
Expand Down Expand Up @@ -81,6 +82,7 @@ fn standard_material_new() -> StandardMaterial {
// scale 1, translation 0, rotation 0
// material.uv_transform = mat3x3<f32>(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
material.uv_transform_x = vec3<f32>(1.0, 0.0, 0.0);
material.uv_transform_y = vec3<f32>(0.0, 1.0, 0.0);

return material;
}
Expand Down

0 comments on commit 91d4dde

Please sign in to comment.