Hello,
I'm creating a 2d game with an multi-directionnal scrolling. I implement it using a quite common feature called a camera that can translate the background when the player moves. This kind of camera system is decribed in many tutorials in the forum
My issue, is that i dream of a perfectly smooth and clear scrolling as we could see on old arcade cabinets.
However, until now what i see in window mode is a little blurry and some artefacts appear.
Have you any technical sugestion to improve the quality of the scrolling to reach the arcade cabinet quality ?
Hope this question will also help other game developper.
See you
Perfectly smooth scrolling
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: Perfectly smooth scrolling
What you mean is pixel perfect graphics. The only way to get those is to grid-lock the whole thing to the pixel grid. Old arcades and consoles simply didn't support rendering sprites partway between two pixels, so you never saw such issue.
There are two basic ways to accomplish this. The first is to render at exactly integer coordinates, exactly integer scaling ratios and exactly 90 degree angles or their multiplies. The second way is to disable texture interpolation for all relevant graphics. The second way will produce pixel-aligned graphics without the need to manually do it, but non-integer scale or non-right angles will still look like ass.
There are two basic ways to accomplish this. The first is to render at exactly integer coordinates, exactly integer scaling ratios and exactly 90 degree angles or their multiplies. The second way is to disable texture interpolation for all relevant graphics. The second way will produce pixel-aligned graphics without the need to manually do it, but non-integer scale or non-right angles will still look like ass.
Re: Perfectly smooth scrolling
thanks for your advice, i will have a try
Re: Perfectly smooth scrolling
Basically, the arcade cab has worse possibilities to make a smooth scrolling than love2d does.
You can download our Zabuyaki and tweak our code. You can even borrow pieces of my code )
Please, look at my signature. There is a link to the site and to the GitHub.
To remove blurry stuff use this
Code: Select all
love.graphics.setDefaultFilter("nearest", "nearest")
Code: Select all
mainCamera:update(dt, math.floor(coord_x * 2)/2, math.floor(coord_y * 2)/2)
I'm going to add more stuff to the in-game camera and the screen scrolling. Now coding other things.
Our LÖVE Gamedev blog Zabuyaki (an open source retro beat 'em up game). Twitter: @Zabuyaki.
LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua
LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua
- zorg
- Party member
- Posts: 3470
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Perfectly smooth scrolling
Whenever i see coordinates rounded in -update- functions, i think it may be a bad thing, since that will mess up sub-pixel calculations in the long run; you want to floor them only when drawing stuff, and not keep those modified values.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: Perfectly smooth scrolling
yup. that might be the reason of some "wobbly" camera behaviour.
Our LÖVE Gamedev blog Zabuyaki (an open source retro beat 'em up game). Twitter: @Zabuyaki.
LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua
LÖVE & Lua Video Lessons in Russian / Видео уроки по LÖVE и Lua
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 3 guests