Other Resolutions.

Started by Calin Leafshade, Sat 29/12/2012 18:09:41

Previous topic - Next topic

Crimson Wizard

There may be a sense in selecting x2, x3 etc filters for windowed mode, but is there a point to explicitly choose them for fullscreen? Why should you not using your current display resolution?
Also, what if it is not x2 or x3 multiplier, but 1.5 or 3.2 which fits best for your screen?

Snarky

#61
Quote from: Crimson Wizard on Thu 11/07/2013 07:54:58
There may be a sense in selecting x2, x3 etc filters for windowed mode, but is there a point to explicitly choose them for fullscreen?

With the plain x2, x3 etc. filters it's not so important, but it definitely makes sense for the hq filters (and other more advanced filters that might be available now or in the future), so it's mainly a matter of consistency. Though it would also, to my mind, affect screen captures (which should ideally capture it at the effective filtered resolution, but ignore the subsequent window stretching).

Quote from: Crimson Wizard on Thu 11/07/2013 07:54:58
Why should you not using your current display resolution?

Wait, are you asking why there should be options for different resolutions at all?

Well, what if some combination of filters gives an effective resolution of 1280x800, maybe that's a resolution supported by my video card/monitor, and I'd rather just set my screen to that mode than have AGS stretch it do a different screen size.

Edit: Another thing we haven't really talked about, but which some emulators support, is to make the game resolution larger than the screen resolution, so that the screen just shows part of the whole graphics canvas (there needs to be a way to scroll around it or zoom back out, obviously). That could be useful if you're on a small screen, like a smart phone.

Quote from: Crimson Wizard on Thu 11/07/2013 07:54:58
Also, what if it is not x2 or x3 multiplier, but 1.5 or 3.2 which fits best for your screen?

You set it to whatever is closest and then use the stretch mode to fit it to the screen however you like. With 3.2 I'd probably just set it to x3 centered, but with 1.5 I'd set it to x1 or x2 best proportional fit.

Crimson Wizard

But why should I choose a multiplier or resolution at all, if I already know that my desktop resolution is supported by the graphics card?
Can't I just tell: stretch it to current display?

Snarky

#63
Quote from: Crimson Wizard on Thu 11/07/2013 08:52:59
Can't I just tell: stretch it to current display?

Yes, just leave the filters off, leave the resolution at the default, and set it to stretch or best fit in fullscreen.

Quote from: Crimson Wizard on Thu 11/07/2013 08:52:59
But why should I choose a multiplier or resolution at all, if I already know that my desktop resolution is supported by the graphics card?

Well, as mentioned above, what if your screen is slightly larger than 4x, and for optimal crispness you just want to center the 4x graphics on screen without stretching them? Then you need the filter option.

And if you prefer to let the video card handle the stretching rather than AGS (it might use a slightly different algorithm that some might prefer), you need the resolution setting. (Though since it is more of an edge case these days, it might make sense to put it as an advanced option and maybe behind a "force screen resolution" check box or something.)

Crimson Wizard

For anyone savvy in 3d graphics out there: if I have a 2d texture rendered in 3d world, and I want it be not stretched to whole screen, does it matter if I change "position" matrix to make it appear "further" from camera, or change "perspective" matrix to make camera "zoom out"? Or is it essentially same thing, the difference is only in which object moves and which stays on same place? I am interested mainly in how it affects rendering speed, does one of those methods make calculations faster/slower, or there's no difference at all?

Calin Leafshade

Well you should really be using an orthographic camera so distance from it shouldnt make a difference in rendering size.

If you want to render something at a different size you should change the vertices of the poly.

Tosek

I agree to Calin Leafshade.
Ortho is the right way to handle 2d graphics within 3d space. But you can also use the scale component of the object matrix to resize a plane.

Crimson Wizard

So, to clarify, I do not touch the projection matrix, but move/scale a plane I render texture on?

Calin Leafshade

Yes, providing the matrix is currently an orthographic matrix and not a perspective one. It should be but I remember looking at the D3D code in AGS and it looked like CJ copied it straight from a tutorial or something because it had unrelated comments so it might not be.

Crimson Wizard

#69
Thanks!

Woo, its getting shape:



And just for lulz:

Ali

Yay!

Any chance of seeing a full-size version of the screenshot?

Sorry to harp on, but would the technique you're working on allow (hypothetically) for scaling down a larger screen size like 1280x or 1920x?

Dropped Monocle Games

QuoteSorry to harp on, but would the technique you're working on allow (hypothetically) for scaling down a larger screen size like 1280x or 1920x?

I would also like to know about this! working in a higher res would be amazing :D
I know I'm pretty new around here but I have big plans on making games in AGS

Crimson Wizard

Quote from: Ali on Fri 12/07/2013 15:31:49
Any chance of seeing a full-size version of the screenshot?

Blackwell Deception (640x480 game) playing on 1680x1050 fullscreen (nearest-neighbour transformation):
http://img827.imageshack.us/img827/4937/qrj3.jpg

Quote from: Ali on Fri 12/07/2013 15:31:49
Sorry to harp on, but would the technique you're working on allow (hypothetically) for scaling down a larger screen size like 1280x or 1920x?

Nelly 2 playing on 320x240 :P
[imgzoom]http://img842.imageshack.us/img842/3912/8myx.jpg[/imgzoom]

There's still number of issues, both with drawing and mouse cursor position.
And we need to plan how the setup should work.

Alan v.Drake


Igor Hardy


Crimson Wizard

