sprite2d: use nearest texture filter + fix texture coloring

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2023-07-15 17:03:12 -07:00
parent 6a81c7a579
commit c004ea1b06
2 changed files with 3 additions and 3 deletions

View file

@ -70,8 +70,8 @@ pub fn machSprite2DInit(adapter: anytype) !void {
// Create a sampler with linear filtering for smooth interpolation.
const queue = device.getQueue();
const texture_sampler = device.createSampler(&.{
.mag_filter = .linear,
.min_filter = .linear,
.mag_filter = .nearest,
.min_filter = .nearest,
});
const sprite_buffer_cap = 1024 * 128; // TODO: allow user to specify preallocation

View file

@ -98,5 +98,5 @@ fn frag_main(
if (c.a <= 0.0) {
discard;
}
return vec4<f32>(0.3, 0.2, 0.5, 1.0);
return c;
}