Skip to content

Commit

Permalink
vec3 from xy + fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Feb 28, 2024
1 parent 151366a commit 1e39cf6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions crates/bevy_pbr/src/render/pbr_fragment.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ fn pbr_input_from_standard_material(
// let uv_transform = pbr_bindings::material.uv_transform;
// let uv_transform = mat3x3<f32>(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
let uv_transform = mat3x3<f32>(
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<f32>(pbr_bindings::material.uv_transform[0].xy, 0.0),
vec3<f32>(pbr_bindings::material.uv_transform[1].xy, 0.0),
vec3<f32>(pbr_bindings::material.uv_transform[2].xy, 1.0),
);
var uv = (uv_transform * vec3(in.uv, 1.0)).xy;

Expand Down
6 changes: 3 additions & 3 deletions crates/bevy_pbr/src/render/pbr_prepass_functions.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ fn prepass_alpha_discard(in: VertexOutput) {
// let uv_transform = pbr_bindings::material.uv_transform;
// let uv_transform = mat3x3<f32>(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
let uv_transform = mat3x3<f32>(
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<f32>(pbr_bindings::material.uv_transform[0].xy, 0.0),
vec3<f32>(pbr_bindings::material.uv_transform[1].xy, 0.0),
vec3<f32>(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 {
Expand Down

0 comments on commit 1e39cf6

Please sign in to comment.