Skip to content

Commit e5cee74

Browse files
committed
render: Fix vertex shader positions
1 parent 2d3063a commit e5cee74

File tree

9 files changed

+18
-18
lines changed

9 files changed

+18
-18
lines changed

render/wgpu/shaders/blend/alpha.wgsl

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ struct VertexOutput {
1212

1313
@vertex
1414
fn main_vertex(in: common__VertexInput) -> VertexOutput {
15-
let pos = common__globals.view_matrix * transforms.world_matrix * vec4<f32>(in.position.x, in.position.y, 1.0, 1.0);
16-
let uv = vec2<f32>((pos.x + 1.0) / 2.0, -((pos.y - 1.0) / 2.0));
15+
let pos = common__globals.view_matrix * transforms.world_matrix * vec4<f32>(in.position.x, in.position.y, 0.0, 1.0);
16+
let uv = vec2<f32>(in.position.xy);
1717
return VertexOutput(pos, uv);
1818
}
1919

render/wgpu/shaders/blend/darken.wgsl

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ struct VertexOutput {
1212

1313
@vertex
1414
fn main_vertex(in: common__VertexInput) -> VertexOutput {
15-
let pos = common__globals.view_matrix * transforms.world_matrix * vec4<f32>(in.position.x, in.position.y, 1.0, 1.0);
16-
let uv = vec2<f32>((pos.x + 1.0) / 2.0, -((pos.y - 1.0) / 2.0));
15+
let pos = common__globals.view_matrix * transforms.world_matrix * vec4<f32>(in.position.x, in.position.y, 0.0, 1.0);
16+
let uv = vec2<f32>(in.position.xy);
1717
return VertexOutput(pos, uv);
1818
}
1919

render/wgpu/shaders/blend/difference.wgsl

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ struct VertexOutput {
1212

1313
@vertex
1414
fn main_vertex(in: common__VertexInput) -> VertexOutput {
15-
let pos = common__globals.view_matrix * transforms.world_matrix * vec4<f32>(in.position.x, in.position.y, 1.0, 1.0);
16-
let uv = vec2<f32>((pos.x + 1.0) / 2.0, -((pos.y - 1.0) / 2.0));
15+
let pos = common__globals.view_matrix * transforms.world_matrix * vec4<f32>(in.position.x, in.position.y, 0.0, 1.0);
16+
let uv = vec2<f32>(in.position.xy);
1717
return VertexOutput(pos, uv);
1818
}
1919

render/wgpu/shaders/blend/erase.wgsl

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ struct VertexOutput {
1212

1313
@vertex
1414
fn main_vertex(in: common__VertexInput) -> VertexOutput {
15-
let pos = common__globals.view_matrix * transforms.world_matrix * vec4<f32>(in.position.x, in.position.y, 1.0, 1.0);
16-
let uv = vec2<f32>((pos.x + 1.0) / 2.0, -((pos.y - 1.0) / 2.0));
15+
let pos = common__globals.view_matrix * transforms.world_matrix * vec4<f32>(in.position.x, in.position.y, 0.0, 1.0);
16+
let uv = vec2<f32>(in.position.xy);
1717
return VertexOutput(pos, uv);
1818
}
1919

render/wgpu/shaders/blend/hardlight.wgsl

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ struct VertexOutput {
1212

1313
@vertex
1414
fn main_vertex(in: common__VertexInput) -> VertexOutput {
15-
let pos = common__globals.view_matrix * transforms.world_matrix * vec4<f32>(in.position.x, in.position.y, 1.0, 1.0);
16-
let uv = vec2<f32>((pos.x + 1.0) / 2.0, -((pos.y - 1.0) / 2.0));
15+
let pos = common__globals.view_matrix * transforms.world_matrix * vec4<f32>(in.position.x, in.position.y, 0.0, 1.0);
16+
let uv = vec2<f32>(in.position.xy);
1717
return VertexOutput(pos, uv);
1818
}
1919

render/wgpu/shaders/blend/invert.wgsl

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ struct VertexOutput {
1212

1313
@vertex
1414
fn main_vertex(in: common__VertexInput) -> VertexOutput {
15-
let pos = common__globals.view_matrix * transforms.world_matrix * vec4<f32>(in.position.x, in.position.y, 1.0, 1.0);
16-
let uv = vec2<f32>((pos.x + 1.0) / 2.0, -((pos.y - 1.0) / 2.0));
15+
let pos = common__globals.view_matrix * transforms.world_matrix * vec4<f32>(in.position.x, in.position.y, 0.0, 1.0);
16+
let uv = vec2<f32>(in.position.xy);
1717
return VertexOutput(pos, uv);
1818
}
1919

render/wgpu/shaders/blend/lighten.wgsl

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ struct VertexOutput {
1212

1313
@vertex
1414
fn main_vertex(in: common__VertexInput) -> VertexOutput {
15-
let pos = common__globals.view_matrix * transforms.world_matrix * vec4<f32>(in.position.x, in.position.y, 1.0, 1.0);
16-
let uv = vec2<f32>((pos.x + 1.0) / 2.0, -((pos.y - 1.0) / 2.0));
15+
let pos = common__globals.view_matrix * transforms.world_matrix * vec4<f32>(in.position.x, in.position.y, 0.0, 1.0);
16+
let uv = vec2<f32>(in.position.xy);
1717
return VertexOutput(pos, uv);
1818
}
1919

render/wgpu/shaders/blend/multiply.wgsl

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ struct VertexOutput {
1212

1313
@vertex
1414
fn main_vertex(in: common__VertexInput) -> VertexOutput {
15-
let pos = common__globals.view_matrix * transforms.world_matrix * vec4<f32>(in.position.x, in.position.y, 1.0, 1.0);
16-
let uv = vec2<f32>((pos.x + 1.0) / 2.0, -((pos.y - 1.0) / 2.0));
15+
let pos = common__globals.view_matrix * transforms.world_matrix * vec4<f32>(in.position.x, in.position.y, 0.0, 1.0);
16+
let uv = vec2<f32>(in.position.xy);
1717
return VertexOutput(pos, uv);
1818
}
1919

render/wgpu/shaders/blend/overlay.wgsl

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ struct VertexOutput {
1212

1313
@vertex
1414
fn main_vertex(in: common__VertexInput) -> VertexOutput {
15-
let pos = common__globals.view_matrix * transforms.world_matrix * vec4<f32>(in.position.x, in.position.y, 1.0, 1.0);
16-
let uv = vec2<f32>((pos.x + 1.0) / 2.0, -((pos.y - 1.0) / 2.0));
15+
let pos = common__globals.view_matrix * transforms.world_matrix * vec4<f32>(in.position.x, in.position.y, 0.0, 1.0);
16+
let uv = vec2<f32>(in.position.xy);
1717
return VertexOutput(pos, uv);
1818
}
1919

0 commit comments

Comments
 (0)