diff options
author | metamuffin <metamuffin@disroot.org> | 2025-01-28 15:25:50 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-01-28 15:25:50 +0100 |
commit | 58e3531cd2316e9c73b01221d68834592ad6a2ff (patch) | |
tree | 081b774c8d611d96d88b8589b92490dcc987f89a /client/src/render/shaders/vertex_world_skin.wgsl | |
parent | 3331150162e34471bf0294bdb61a1a748cb94ee5 (diff) | |
download | weareserver-58e3531cd2316e9c73b01221d68834592ad6a2ff.tar weareserver-58e3531cd2316e9c73b01221d68834592ad6a2ff.tar.bz2 weareserver-58e3531cd2316e9c73b01221d68834592ad6a2ff.tar.zst |
Little endian, tangent space handedness,
Diffstat (limited to 'client/src/render/shaders/vertex_world_skin.wgsl')
-rw-r--r-- | client/src/render/shaders/vertex_world_skin.wgsl | 10 |
1 files changed, 6 insertions, 4 deletions
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<f32>, @location(1) normal: vec3<f32>, - @location(2) tangent: vec3<f32>, // TODO maybe compress this + @location(2) tangent: vec4<f32>, // TODO maybe compress this @location(3) texcoord: vec2<f32>, @location(4) joint_index: vec4<u32>, @location(5) joint_weight: vec4<f32>, @@ -25,8 +25,9 @@ struct VertexOut { @builtin(position) clip: vec4<f32>, @location(0) normal: vec3<f32>, @location(1) tangent: vec3<f32>, - @location(2) texcoord: vec2<f32>, - @location(3) position: vec3<f32>, + @location(2) tangent_binormal_sign: f32, + @location(3) texcoord: vec2<f32>, + @location(4) position: vec3<f32>, } 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, ); |