Dolphin, the GameCube and Wii emulator - Forums

Full Version: Custom internal resolution as in PCSX2
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7
Lost my wii awhile back, i already had a ps3 and decided not to buy another console since i can just use dolphin, be it my computer was crappy, anyways i usually use an older revision (6803), i tried JPs version for the emulated motion plus on the above image, so i'll just hang on till ivybridge before i get a new PC
I'm a major amateur at coding, but something I would like to try my hand at once is custom internal resolution multipliers. There would be some standard options (e.g. 0.5x, 1x, 2x, 3x) and then a "Custom..." option that would prompt for a number. You'd put a number in (e.g. 0.25x or 6x) and it would use that. Right now, for example, 6x just isn't possible. You can get 4x through the standard options or with 1x + 4xSSAA, but if you go a step higher you're jumping to 2x + 4xSSAA for 8x. It's not that it's a bad implementation by any means, although I think it could be improved, and it definitely sounds like a fun project to try out for picking up some coding experience.

Of course, I'm sure there's some flaw in this idea somewhere that needs poking. Poke away, I say!
(03-25-2012, 01:22 PM)Kodiack Wrote: [ -> ]You can get 4x through the standard options or with 1x + 4xSSAA,

1x + 4xSSAA is actually like 2x I believe. And 9xSSAA is 3x? I could be COMPLETELY wrong for all I know, but afaik I'm right XD. I would also LOVE for someone to confirm if I am right or wrong Big Grin)
Correct. I could be wrong but that last time I checked 2 x 2 = 4 and 3 x 3 = 9.

Quote:I'm a major amateur at coding, but something I would like to try my hand at once is custom internal resolution multipliers. There would be some standard options (e.g. 0.5x, 1x, 2x, 3x) and then a "Custom..." option that would prompt for a number. You'd put a number in (e.g. 0.25x or 6x) and it would use that. Right now, for example, 6x just isn't possible. You can get 4x through the standard options or with 1x + 4xSSAA, but if you go a step higher you're jumping to 2x + 4xSSAA for 8x. It's not that it's a bad implementation by any means, although I think it could be improved, and it definitely sounds like a fun project to try out for picking up some coding experience.

Of course, I'm sure there's some flaw in this idea somewhere that needs poking. Poke away, I say!

It should be very easy. Changing the internal resolution is as simple as changing the value of two variables, I've done it a number of time.

http://code.google.com/p/dolphin-emu/source/browse/Source/Core/VideoCommon/Src/RenderBase.cpp
(03-25-2012, 01:22 PM)Kodiack Wrote: [ -> ]You can get 4x through the standard options or with 1x + 4xSSAA,

SSAA only adds blur.
Applying 9xSSAA to a 1xIR image won't make it any better than 2xIR (or even 1.5xIR) with no SSAA.
1xIR looks like a blurry mess, 2xIR looks 'HD', while 1xIR + 9xSSAA looks like a smoother version of the blurry mess.

Increasing the internal resolution adds more sharpness and detail to all 3D objects. It greatly improves the texture quality as well (acts like an anisotropic filter).

Internal resolutions over 3x are still useful on FullHD (1080p) displays.

4xIR on 1080p may not improve the sharpness of static images that much (like the jump from 2x to 3x), but it definitely improves the quality of objects at *far distances* and removes some of that annoying shimmering (aliasing artifacts) in dynamic scenes.

6xIR (or 2x fractional) would be ideal even for 1080p screens (not just 4k QuadHD displays). Just try the custom resolution feature in PCSX2, set the X and Y res to 2x your screen resolution and enjoy the solid, artifact-free graphics.

