Spaces:
Running
Running
struct VSInput { | |
position: vec4f, | |
texcoord: vec2f, | |
color: vec4f, | |
}; | |
struct VSOutput { | |
position: vec4f, | |
texcoord: vec2f, | |
color: vec4f, | |
}; | |
struct Uniforms { | |
matrix: mat4x4f, | |
}; | |
var<uniform> uni: Uniforms; | |
vs(vin: VSInput) -> VSOutput { | fn|
var vsOutput: VSOutput; | |
vsOutput.position = uni.matrix * vin.position; | |
vsOutput.texcoord = vin.texcoord; | |
vsOutput.color = vin.color; | |
return vsOutput; | |
} | |
var ourSampler: sampler; | |
var ourTexture: texture_2d<f32>; | |
fs(fsInput: VSOutput) -> vec4f { | fn|
return textureSample(ourTexture, ourSampler, fsInput.texcoord) * fsInput.color; | |
} | |