Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Odd number screen resolution sometimes lead to garbled rendering #106

Closed
bitinn opened this issue Apr 19, 2016 · 8 comments
Closed

Odd number screen resolution sometimes lead to garbled rendering #106

bitinn opened this issue Apr 19, 2016 · 8 comments

Comments

@bitinn
Copy link

bitinn commented Apr 19, 2016

aka iPhone 6 resolution (375 × 667 pt).

screen shot 2016-04-19 at 7 32 41 pm

Screen resolution with even number (376 × 668) doesn't seem to suffer from the problem.

The strange thing: it doesn't happen (or become noticeable) on all maps, only some, even though they have similar tilesets and map dimensions.

@karai17
Copy link
Owner

karai17 commented Apr 22, 2016

Are you flooring your draw positions?

@bitinn
Copy link
Author

bitinn commented Apr 23, 2016

I want to say I did because I am usually mindful with this sort of things...

But I fail to reproduce this problem after tuning a few layer related operations recently. I will re-open if it comes up again.

@bitinn bitinn closed this as completed Apr 23, 2016
@bitinn
Copy link
Author

bitinn commented Apr 24, 2016

Weird, this problem only happens on iMac but not my Macbook Air, both non-retina, both use the same version of OS X and LOVE. Source code versioning is managed by git so I am confident they are the same.

I can think of only 2 places where I need to floor explicitly, camera position and draw range, they both are. What else should I look out for?

UPDATE: actually all maps on iMac suffer from this odd number resolution problem, some are just subtle enough so I didn't catch them initially.

@bitinn bitinn reopened this Apr 24, 2016
@karai17
Copy link
Owner

karai17 commented Apr 24, 2016

Draw position
On Apr 24, 2016 2:45 PM, "David Frank" notifications@github.com wrote:

Reopened #106
#106.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#106 (comment)

@bitinn
Copy link
Author

bitinn commented Apr 24, 2016

I am not getting what you mean. None of the tiles in above image are drawn using custom layer/object layer, they are just drawn through tile layers, by calling Map:draw() (it accepts no parameters), no additional scale or rotation are applied. Camera translates the map using floored integer.

I fail to find anything on draw position in your api doc or Tiled, love.graphic.draw() is the only thing that takes a draw position but how could a sprite in custom layer mess up tiled layers?

@karai17
Copy link
Owner

karai17 commented Apr 24, 2016

Sorry, I was half asleep when I wrote that. If your camera (translation) is floored, then it shouldn't be causing weird artifacts like that.

@bitinn
Copy link
Author

bitinn commented Apr 25, 2016

No worries, I did floored the camera position when I move it, I will have to see if it has anything to do with camera creation using non-integer number.

Still it's kinda strange I can only reproduce it on iMac...

ref: https://github.com/vrld/hump/blob/master/camera.lua#L63-L69

@bitinn
Copy link
Author

bitinn commented Apr 25, 2016

I got it now, both hump.camera and gamera are doing / 2 internally, this means we need at least an even number to ensure translation is an integer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants