diff options
Diffstat (limited to 'client/src/render/shaders/vertex_world.wgsl')
-rw-r--r-- | client/src/render/shaders/vertex_world.wgsl | 10 |
1 files changed, 6 insertions, 4 deletions
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<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>, } 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 { @@ -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, ); |