There are many games that still need more than 4x IR on a 1080p display (DKCR, for example). With 4xIR, the image quality is still far from 'perfect' (noticeable even on a small 21" monitor !). 4x IR + 2x MSAA (D3D11) looks much better, but MSAA adds glitches (white dots around polygon edges).


(03-26-2012, 05:31 AM)NaturalViolence Wrote: [ -> ]It should be very easy. Changing the internal resolution is as simple as changing the value of two variables, I've done it a number of time.

http://code.google.com/p/dolphin-emu/source/browse/Source/Core/VideoCommon/Src/RenderBase.cpp

Your 4x internal resolution patch is actually the one that made me want to try my hand on it. Tongue I've used my own custom internal resolutions by modifying the source code, but I'd like to make it so that anybody could do this without needing to compile themselves. It would be significantly easier than pretty much any of the other development work, but I still think it would be a nice option.

(03-26-2012, 07:07 AM)kirbypuff Wrote: [ -> ]*snip*

Thanks for the info! I know that SSAA renders the image at a much higher resolution than downscales it, although I wasn't sure exactly how it stacked up against the internal resolution modifier.
Quote:SSAA only adds blur.

No it doesn't. Give 4xSSAA a try sometime. Or try using SSAA in a revision before 6549, the revision that broke it.

Quote:Applying 9xSSAA to a 1xIR image won't make it any better than 2xIR (or even 1.5xIR) with no SSAA.

Yes it will, it removes aliasing. Thus the name, anti-aliasing.

Quote:Increasing the internal resolution adds more sharpness and detail to all 3D objects. It greatly improves the texture quality as well (acts like an anisotropic filter).

4xSSAA is functionally the same as doubling the IR scale.

Quote:6xIR (or 2x fractional) would be ideal even for 1080p screens (not just 4k QuadHD displays). Just try the custom resolution feature in PCSX2, set the X and Y res to 2x your screen resolution and enjoy the solid, artifact-free graphics.

3x IR + 9xSSAA is ideal, but far to taxing for all but the fastest video cards.

Quote:There are many games that still need more than 4x IR on a 1080p display (DKCR, for example). With 4xIR, the image quality is still far from 'perfect' (noticeable even on a small 21" monitor !).

The only problem with 4x IR is there will still be aliasing without any form of AA, which can be fixed by using SSAA.

Quote:4x IR + 2x MSAA (D3D11) looks much better, but MSAA adds glitches (white dots around polygon edges).

Which is why you should use SSAA.

"They" need to fix the SSAA shaders, it's as simple as that. However even in there broken states SSAA is still useful.

Edit by [SS]: Fixed that for you.
(03-26-2012, 08:50 AM)NaturalViolence Wrote: [ -> ]We need to fix the SSAA shaders...

... improve the scaling algorithms used...

... and fix the 1079->1080 scaling (blur) issue:
http://forums.dolphin-emu.org/showthread.php?tid=22324
Well, I've had some luck with adding custom resolutions so far. I've updated the text and case switches, and since it's my own personal build I've also removed the 1.5x, 2.5x and 4x internal resolutions (although the 4x could be added with a custom one, as soon as I get it working!). Here's how it looks so far for me...

RenderBase.cpp:
Code:
void Renderer::CalculateTargetScale(int x, int y, int &scaledX, int &scaledY)
{
    switch (g_ActiveConfig.iEFBScale)
    {
        case 3: // 2x
            scaledX = x * 2;
            scaledY = y * 2;
            break;
        case 4: // 3x
            scaledX = x * 3;
            scaledY = y * 3;
            break;
        /*case 5: //Custom Resolution
            scaledX = x * customIR;
            scaledY = y * customIR;*/
        default:
            scaledX = x;
            scaledY = y;
            break;
    };
}

RenderBase.cpp:
Code:
            switch (g_ActiveConfig.iEFBScale)
            {
            case 0:
                res_text = "Auto (fractional)";
                break;
            case 1:
                res_text = "Auto (integral)";
                break;
            case 2:
                res_text = "Native";
                break;
            case 3:
                res_text = "2x";
                break;
            case 4:
                res_text = "3x";
                break;
            case 5:
                res_text = "CUSTOMx";
                break;
            }

VideoConfigDiag.cpp:
Code:
    // Internal resolution
    {
    const wxString efbscale_choices[] = { _("Auto (Window Size)"), _("Auto (Multiple of 640x528)"), wxT("1x Native (640x528)"),
    wxT("2x Native (1280x1056)"), wxT("3x Native (1920x1584)"), wxT("Custom Resolution...") };

    wxChoice *const choice_efbscale = CreateChoice(page_enh,
        vconfig.iEFBScale, wxGetTranslation(internal_res_desc), sizeof(efbscale_choices)/sizeof(*efbscale_choices), efbscale_choices);

    szr_enh->Add(new wxStaticText(page_enh, wxID_ANY, _("Internal Resolution:")), 1, wxALIGN_CENTER_VERTICAL, 0);
    szr_enh->Add(choice_efbscale);
    }

Obviously this isn't much progress, although in my defense I'm using it as a learning experience! :D What could I do to have the emulator open a new window with the "Custom Resolution..." window is opened and then have it prompt for a value?

**EDIT
Note to self: Improve commenting formatting in code. It's terrible. LOL
Quote:... improve the scaling algorithms used...

Which is basically the same thing as what I said. Depending on your definition of "scaling algorithm" SSAA either doesn't have one or that's all SSAA is.

Quote:Obviously this isn't much progress, although in my defense I'm using it as a learning experience! Big Grin What could I do to have the emulator open a new window with the "Custom Resolution..." window is opened and then have it prompt for a value?

**EDIT
Note to self: Improve commenting formatting in code. It's terrible. LOL

Go learn some wx stuff and then you're pretty much done.
Pages: 1 2 3 4 5 6 7