Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 5xBR and scaling to existing 4xHQ #8019

Merged
merged 4 commits into from
Oct 14, 2015

Conversation

LunaMoo
Copy link
Collaborator

@LunaMoo LunaMoo commented Oct 3, 2015

A simple and fast variant of 5xBR, also changed 4xHQ to actually use outputresolution as it also is an upscaling shader, someone just forgot to set it.
This gives us 2 nicely working scaling postprocessing shaders, which was proposed alternative solution for #6280

Note: for upscaling to work properly, screen scaling filter has to be set to nearest and rendering resolution to native x1.

Note2: at least 5xBR is affected by #8016 I don't think it really affects many games through ~ at least among those which I tested for now it was only Monster Hunter series which 3D game anyway and Dai-2-Ji Super Robot Taisen, which is 2D meaning a good target for such shader, but the issue affects only some menus,

Note3: I have no clue about licenses, the 5xBR is licensed under GNU General Public License and can be published under v2 or higher, hope that's ok with PPSSPP.

@hrydgard
Copy link
Owner

hrydgard commented Oct 3, 2015

Cool, but as is has these requirements, maybe we should simply add additional options to defaultshaders.ini to override settings to match? That would make it much easier to use - as it is now, most people use higher resolutions than 1x and use linear scaling so enabling this shader will not work correctly.

I can add support for those setting overrides, but I'll do it after I've pushed out 1.1, which I am looking to do tomorrow.

@LunaMoo
Copy link
Collaborator Author

LunaMoo commented Oct 3, 2015

Nice idea, I tried to do it just now:
https://gist.github.com/LunaMoo/cceec093d56dc941ee86
but I'm missing something or there's another hidden race issue, because with that zoom value does not refresh the first time, it does it only after anything sends another resized_ = true;, but "OnPostProcShaderChange" already sends gpu->Resized(); so I dunno why my code doesn't work, screen scaling filter changes fine at least:]

Oh and good luck with 1.1, it seems "tomorrow" is lagging from some time. ~ ReleaseTradition=true ;o

Edit:
@hrydgard could you check this?
https://gist.github.com/LunaMoo/a410fc63317ef737742c
I made the automatic res/filtering change to work perfectly, had to get shaderInfo inside FramebufferManager::EndFrame()
If that code looks fine to you, I will just add it to this pull request, so you could merge it after 1.1.1 without any extra work.

@hrydgard
Copy link
Owner

@LunaMoo Yes this is fine, add it to the pull request and I'll merge it. Nice work.

@LunaMoo
Copy link
Collaborator Author

LunaMoo commented Oct 14, 2015

@hrydgard done:3

@hrydgard
Copy link
Owner

Hm, I found one problem: Enabling it, then going back and starting another game causes it to not be enabled anymore? Apart from that it's great!

@LunaMoo
Copy link
Collaborator Author

LunaMoo commented Oct 14, 2015

Hmmm I think it's filtering doesn't get set, because resolution doesn't change? I would have to add the postShaderIsUpscalingFilter_ = shaderInfo->isUpscalingFilter; to another place like here https://github.com/hrydgard/ppsspp/blob/master/GPU/GLES/Framebuffer.cpp#L174 or maybe call resized_ on game change, which would be better?

I guess the first one is more proper, it also works fine, so I'll add it:3.

@hrydgard
Copy link
Owner

The first, I think - somewhere in FramebufferManager initialization?

@LunaMoo
Copy link
Collaborator Author

LunaMoo commented Oct 14, 2015

Oh resolution was affected too:| I'll change it again.

Edit:
@hrydgard need help:c, not really sure how to do it, if I put it in https://github.com/hrydgard/ppsspp/blob/master/GPU/GLES/Framebuffer.cpp#L277
it does not work before FramebufferManagerCommon::Init();, nor after(which I already did by placing it inside CompileDraw2DProgram).
So I would have to do some change in common code and postshaders aren't really common part for now. Maybe setting resized is only option for now, even through that does feel a bit hackish since it's exactly happening because resolution wasn't changed between 2 games heh:].

@LunaMoo
Copy link
Collaborator Author

LunaMoo commented Oct 14, 2015

It fully works now, but I set resized_ in FramebufferManager::Init() couldn't really find any other way, so hope it's fine.

hrydgard added a commit that referenced this pull request Oct 14, 2015
Add 5xBR and scaling to existing 4xHQ
@hrydgard hrydgard merged commit 70e9979 into hrydgard:master Oct 14, 2015
@LunaMoo LunaMoo deleted the scaling_shaders branch October 14, 2015 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants