how to manage PRESCALER

Previous topic - Next topic

Qedo

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: ?

Kitty Hello

Read the manual about the picked scalings. Its 1,2,3,4,5,8,10,12 or so. Not 1.5, which looks ugly

erico

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.

Qedo

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.



Hemlos

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.

Bing ChatGpt is pretty smart :O

erico

Quote from: 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

So as Qedo said, the manual is wrong as it states 1.5

kanonet

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.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

Kitty Hello

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.

Kitty Hello

Just try it. I hope for ians aqua adventure on Android :D

erico

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. ;)

spacefractal

#10
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.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

erico

#11
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?! ;/

spacefractal

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).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

erico

Quote from: spacefractal 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 :)

Ian Price

#14
Quote from: erico 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.

QuotePS. 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?
I came. I saw. I played.