Skip to content

Commit

Permalink
huh
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Feb 28, 2024
1 parent 5738831 commit 151366a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion crates/bevy_pbr/src/render/pbr_fragment.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,13 @@ fn pbr_input_from_standard_material(
let NdotV = max(dot(pbr_input.N, pbr_input.V), 0.0001);

#ifdef VERTEX_UVS
let uv_transform = pbr_bindings::material.uv_transform;
// 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,
);
var uv = (uv_transform * vec3(in.uv, 1.0)).xy;

#ifdef VERTEX_TANGENTS
Expand Down
7 changes: 6 additions & 1 deletion crates/bevy_pbr/src/render/pbr_prepass_functions.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ fn prepass_alpha_discard(in: VertexOutput) {

#ifdef VERTEX_UVS
// 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>(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,
);
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 {
output_color = output_color * textureSampleBias(pbr_bindings::base_color_texture, pbr_bindings::base_color_sampler, uv, view.mip_bias);
Expand Down

0 comments on commit 151366a

Please sign in to comment.