summaryrefslogtreecommitdiff
path: root/render/shaders
diff options
context:
space:
mode:
authorMicha White <botahamec@outlook.com>2024-08-15 20:16:32 -0400
committerMicha White <botahamec@outlook.com>2024-08-15 20:16:32 -0400
commitdb9aa9f1bf49e8bede384b9ceb1e1fb82b522799 (patch)
tree0d60727acf481f59b42ef0f74ed07c16ec562bcf /render/shaders
parentf8a80039c74332e2101a177ef3fde31ef2077224 (diff)
Delete stuff
Diffstat (limited to 'render/shaders')
-rw-r--r--render/shaders/sprite.wgsl50
1 files changed, 0 insertions, 50 deletions
diff --git a/render/shaders/sprite.wgsl b/render/shaders/sprite.wgsl
deleted file mode 100644
index 1e7f1a2..0000000
--- a/render/shaders/sprite.wgsl
+++ /dev/null
@@ -1,50 +0,0 @@
-
-@group(0) @binding(0)
-var<uniform> camera: mat4x4<f32>;
-
-struct VertexInput {
- @location(0) position: vec2<f32>
-}
-
-struct InstanceInput {
- @location(1) position: vec2<f32>,
- @location(2) size: vec2<f32>,
- @location(3) texture_coordinates: vec2<f32>,
- @location(4) texture_size: vec2<f32>,
-}
-
-struct VertexOutput {
- @builtin(position) clip_position: vec4<f32>,
- @location(0) texture_coordinates: vec2<f32>,
-}
-
-@vertex
-fn vs_main(model: VertexInput, instance: InstanceInput) -> VertexOutput {
- var out: VertexOutput;
-
- // scale the sprite
- let scaled = model.position * instance.size;
-
- // move the sprite
- let position2d = scaled + instance.position;
-
- // camera stuff
- let position4d = vec4<f32>(position2d, 0.0, 1.0);
- let position = camera * position4d;
-
- let tex_coords = vec2<f32>(model.position[0] + 0.5, 1.0 - (model.position[1] + 0.5));
-
- out.clip_position = position;
- out.texture_coordinates = tex_coords * instance.texture_size + instance.texture_coordinates;
- return out;
-}
-
-@group(1) @binding(0)
-var t_diffuse: texture_2d<f32>;
-@group(1) @binding(1)
-var s_diffuse: sampler;
-
-@fragment
-fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
- return textureSample(t_diffuse, s_diffuse, in.texture_coordinates);
-} \ No newline at end of file