Closed zment4 closed 11 months ago
Yeah things happening indeterministically is usually a sign of a scheduling issue. However, maybe we can avoid that - have you tried setting the sampling setting on the ImagePlugin
? https://github.com/Trouv/bevy_ecs_ldtk/blob/9a10bc8dae321bfec798fc7b9ea140b4233ae177/examples/basic.rs#L7
Yup that worked, thanks! Funny that I didn't come across the default sampler setting at all when looking this up. Must've missed it or something. Anyway, thanks for the help!
Decided to try out rust & Bevy & bevy_ecs_ldtk for a gamejam. I'm currently experiencing issues trying to set the atlas texture to nearest neighbour sampling.
Using the following code:
On desktop runs, with just a simple
cargo run
I always get the correct texture sampling, and I get crisp pixels. However, when runningcargo run --target wasm32-unknown-unknown
, I randomly get either linear sampled pixels or nearest neighbour.Sample images:
Simply just refreshing the page might or might not give out the correct result. I had an event reader for level loading setup at one point to try debug it and it seemed that sometimes the nearest neighbour gets set very very last, and in those cases it doesn't "stick" - maybe some scheduling issue?
I have no experience in either rust nor Bevy, so I'm at a bit of a loss here. Thanks for any possible help!
Here's the main code
...and here is the link for the game jam project files https://github.com/zment4/rj-jam-game for full source