summaryrefslogtreecommitdiff
path: root/client/src/shaders/vertex_world_skin.wgsl
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/shaders/vertex_world_skin.wgsl')
-rw-r--r--client/src/shaders/vertex_world_skin.wgsl14
1 files changed, 7 insertions, 7 deletions
diff --git a/client/src/shaders/vertex_world_skin.wgsl b/client/src/shaders/vertex_world_skin.wgsl
index 4b45a6f..633f06b 100644
--- a/client/src/shaders/vertex_world_skin.wgsl
+++ b/client/src/shaders/vertex_world_skin.wgsl
@@ -25,13 +25,13 @@ struct VertexOut {
@builtin(position) clip: vec4<f32>,
@location(0) normal: vec3<f32>,
@location(1) tangent: vec3<f32>,
- @location(2) world: vec3<f32>,
- @location(3) texcoord: vec2<f32>,
+ @location(2) texcoord: vec2<f32>,
+ @location(3) position: vec3<f32>,
}
struct PushConst {
+ modelviewproject: mat4x4<f32>,
modelview: mat4x4<f32>,
- model_basis: mat3x3<f32>,
}
@group(3) @binding(0) var<uniform> joints: array<mat4x4<f32>, 128>;
@@ -42,10 +42,10 @@ fn main(vi: VertexIn) -> VertexOut {
let clip = pc.modelview * 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;
}