Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Virtual Resolution Issues

Author
Message
Polaraul
9
Years of Service
User Offline
Joined: 13th Dec 2014
Location:
Posted: 23rd Jan 2015 12:52 Edited at: 23rd Jan 2015 16:38
I seem to be having issues when it comes to rendering virtual resolutions, especially when it comes to one pixel spacing, as seen from the images below. Is there a setting I need to enable, or is the expected behaviour?



BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 23rd Jan 2015 15:34
I'm not sure what your image is demonstrating. If it's the lines not being central in the white box, I would guess it's a miscalculation in the code.

Your virtual resolution is higher than actual resolution, so some compromises will have to be made when resizing. My experience is that it gets the nearest pixel correct.

Quidquid latine dictum sit, altum sonatur
Polaraul
9
Years of Service
User Offline
Joined: 13th Dec 2014
Location:
Posted: 23rd Jan 2015 16:41
Hi Batvink. I did have three images prepared, but due to the limitations of the forum software I could only attach one. I have amended my original post to better show the issue.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 23rd Jan 2015 17:31
I guess the simple answer is, it has to lose 25% of the pixels, and it has coincided with your vertical/horizontal lines.

I just tried the same process in a graphics package using nearest pixel, bilinear and bicubic algorithms.
Nearest pixel gives exactly the same result, missing lines.
Bilinear and bicubic both give a blurry representation of the original.

For a complex photo or image it's barely noticeable as we compensate in our brains for missing information, but for something as precise as your grid it stands out as a problem.

Can you use the draw commands to create your grid in code?

Quidquid latine dictum sit, altum sonatur
Polaraul
9
Years of Service
User Offline
Joined: 13th Dec 2014
Location:
Posted: 23rd Jan 2015 18:16
Many thanks for your help Batvink, I had suspected that this was the case. Unfortunately I won't be able to use the draw commands and it seems that for this project SetVirtualResolution() will be of little use
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 23rd Jan 2015 18:32
I wondered if Sprites used a different algorithm that was more forgiving, but it seems not. Here's my test, where the lines appear and disappear depending on size:



Quidquid latine dictum sit, altum sonatur
fog
20
Years of Service
User Offline
Joined: 5th Oct 2003
Location: Newcastle, England
Posted: 23rd Jan 2015 20:22
How about drawing to a render image instead? You have control over how you scale and resize a render image that you don't get just using a virtual resolution to scale things.

Polaraul
9
Years of Service
User Offline
Joined: 13th Dec 2014
Location:
Posted: 23rd Jan 2015 20:23 Edited at: 23rd Jan 2015 20:38
Many thanks for the test code Batvink. My initial code used sprites as well, and it would appear they are just as unforgiving. I think I will have to look into using the percentage based system to see if that fairs any better.
Polaraul
9
Years of Service
User Offline
Joined: 13th Dec 2014
Location:
Posted: 23rd Jan 2015 20:38
@fog This sounds an interesting idea. When I get chance I will test this out to see if the results are any better.
Polaraul
9
Years of Service
User Offline
Joined: 13th Dec 2014
Location:
Posted: 24th Jan 2015 11:55
Many thanks for all the ideas and replies. I finally managed to get this working using this post http://forum.thegamecreators.com/?m=forum_view&t=205790&b=41&msg=2459744#m2459744

Login to post a reply

Server time is: 2024-04-20 17:28:23
Your offset time is: 2024-04-20 17:28:23