[oden] Pixel-perfect sprite sampling
This commit is contained in:
parent
262cfd73ac
commit
7fc786e2e7
1 changed files with 2 additions and 3 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue