diff options
Diffstat (limited to 'client/src/shaders/vertex_world.wgsl')
-rw-r--r-- | client/src/shaders/vertex_world.wgsl | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/client/src/shaders/vertex_world.wgsl b/client/src/shaders/vertex_world.wgsl index d7bf445..e185289 100644 --- a/client/src/shaders/vertex_world.wgsl +++ b/client/src/shaders/vertex_world.wgsl @@ -23,26 +23,26 @@ 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>, } var<push_constant> pc: PushConst; @vertex fn main(vi: VertexIn) -> VertexOut { - let clip = pc.modelview * vec4(vi.position, 1.); + let clip = pc.modelviewproject * 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; } |