#75
Funny, I found I must set a Viewport for D3D, because otherwise scrolling rooms are drawn on the side borders too, making it visible what shouldn't be :).

E: Oh, actually not just scrolling rooms, but anything that goes beyond "border", like moving objects etc. CJ did not use it, because the image was always stretched to whole window.

EE: Also, important note, simply for the record. AGS engine has 2 set of parameters defining screen size: scrnwid & scrnhit, final_scrn_wid & final_scrn_hit. The difference is only that the latter takes side border into consideration. Since now borders are defined by graphics driver/filter, only one pair is needed, the one which defines game size.
The "screen sizes" returned by script functions (GetScreenWidth/Height) are "virtual screen" sizes (which = game resolution), not real window sizes the game is currently running.
While making some experiments I forgot about that, and this resulted in weird misalignment of guis and fonts in several games.
If the script API will ever allow to get real window size, there should be separate set of functions for this.

Monsieur OUXX

Quote from: Crimson Wizard on Wed 10/07/2013 18:23:19
My idea is to invert the logic of using scaling filters. At the moment the selected scaling filter define final resolution. While it is final resolution that should define which scaling filter to select. Setup should have following options:
- Display resolution
- Fullscreen (yes/no)
- Placement mode:

  • Place (just render starting from 0,0)
  • Center (center inside window)
  • Stretch (stretch to window)
  • Best fit (stretch proportionally as much as fits in the window) - this is the default option
- Scaling filter to use if necessary: nearest-neighbour (plain/AA), hq2x, hq3x.

I like your idea.
But as Snarky pointed out, sometimes the choice of the resolution by the player (at least me) is a bit irrational. Especially the zooming level. Sometimes I want to play in window-mode, and I decide sort-of afterwards if I want the game to use up most of the screen (3x) or just part of it (2x).

However I strongly agree that we have to find a way to "hide" those resolution calculations from the player.

Maybe we could have a list of recomended modes (appearing in bold in the list)?

Or have a thumbnail of what the result would look like in the winsetup.exe window? (a bit like in the Display Parameters window of Windows XP -- see the upper part of the screenshot below.) : you'd see a larger rectangle symbolizing the screen, with a message on top of it : "your screen needs to be able to display resolution 1024x768" and a smaller rectangle inside it symbolizing the game window ("the game will appear as a 800x600 window")

 

RickJ

#77
I also like CWs ideas, it is much simpler and much more sane. I think Monsieur OUXX and Snarky are correct in that "you can't please everyone so you have to let them please themselves";)

So instead of junking up CW's clean design why not have a button labeled "Other Options" that opens a little window containing the irrational options.  Just a thought!

Crimson Wizard

Basically it is either window size that define scaling or otherwise. But we can have both options.
All we need, IMO, is to add another placement option: "Resize window". When selected, the resolution selection (in setup) will be disabled, and when run, the engine will make the window size = base game size * chosen scaling.
Other options (stretch, center, etc) will work opposite: they will create window of defined size independently of scaling mode, then scale and put a game image inside.


Crimson Wizard

Test build (engine only): http://www.mediafire.com/download/4adkw2du7kdj63u/custom_dispres.zip

Related branch: https://github.com/adventuregamestudio/ags/tree/feature_display_resolution
(forked from latest 'master')

I have to apologize, I wanted to make a build with new options in winsetup, but feel too sleepy to write code :p. I am also leaving my city for several days, so I thought maybe I'll upload what I have just to show how it works.
The only way to setup new settings is to write them manually into acsetup.cfg. Put following into "[misc]" category (where you have "gfxdriver", "gfxfilter" and similar stuff):

Code: text

renderstyle=N
// N=0 - center
// N=1 - stretch
// N=2 - stretch proportional (aka "best fit")
// N=3 - resize window - this makes window size equal to (default game size)*(filter scaling).
// if you set renderstyle=3, the following screenwidth and screenheight params are ignored.
screenwidth=X
screenheight=Y
// Where X and Y are wanted window resolutions.


I scrapped most of gfx mode initialization code in the engine, and now it does following:
1. Tries to initialize requested resolution.
2. If failed, looks for the nearest supported resolution in the internal driver list, and tries to initialize it.
3. If failed, tries to initialize originally requested resolution with alternate color depth.
4. If failed, looks for the nearest supported resolution with alternate color depth.
5. If failed, quits with error.
This is good to know, because you may end having different resolution than you asked for. Press Ctrl+V in the game to see system stats - it tells which resolution you are running.
Also, this process is reflected in the game log file (agsgame.log).
Log example:
Spoiler
Quote
Switching to graphics mode
Trying gfx mode 320 x 200 (16-bit) fullscreen
Attempt to switch gfx mode to 320 x 200 (16-bit)
Failed, resolution not supported
Attempting to find nearest supported resolution
Trying gfx mode 640 x 480 (16-bit)
Attempt to switch gfx mode to 640 x 480 (16-bit)
Succeeded. Using gfx mode 640 x 480 (16-bit) fullscreen
[close]

Remember, if you are running old games (AGS 2.7 and lower) run new engine's setup program at least once before launching game in this engine - to set graphics driver and other 3.x options properly, otherwise you may get weird results.

Known problems:
OpenGL driver not yet updated, therefore engine ports won't work (or work weird).
Mouse will act annoyingly slow with very small games run non-stretched in large windows; also in proportionally stretched games it may be too slow or too fast moving along one of the axises. I think this needs some kind of automatic fixing + mouse sensivity setup.

SMF spam blocked by CleanTalk