GLBasic forum

Main forum => GLBasic - en => Topic started by: Qedo on 2015-Aug-21

Title: how to manage PRESCALER
Post by: Qedo on 2015-Aug-21
I'd like to know your thought on how to handle PRESCALER?
logical 1 or 2?, or other?
Ciao

1) graphic output fixed: example 480,320

     PRESCALER 480,320

     case  a:
      native resolution 1920-1280:  scaling factor = 4 (1920/480,1280/320)
     case  b
      native resolution 1280-720:  scaling factor = 2,66 (1280/480) o 2,25 (720/320)

     cons: only case "a" WORK, case "b" DON'T WORK considering the parameters of the scaling command PRESCALER
     pros: graphic output fixed

2) scaling factor fixed: example 4

   scaling_factor=4
   GETDESKTOPSIZE sx,sy
   xs=sx/scaling_factor
   ys=sy/scaling_factor
   PRESCALER xs,ys

     case a:
      native resolution 1920-1280:  graphic output = 480,320 (1920/4-1280/4)   RATIO 1.5 
     case b
      native resolution 1280-720:  graphic output = 320,180 (1280/4-720/4) RATIO 1.77


   cons: graphic output depending on the resolution of the video device (consider the multitude of resolutions in the world Android) and different ratio
   pros: ?
Title: Re: how to manage PRESCALER
Post by: Kitty Hello on 2015-Aug-21
Read the manual about the picked scalings. Its 1,2,3,4,5,8,10,12 or so. Not 1.5, which looks ugly
Title: Re: how to manage PRESCALER
Post by: erico on 2015-Aug-21
Hello Qedo,

I think this command is more of an easy way to port low res games to desktops.
If you are looking into android, you can do that with spacefractal´s scale code here:
http://www.glbasic.com/forum/index.php?topic=9848.msg85853#msg85853

Otherwise, without virtual screen, a scaling routine would depend on the kind of game you are looking at.
Title: Re: how to manage PRESCALER
Post by: Qedo on 2015-Aug-21
on the manuals (14.006 and online) is written 1.5.

however this is not the problem. I was asking another thing.


PRESCALER screenx%, screeny%


This command offers the posibility to scale all graphics output, as if the output screen was of the dimensions screenx% X screeny% pixels. This helps porting existing programs for handhelds to e.g. Android and iOS.
The scaling is done using factors: 1, 1.5, 2,3,4,8,10 and all integer numbers above.
The scaling won't be reduced to < 1.0.


(http://C:\Users\edo\Desktop\ps.jpg)
Title: Re: how to manage PRESCALER
Post by: Hemlos on 2015-Aug-22
Correct me if im wrong; but the way it is, I think the point is to avoid creating floating point numbers when you scale up.
As a side effect the results are always ^2 power of two.
That said, the resulting cpu process power is maximaly efficient.
You could easily create your own scaling system, as people have already, but i think it involves using floating points, which naturally cause more processing power to be needed, resulting is less effiecient rendering times.

Title: Re: how to manage PRESCALER
Post by: erico on 2015-Aug-22
Read the manual about the picked scalings. Its 1,2,3,4,5,8,10,12 or so. Not 1.5, which looks ugly

So as Qedo said, the manual is wrong as it states 1.5
Title: Re: how to manage PRESCALER
Post by: kanonet on 2015-Aug-22
IMHO this way it is almost useless, PRESCALER should be used to set an "internal resoution" that my game will have so i dont need to worry about anything anymore. If it only can be set to selected factors I still get problems if my game is run on many different device resolutions, so im in about the same situation as without that command. Of cause it will look less pretty if I scale to non-integer numbers, but thats just logical and expected, so I think most ppl would be fine with it.
Title: Re: how to manage PRESCALER
Post by: Kitty Hello on 2015-Aug-23
It looks terrible with 2.3 or 1.5. Try scaling an 8bit game screenshot. It scales to proper scales so your lowres game looks quite ok on any device.
Title: Re: how to manage PRESCALER
Post by: Kitty Hello on 2015-Aug-23
Just try it. I hope for ians aqua adventure on Android :D
Title: Re: how to manage PRESCALER
Post by: erico on 2015-Aug-23
I agree with you Kitty, I´m a purist to pixels, but...

it all really depends on the final resolution, for example, consider a 320x240 screen, a 1.5x will look fugly, but we are at an output resolution age way higher then the 480x360, my current monitor is an old one at 1680x1050, all android phones today are at least full HD at 1920x1080 and they will be higher then that from today on, so as all monitors and TVs.

My point is that a broken upscale (1.25 or 1.75 or 1.5) don´t make a difference when you see it in a full hd res. The final resolution is so high, and the pixels per inch is soo deep, that the ugliness is gone, fully unnoticeable.

If you scale a 320x240 to a 480x360 (1.5) screen is is going to look horrible,
but if you scale a 320x240 to a 1440x1080 (4.5) the ugliness is gone, all is fine. ;)
Title: Re: how to manage PRESCALER
Post by: spacefractal on 2015-Aug-23
Some scaling resolution with PRESCALER does not work correctly. See the mouse bug issue (mostly x2 does not work correctly, rest seens works).

