rendering, physics, player and camera WIP
This commit is contained in:
28
shaders/blit.wgsl
Normal file
28
shaders/blit.wgsl
Normal file
@@ -0,0 +1,28 @@
|
||||
struct VertexInput {
|
||||
@location(0) position: vec2<f32>,
|
||||
@location(1) uv: vec2<f32>,
|
||||
}
|
||||
|
||||
struct VertexOutput {
|
||||
@builtin(position) clip_position: vec4<f32>,
|
||||
@location(0) uv: vec2<f32>,
|
||||
}
|
||||
|
||||
@group(0) @binding(0)
|
||||
var t_texture: texture_2d<f32>;
|
||||
|
||||
@group(0) @binding(1)
|
||||
var t_sampler: sampler;
|
||||
|
||||
@vertex
|
||||
fn vs_main(input: VertexInput) -> VertexOutput {
|
||||
var output: VertexOutput;
|
||||
output.clip_position = vec4<f32>(input.position, 0.0, 1.0);
|
||||
output.uv = input.uv;
|
||||
return output;
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fs_main(input: VertexOutput) -> @location(0) vec4<f32> {
|
||||
return textureSample(t_texture, t_sampler, input.uv);
|
||||
}
|
||||
Reference in New Issue
Block a user