sprite2d: use nearest texture filter + fix texture coloring
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
6a81c7a579
commit
c004ea1b06
2 changed files with 3 additions and 3 deletions
|
|
@ -70,8 +70,8 @@ pub fn machSprite2DInit(adapter: anytype) !void {
|
||||||
// Create a sampler with linear filtering for smooth interpolation.
|
// Create a sampler with linear filtering for smooth interpolation.
|
||||||
const queue = device.getQueue();
|
const queue = device.getQueue();
|
||||||
const texture_sampler = device.createSampler(&.{
|
const texture_sampler = device.createSampler(&.{
|
||||||
.mag_filter = .linear,
|
.mag_filter = .nearest,
|
||||||
.min_filter = .linear,
|
.min_filter = .nearest,
|
||||||
});
|
});
|
||||||
|
|
||||||
const sprite_buffer_cap = 1024 * 128; // TODO: allow user to specify preallocation
|
const sprite_buffer_cap = 1024 * 128; // TODO: allow user to specify preallocation
|
||||||
|
|
|
||||||
|
|
@ -98,5 +98,5 @@ fn frag_main(
|
||||||
if (c.a <= 0.0) {
|
if (c.a <= 0.0) {
|
||||||
discard;
|
discard;
|
||||||
}
|
}
|
||||||
return vec4<f32>(0.3, 0.2, 0.5, 1.0);
|
return c;
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue