Reorganising file and module structure.
This commit is contained in:
parent
a4fb422b83
commit
e59e340777
12 changed files with 662 additions and 511 deletions
0
src/assets/script.lua
Normal file
0
src/assets/script.lua
Normal file
19
src/assets/shader.wgsl
Normal file
19
src/assets/shader.wgsl
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
struct VertexOutput {
|
||||
@builtin(position) clip_position: vec4<f32>,
|
||||
};
|
||||
|
||||
@vertex
|
||||
fn vs_main(
|
||||
@builtin(vertex_index) in_vertex_index: u32,
|
||||
) -> VertexOutput {
|
||||
var out: VertexOutput;
|
||||
let x = f32(1 - i32(in_vertex_index)) * 0.5;
|
||||
let y = f32(i32(in_vertex_index & 1u) * 2 - 1) * 0.5;
|
||||
out.clip_position = vec4<f32>(x, y, 0.0, 1.0);
|
||||
return out;
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
|
||||
return vec4<f32>(0.3, 0.2, 0.1, 1.0);
|
||||
}
|
||||
21
src/assets/shader2.wgsl
Normal file
21
src/assets/shader2.wgsl
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
struct VertexOutput {
|
||||
@builtin(position) clip_position: vec4<f32>,
|
||||
@location(0) color: vec4<f32>
|
||||
};
|
||||
|
||||
@vertex
|
||||
fn vs_main(
|
||||
@builtin(vertex_index) in_vertex_index: u32,
|
||||
) -> VertexOutput {
|
||||
var out: VertexOutput;
|
||||
let x = f32(1 - i32(in_vertex_index)) * 0.5;
|
||||
let y = f32(i32(in_vertex_index & 1u) * 2 - 1) * 0.5;
|
||||
out.clip_position = vec4<f32>(x, y, 0.0, 1.0);
|
||||
out.color = vec4<f32>(0.3,x,y,1.0);
|
||||
return out;
|
||||
}
|
||||
|
||||
@fragment
|
||||
fn fs_main(@location(0) col: vec4<f32>) -> @location(0) vec4<f32> {
|
||||
return col;
|
||||
}
|
||||
BIN
src/assets/test.png
Executable file
BIN
src/assets/test.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 254 KiB |
Loading…
Add table
Add a link
Reference in a new issue