From b4aaaae52b3b746a5e1ef8a98151c627f2787e38 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 24 Jan 2025 18:25:25 +0100 Subject: fix things up but no light --- client/src/shaders/vertex_world.wgsl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'client/src/shaders/vertex_world.wgsl') 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, @location(0) normal: vec3, @location(1) tangent: vec3, - @location(2) world: vec3, - @location(3) texcoord: vec2, + @location(2) texcoord: vec2, + @location(3) position: vec3, } struct PushConst { + modelviewproject: mat4x4, modelview: mat4x4, - model_basis: mat3x3, } var 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; } -- cgit v1.2.3-70-g09d2