an_editor/shaders/fragment.wgsl

17 lines
469 B
Plaintext

struct VertexOutput {
@builtin(position) position: vec4<f32>,
@location(0) tex_coord: vec2<f32>,
}
@group(0) @binding(0)
var texture: texture_2d<f32>;
@group(0) @binding(1)
var texture_sampler: sampler;
@fragment
fn fs_main(input: VertexOutput) -> @location(0) vec4<f32> {
var text_color = textureSample(texture, texture_sampler, vec2<f32>(input.tex_coord.x, input.tex_coord.y)).r;
return vec4<f32>(text_color * vec3<f32>(1., 1., 1.), text_color);
}