Pixels noticeably distorted

S

snowy1996

Guest
I've been having an issue for a bit now in which the pixels making up my game warp and distort as the camera moves, never settling into their properly square selves. Pictured here as evidence: https://imgur.com/a/n3mcn
The issue should be noticeable in the characters bloated eye or when comparing the usually visually the same trees.
I'm not sure if this is considered screen tearing, but checking "use synchronization to avoid tearing" hasn't changed anything. My cameras are set to as 544x306 to match my 16:9 monitor resolution as well, so I don't think it's just a matter of the resolution being off.
Searching the web hasn't been able to help me, and at this point I'm hoping to just bounce around ideas until something sticks.
 
Last edited by a moderator:
S

snowy1996

Guest
9:16 = 306:544
Is that not correct? I figured I could have my camera properties be anything so long as they used whole numbers matching a 9 to 16 ratio, no?
 

Joe Ellis

Member
maybe just in the draw event making everything floor(x), floor(y) will work, cus that makes it always a whole number, that usually fixes any problems with (on purpose) lower res games

oh and the camera if youv got one, floor that's coordinates in the draw event,
 

Joe Ellis

Member
yeah that is true, 64 bit numbers never work well with integers, but thats why I was saying floor them in the draw event cus they will always be pixel exact, even if while theyre moving theyre at 17.07927040

dont floor them in the step event, cus that'll ruin the smooth motions, but temp set where they actually draw to whole coords
 
Last edited:
S

snowy1996

Guest
Ok so the problem is the resolution being an imperfect conversion? Is there a more commonly used dimension close to what I'm using that would work properly? I'm trying to pull off something reminiscent of the 32-bit era.

Looloo, I'm not sure which you're referring to when you say draw event. My cameras dimensions are being set in the room properties.
 
T

trentallain

Guest
Ok so the problem is the resolution being an imperfect conversion? Is there a more commonly used dimension close to what I'm using that would work properly? I'm trying to pull off something reminiscent of the 32-bit era.

Looloo, I'm not sure which you're referring to when you say draw event. My cameras dimensions are being set in the room properties.
I use this website a bit when picking resolutions https://pacoup.com/2011/06/12/list-of-true-169-resolutions/
 
I

icuurd12b42

Guest
choose a resolution that will evenly, throughout most common resolutions, scale by adding the same number of fill data per scan line.

like one line becomes 2 lines, 3 line, or 4 lines and so one when scaled up...

the problem you have is as you scale, many of the lines double, but some don't...

for example if you have 200 tall image and you scale it up to 398... mose the lines will be double except for 2 lines that will stay a single line, giving a compressed effect for that region

Your image, the tree on the right is the opposite of that... say you scale a 200 tall image to become 202... most of the image will have 1 line per line while 2 of them will have 2 lines per line, making a blockish stretch for that region


upload_2017-12-24_1-8-27.png
 

Joe Ellis

Member
Its the camera's position i was referring to, (which is dynamic so it gets updated every step) not the size of the view, if its position is not an integer you'll get problems,
so thats why i was saying floor or round the position coordinates, which can be either in the step event or draw event depending how your setting the view,
but its actual position variables should be floats to keep the smooth movement, so have a separate pair of "view position" variables which are basically a rounded version of its position

have you ever used d3d_set_projection_ortho? thats usually easier to use than views, you just set it in the draw event with the camera's x, y, width and height
 
Last edited:
I

icuurd12b42

Guest
something fishy happened to this thread. many posts have gone, including my 2nd response... about view position and sprite position
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
As soon as you will scale your game up by a factor that isn't an integer, you'll get distortion. As simple as that.
Not true! Make the application surface the same size as the screen/viewport window and you'll find that things look much better. This DOES mean that you will be drawing more pixels than the base resolution, but it eliminates the issues you are experiencing. ;)

something fishy happened to this thread. many posts have gone, including my 2nd response... about view position and sprite position
Topic logs show that nothing has been removed...
 

RangerX

Member
Not true! Make the application surface the same size as the screen/viewport window and you'll find that things look much better. This DOES mean that you will be drawing more pixels than the base resolution, but it eliminates the issues you are experiencing. ;)
Please, its pure logic here. No fraction of pixels can exist.
The more pixel you have to represent an image that would be unevenly scaled up, the less apparent the distortion will be though. But its there. Don't give false information.
 
Last edited:

Nocturne

Friendly Tyrant
Forum Staff
Admin
The more pixel you have to represent an image that would be unevenly scaled up, the less apparent the distortion will be though. But its there. Don't give false information.
It's not false information. It's an easy workaround that gives a result that is, in most cases, perfectly acceptable. ;)
 
I

icuurd12b42

Guest
well, pixel artist would disagree depending on the game style and their perfectionistic view on things

it is true that the artefact would be less pronounced on a higher density canvas, if a 1x1 pixel is scaled to a 8x8 and a few are scaled to 7x8 or 9x8 due to rounding... you would be darned to find the exact scan line this is happening on, especially in a dynamic picture, like a game where everything is moving
 

RangerX

Member
it is true that the artefact would be less pronounced on a higher density canvas, if a 1x1 pixel is scaled to a 8x8 and a few are scaled to 7x8 or 9x8 due to rounding... you would be darned to find the exact scan line this is happening on, especially in a dynamic picture, like a game where everything is moving
Exactly what I am saying. At some point it doesn't matter anymore but the statement stays true, if you don't scale by an integer factor, you get distortion. Its important to understand it in my opinion.
 
Top