[oden] Pixel-perfect sprite sampling

This commit is contained in:
John Doty 2023-08-19 09:38:16 -07:00
parent 262cfd73ac
commit 7fc786e2e7

View file

@ -56,7 +56,6 @@ const RES = vec2f(320.0, 240.0); // The logical resolution of the screen.
@group(0) @binding(1) var s_diffuse : sampler;
@fragment fn fs_main(in : VertexOutput)->@location(0) vec4<f32> {
let dims = vec2f(textureDimensions(t_diffuse));
return textureSample(t_diffuse, s_diffuse, in.tex_coords / dims);
let tc = vec2(u32(in.tex_coords.x), u32(in.tex_coords.y));
return textureLoad(t_diffuse, tc, 0);
}