AquaVenture does exists to Android, but only on Ouya and GameStick. Im thinks he have newer implemented touchscreen controls, which is the reason, even its such a game, which this kind of controls could works. On iOS its would nice to see that game with both touchscreen (required) and MFi controller support.

Also in CatchOut, im did not half pixel scaling (due im did not used virtual screen). But yes 1.5 scaling would not look ugly on hires screen, so its depend on the final resolution used.
Title: Re: how to manage PRESCALER
Post by: erico on 2015-Aug-23
yep, and I thought I would post an example.
Here images at 1x, 1.5x and 4.75x (it could even be 4.71x).

The second is going to look ugly if your final res is that, the last, as broken as 4.75x is, will look great on current monitors and so on current cell phones. :booze:
Click on the images to see 1x1 sizes on your monitor...sorry for the last one at ~4mb :(

PS: Ian, time is up to have all your games on android right?! ;/
Title: Re: how to manage PRESCALER
Post by: spacefractal on 2015-Aug-23
yes, float pixel prescaling, without smoothshading, between 1 and 3 can been ugly,but after scale 3, then resolutions on those screen is so high, its barly noticeable. while there is no problem using float after that..

On ouya im also used 720p surface with succes and let ouya auto upscaling it. Howover none of those games was pixel art, so. Ians game also look nicely on that console too.

PS. AquaVenture does not have touchscreen, so its that reason its newer ported to Android (except those with game controllers).
Title: Re: how to manage PRESCALER
Post by: erico on 2015-Aug-23
...
PS. AquaVenture does not have touchscreen, so its that reason its newer ported to Android (except those with game controllers).

I´d buy a game controller for that game :)
Title: Re: how to manage PRESCALER
Post by: Ian Price on 2015-Aug-23
PS: Ian, time is up to have all your games on android right?! ;/

I haven't coded anything since November last year (Advent Calendar) due to real-life and time issues.

BTW AquaVenture has always scaled to meet the hardware demands, so PRESCALER on this wouldn't be needed. That's why it's available on Pre, TouchPad, Wiz, Caanoo, Pandora, PC, OUYA and GameStick.

Quote
PS. AquaVenture does not have touchscreen, so its that reason its newer ported to Android (except those with game controllers).
Actually that's not true either. AquaVenture was touchscreen on Pre and TouchPad. I've also got an Android version using Touchscreen.

BTW does the PRESCALER feature also affect the mouse. Do the X.Y co-ords now scale with the screen?
Title: Re: how to manage PRESCALER
Post by: spacefractal on 2015-Aug-23
yes its does follow the prescaled resolution, but there is some bugs in some scaling, example 2 scaling (rest seen works fine), which needs to been fixed. Im also thinks this function is much faster than using virtual screen with this function.

So on Ouya, you should very easy to get 60FPS, because surface scaling is much faster than virtual screen scaling.
Title: Re: how to manage PRESCALER
Post by: Ian Price on 2015-Aug-23
Cheers SpaceFractal :)

I don't see OUYA as a target anymore - I've never been paid for AquaVenture and they've been bought out by Razer.  Once the market is more stable (if ever), then I'll reconsider it. Although, with my output of late, I'm not targetting ANY platforms :P
Title: Re: how to manage PRESCALER
Post by: spacefractal on 2015-Aug-23
Yes im got also newer paid too, but Ouya is still a great test platform for testing with Game controller. Its the easist console to work with. Im will soon get Android TV working. There is some issues left, due failed to get past Google Play testing. So im get a Nexus Player soon.
Title: Re: how to manage PRESCALER
Post by: Ian Price on 2015-Aug-23
I do like the OUYA; it's a really nice little machine, sadly let down (like the Pre & TouchPad) by it's owners. I'm none too fussed on the unofficial OUYA community though...

I'm sure you'll work out all the bugs and problems with the Google Play issues - you've worked wonders so far :)