mirror of
https://github.com/lisk77/comet.git
synced 2025-12-12 17:18:50 +00:00
feat(renderer): rewrote the core of the Renderer2D as a temporary module
This commit is contained in:
parent
ae9918c9b9
commit
f8dabf955e
4 changed files with 313 additions and 3 deletions
25
crates/comet_renderer/src/renderer2d_/base.wgsl
Normal file
25
crates/comet_renderer/src/renderer2d_/base.wgsl
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
struct VertexInput {
|
||||
@location(0) position: vec3<f32>,
|
||||
@location(1) tex_coords: vec2<f32>,
|
||||
@location(2) color: vec4<f32>,
|
||||
}
|
||||
|
||||
struct VertexOutput {
|
||||
@builtin(position) clip_position: vec4<f32>,
|
||||
@location(0) tex_coords: vec2<f32>,
|
||||
@location(1) color: vec4<f32>,
|
||||
}
|
||||
|
||||
@vertex
|
||||
fn vs_main(input: VertexInput) -> VertexOutput {
|
||||
var out: VertexOutput;
|
||||
out.clip_position = vec4(input.position, 1.0);
|
||||
out.tex_coords = input.tex_coords;
|
||||
out.color = input.color;
|
||||
return out;
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
|
||||
return in.color;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue