Compare commits
No commits in common. "4cfb249dd9d0965224231a451dc265c0077b95cb" and "8736e63fb6e7830006eefbe62658bcd4dd439b55" have entirely different histories.
4cfb249dd9
...
8736e63fb6
26
shaders/shader.wgsl
Normal file
26
shaders/shader.wgsl
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
|
||||||
|
@vertex
|
||||||
|
fn vs_main(@builtin(vertex_index) in_vertex_index: u32) -> @builtin(position) vec4<f32> {
|
||||||
|
let x = f32(i32(in_vertex_index) - 1);
|
||||||
|
let y = f32(i32(in_vertex_index & 1u) * 2 - 1);
|
||||||
|
return vec4<f32>(x, y, 0.0, 1.0);
|
||||||
|
|
||||||
|
// param 0
|
||||||
|
// x = -1
|
||||||
|
// y = -1
|
||||||
|
|
||||||
|
// param 1
|
||||||
|
// x = 0
|
||||||
|
// y = 1
|
||||||
|
|
||||||
|
// param 2
|
||||||
|
// x = 1
|
||||||
|
// y = -1
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@fragment
|
||||||
|
fn fs_main() -> @location(0) vec4<f32> {
|
||||||
|
return vec4<f32>(0.0, 0.0, 1.0, 1.0);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user