adding transformations

This commit is contained in:
2024-11-13 12:17:59 +01:00
parent eaf5be3061
commit e29ea92202
18 changed files with 141 additions and 130 deletions

View File

@@ -21,8 +21,8 @@ struct ViewerData
struct SpriteData
{
color: vec4[f32],
position: vec2[f32]
model_matrix: mat4[f32],
color: vec4[f32]
}
external
@@ -34,11 +34,11 @@ external
[entry(vert)]
fn main(input: VertIn) -> VertOut
{
let position: vec4[f32] = vec4[f32](input.pos.xy + model.position, 1.0, 1.0);
let position: vec4[f32] = vec4[f32](input.pos.xy, 1.0, 1.0);
input.uv *= -1.0;
let output: VertOut;
output.uv = input.uv;
output.color = model.color;
output.pos = viewer_data.projection_matrix * position;
output.pos = viewer_data.projection_matrix * model.model_matrix * position;
return output;
}