u/ufoscout

▲ 6 r/bevy

Need help removing the artifact between sprites when the window is resized

Hi,

Just for fun, I started playing with Bevy in an attempt to rewrite one of my childhood favorite games "Road Fighter". Here the project: https://github.com/ufoscout/road_fighter

I have been stuck for a long time with a rendering issue that happens when I resize the screen. For example, with the original size, everything looks as expected:

https://preview.redd.it/mx7mpqp4gdwg1.png?width=512&format=png&auto=webp&s=1f31ceb2c7afaa6d3c1f044df82a7bc10a79e00d

but if I resize the window, then lots of artefacts appear between the sprites:

https://preview.redd.it/f868z34dgdwg1.png?width=1174&format=png&auto=webp&s=ad5d5c4e8ae90423ee7678c28d3b6d5b9b08e14b

As I have exactly zero experience with game programming, Bevy or graphics in general, I am not even able to understand if the issue is linked to how I manage the sprites or how the Bevy camera is configured or anything else.

I would genuinely accept any advice or criticism. This is a hobby project that would probably never be completed, but I am curious to know what I am doing wrong and what the correct approach should be.

I know I could hardcode a larger screen size by simply multiplying everything by a fixed factor, but I would really like to resize the window freely.

reddit.com
u/ufoscout — 2 days ago