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_skin.wgsl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'client/src/render/shaders/vertex_world_skin.wgsl') diff --git a/client/src/render/shaders/vertex_world_skin.wgsl b/client/src/render/shaders/vertex_world_skin.wgsl index 6e2b308..2188cf4 100644 --- a/client/src/render/shaders/vertex_world_skin.wgsl +++ b/client/src/render/shaders/vertex_world_skin.wgsl @@ -16,7 +16,7 @@ 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, @location(4) joint_index: vec4, @location(5) joint_weight: vec4, @@ -25,8 +25,9 @@ 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 { @@ -50,7 +51,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