From 58e3531cd2316e9c73b01221d68834592ad6a2ff Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 28 Jan 2025 15:25:50 +0100 Subject: Little endian, tangent space handedness, --- client/src/render/shaders/vertex_world.wgsl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'client/src/render/shaders/vertex_world.wgsl') diff --git a/client/src/render/shaders/vertex_world.wgsl b/client/src/render/shaders/vertex_world.wgsl index 4f342fd..3cce989 100644 --- a/client/src/render/shaders/vertex_world.wgsl +++ b/client/src/render/shaders/vertex_world.wgsl @@ -16,15 +16,16 @@ struct VertexIn { @location(0) position: vec3, @location(1) normal: vec3, - @location(2) tangent: vec3, // TODO maybe compress this + @location(2) tangent: vec4, // TODO maybe compress this @location(3) texcoord: vec2, } struct VertexOut { @builtin(position) clip: vec4, @location(0) normal: vec3, @location(1) tangent: vec3, - @location(2) texcoord: vec2, - @location(3) position: vec3, + @location(2) tangent_binormal_sign: f32, + @location(3) texcoord: vec2, + @location(4) position: vec3, } struct PushConst { @@ -40,7 +41,8 @@ fn main(vi: VertexIn) -> VertexOut { let vo = VertexOut( clip, normalize((pc.model * vec4(vi.normal, 0.)).xyz), - normalize((pc.model * vec4(vi.tangent, 0.)).xyz), + normalize((pc.model * vec4(vi.tangent.xyz, 0.)).xyz), + vi.tangent.w, vi.texcoord, (pc.model * vec4(vi.position, 1.)).xyz, ); -- cgit v1.2.3-70-g09d2