This commit is contained in:
commit
9349a57781
14 changed files with 3973 additions and 0 deletions
4
src/shaders/triangle.frag.wgsl
Normal file
4
src/shaders/triangle.frag.wgsl
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
@fragment
|
||||
fn main(@location(0) inColor: vec3<f32>) -> @location(0) vec4<f32> {
|
||||
return vec4<f32>(inColor, 1.0);
|
||||
}
|
||||
13
src/shaders/triangle.vert.wgsl
Normal file
13
src/shaders/triangle.vert.wgsl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
struct VSOut {
|
||||
@builtin(position) Position: vec4<f32>,
|
||||
@location(0) color: vec3<f32>,
|
||||
};
|
||||
|
||||
@vertex
|
||||
fn main(@location(0) inPos: vec3<f32>,
|
||||
@location(1) inColor: vec3<f32>) -> VSOut {
|
||||
var vsOut: VSOut;
|
||||
vsOut.Position = vec4<f32>(inPos, 1.0);
|
||||
vsOut.color = inColor;
|
||||
return vsOut;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue