[oden] Text is mildly functional

This commit is contained in:
John Doty 2023-08-31 17:18:37 -07:00
parent 8914b1795f
commit ecce7b64eb
5 changed files with 204 additions and 114 deletions

View file

@ -34,13 +34,21 @@ struct VertexOutput {
// Fragment shader
// ----------------------------------------------------------------------------
@group(1) @binding(0) var t_diffuse : texture_multisampled_2d<f32>;
@group(1) @binding(0) var t_diffuse : texture_2d<f32>;
@group(1) @binding(1) var s_diffuse : sampler;
@fragment fn fs_main(in : VertexOutput)->@location(0) vec4<f32> {
// TODO: Should we be sampling here for the shader?
let tc = vec2(u32(in.tex_coords.x), u32(in.tex_coords.y));
return textureLoad(t_diffuse, tc, 0);
// let tc = vec2(u32(in.tex_coords.x), u32(in.tex_coords.y));
// let c = textureLoad(t_diffuse, tc, 0);
let tc = in.tex_coords / vec2<f32>(textureDimensions(t_diffuse));
let c = textureSample(t_diffuse, s_diffuse, tc);
return vec4<f32>(c.r,c.r,c.r,c.r);
//return vec4<f32>(1.0,1.0,1.0,1.0);
}