summaryrefslogtreecommitdiff
path: root/client/src/shaders/vertex_world.wgsl
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-01-24 18:25:25 +0100
committermetamuffin <metamuffin@disroot.org>2025-01-24 18:25:25 +0100
commitb4aaaae52b3b746a5e1ef8a98151c627f2787e38 (patch)
tree397eee51c86670f46947d94838c36f57c320f3d7 /client/src/shaders/vertex_world.wgsl
parentce82f40bc4bd03963390d2c95ec688fccc4740b0 (diff)
downloadweareserver-b4aaaae52b3b746a5e1ef8a98151c627f2787e38.tar
weareserver-b4aaaae52b3b746a5e1ef8a98151c627f2787e38.tar.bz2
weareserver-b4aaaae52b3b746a5e1ef8a98151c627f2787e38.tar.zst
fix things up but no light
Diffstat (limited to 'client/src/shaders/vertex_world.wgsl')
-rw-r--r--client/src/shaders/vertex_world.wgsl16
1 files changed, 8 insertions, 8 deletions
diff --git a/client/src/shaders/vertex_world.wgsl b/client/src/shaders/vertex_world.wgsl
index d7bf445..e185289 100644
--- a/client/src/shaders/vertex_world.wgsl
+++ b/client/src/shaders/vertex_world.wgsl
@@ -23,26 +23,26 @@ struct VertexOut {
@builtin(position) clip: vec4<f32>,
@location(0) normal: vec3<f32>,
@location(1) tangent: vec3<f32>,
- @location(2) world: vec3<f32>,
- @location(3) texcoord: vec2<f32>,
+ @location(2) texcoord: vec2<f32>,
+ @location(3) position: vec3<f32>,
}
struct PushConst {
+ modelviewproject: mat4x4<f32>,
modelview: mat4x4<f32>,
- model_basis: mat3x3<f32>,
}
var<push_constant> pc: PushConst;
@vertex
fn main(vi: VertexIn) -> VertexOut {
- let clip = pc.modelview * vec4(vi.position, 1.);
+ let clip = pc.modelviewproject * vec4(vi.position, 1.);
let vo = VertexOut(
clip,
- normalize(pc.model_basis * vi.normal),
- normalize(pc.model_basis * vi.tangent),
- vi.position
- vi.texcoord
+ normalize((pc.modelview * vec4(vi.normal, 0.)).xyz),
+ normalize((pc.modelview * vec4(vi.tangent, 0.)).xyz),
+ vi.texcoord,
+ (pc.modelview * vec4(vi.position, 1.)).xyz,
);
return vo;
}