Commit Graph

85 Commits

Author SHA1 Message Date
Filoppi 315992f254 Fix sharp bilinear using ceil instead of floor 2023-12-18 01:43:25 +02:00
Admiral H. Curtiss 6309aa0010
Merge pull request #12175 from Sam-Belliveau/correct-area-sampling
Corrected Area Sampling Range
2023-11-15 01:49:45 +01:00
Sam Belliveau 7894b40111
Fix inner area sampling loop from going beyond bounds 2023-11-14 12:05:12 -05:00
Filippo Tarpini 84c8eb5a01
Make AutoHDR work with color luminance instead of average
This gives more consistent results.
My main ReShade has also been updated with the same change: https://github.com/Filoppi/PumboAutoHDR
2023-09-09 18:12:47 +03:00
Sam Belliveau d4f8c1b2bd fixed area sampling 2023-08-21 14:20:44 -04:00
Filoppi fc3f7866f8 Video: Fix area/box resampling shifting the output by about one pixel when upscaling and downscaling 2023-08-18 02:00:56 +03:00
Sam Belliveau 39d96a21a8 Video: Improved Tooltips & Bicubic (#5)
Edited by Filoppi
2023-08-18 02:00:56 +03:00
Sam Belliveau ca93a5191f Video: Added Box Resampling
Edited by Filoppi
2023-08-18 02:00:56 +03:00
Filoppi 2edf81cdb0 Video: implement output resampling (upscaling/downscaling) methods 2023-08-18 02:00:55 +03:00
Admiral H. Curtiss 1854ff0142
Merge pull request #12003 from Filoppi/auto_hdr
Add AutoHDR post process shader
2023-08-18 00:20:08 +02:00
Filoppi a924483dc5 Add AutoHDR post process shader 2023-06-29 14:24:27 +03:00
TellowKrinkle 6ac20aea81 Video: Fix shaders on OpenGL 4.1 2023-06-28 01:08:08 -05:00
Filoppi a2702c6e27 Video: implement color correction to match the NTSC and PAL color spaces (and gamma) that GC and Wii targeted.
To further increase the accuracy of the post process phase, I've added (scRGB) HDR support, which is necessary
to fully display the PAL and NTSC-J color spaces, and also to improve the quality of post process texture samplings and
do them in linear space instead of gamma space (which is very important when playing at low resolutions).
For SDR, the quality is also slightly increased, at least if any post process runs, as the buffer is now
R10G10B10A2 (on Vulkan, DX11 and DX12) if supported; previously it was R8G8B8A8 but the alpha bits were wasted.

Gamma correction is arguably the most important thing as Dolphin on Windows outputted in "sRGB" (implicitly)
as that's what Windows expects by default, though sRGB gamma is very different from the gamma commonly used
by video standards dating to the pre HDR era (roughly gamma 2.35).

Additionally, the addition of HDR support (which is pretty straight forward and minimal), added support for
our own custom AutoHDR shaders, which would allow us to achieve decent looking HDR in Dolphin games without
having to use SpecialK or Windows 11 AutoHDR. Both of which don't necessarily play nice with older games
with strongly different and simpler lighting. HDR should also be supported in Linux.
Development of my own AutoHDR shader is almost complete and will come next.

This has been carefully tested and there should be no regression in any of the different features that Dolphin
offers, like multisampling, stereo rendering, other post processes, etc etc.

Fixes: https://bugs.dolphin-emu.org/issues/8941

Co-authored-by: EndlesslyFlowering <EndlesslyFlowering@protonmail.com>
Co-authored-by: Dogway <lin_ares@hotmail.com>
2023-06-19 01:34:42 +03:00
Filippo Tarpini 79120e0d33
Video: Fix lens_distortion post process shader not compiling
`any()` failed to build on my machine, but it doesn't seem to be necessary
2023-06-01 20:32:16 +02:00
degasus 57088ebb82 Shaders: Add error message for asciiart shader if shader_subgroup is missing.
This extension is currently required to get good performance.
So instead of maybe triggering a GPU hang, let's just disable the shader and show a warning instead.

Sadly our postprocessing framework does not support reporting a warning, so the way to display the warning is a bit hacky.
But this is an ascii-art shader, we already have a font in the shader, so let's use it.
2023-03-29 23:12:50 +02:00
degasus 4780953172 Shaders: Clang-format
With no modification.
2023-03-29 23:12:50 +02:00
degasus 196c684ac1 Vulkan: Enable subgroupShuffle.
It is used as workaround for the missing subgroupBroadcastDynamicId flag on SPIR-V < 1.5.
2023-03-24 21:53:23 +01:00
degasus 1571098783 Shaders: Reintroduce the old Asci-Art shader.
Dolphin had a nice but horrible slow asci art shader.
Beside being slow, it used the font from dolphin's old OSD implementation.
So it was also broken after the VideoCommon redesign.

This patch reintroduces the (almost) identical method for the asci art generation.
However with many improvements:
* Inline definition of the font, so no external dependency any more
* Optimized performance by partial unrolling with CSE'ing some memory loads
* Shader subgroup instructions, so 32 times faster on desktop CPUs on Vulkan + OGL (no D3D support)
* Option to select character size by internal or window resultion
* Dropped the last row of pixels of each character (only modification of the outcome)
2023-03-24 21:43:19 +01:00
Admiral H. Curtiss 23b504a952
Merge pull request #10722 from TryTwo/PR_Integer_Shader
Post-processing: Add integer scaling shader
2023-02-05 00:48:47 +01:00
Admiral H. Curtiss 1e7efb2354
Add sharp bilinear postprocessing shader. 2023-02-04 20:48:01 +01:00
TryTwo d9ea1e44be Add post-processing option that can do Integer Scaling. 2022-06-14 07:42:29 -07:00
Tilka fa55e52fff
Merge pull request #9917 from TheHarmonicRealm/master
Fix GBR and GRB post-processing effects
2021-07-20 09:38:14 +01:00
Noah 0be80bcb18
Fix swap_RGB_GRB.gls post-processing shader 2021-07-19 13:21:41 -07:00
Noah ac32996d11
Fix swap_RGB_GBR.gls post-processing shader 2021-07-19 13:20:58 -07:00
Tillmann Karras 2344624b08 PostProcessing: fix lens distortion shader for HLSL 2021-07-18 22:49:36 +01:00
Tillmann Karras eb4ed72a96 PostProcessing: fix lens distortion shader
This has been broken since b44a0980eb.
2021-07-18 04:10:02 +01:00
G 62bd79e70d
Remove AsciiArt shader
This shader has been rendered nonfunctional due to the removal of the function SampleFontLocation, which was never implemented in VideoCommon. The last reference to SampleFontLocation was located in the OGL video backend. It was removed in this commit: f039149198 (diff-24125a6c968a8aca9cadd977d4b9d68f), where many functions were moved to video common, among other things.

This shader should be removed so it does not confuse users with the error that it causes. Alternatively, it could be rewritten so it is compatible with modern versions of Dolphin. I am not familiar with GLSL, so this is currently beyond my skill set.
2020-10-05 21:44:56 -07:00
Pokechu22 afb6468bdb Fix dubois anaglyph shaders on D3D11 2019-07-25 22:04:53 -07:00
iwubcode c513bb5309 VideoCommon: Implement passive stereoscopic 3D 2019-05-04 22:58:00 -05:00
Steven M. Vascellaro 32a5bb2fb4 Replace dead 'oreillynet' url with Wayback Machine archive 2018-12-04 14:41:21 -05:00
Jason 5fc51b45a0 code adjustments in response to review 2016-09-13 10:52:14 -05:00
Jason a6b3237211 lens distortion post-processing shader 2016-09-12 11:07:44 -05:00
Tijmen Wildervanck 0fdd3ecdfe add shaders for anaglyph Amber-Blue and Green-Magenta 2015-06-02 20:47:56 +02:00
Jules Blok 262c3b19ec PostProcessing: Add support for user-supplied anaglyph shaders.
There are lots of different anaglyph glasses out there and there may be even more creative uses for stereoscopic post-processing shaders.
2015-01-25 22:07:03 +01:00
Jules Blok 940c628eb7 Shaders: Remove fake stereoscopic shaders.
We have actual stereoscopy now, no need to pretend.
2014-11-23 14:27:39 +01:00
Ryan Houdek 32fe37d834 Change all the post processing shaders to the new system.
Removes the README.txt file in favour of a new wiki page I'm going to generate.
2014-08-13 01:05:15 -05:00
Ryan Houdek bc9ef95643 Support Sampler binding in the shader.
In the cases where we support the binding layout keyword, use it for more than binding UBO location.
This changes it so it is supported for samplers as well.

Instances when this is enabled is if a device supports GL_ARB_shading_language_420pack, or if it supports GLES 3.10.
2014-07-18 17:04:03 -05:00
myownfriend 7853766a6b Update emboss.glsl 2014-05-21 17:09:26 -04:00
myownfriend 24027b78e3 Update emboss.glsl 2014-05-21 16:45:32 -04:00
myownfriend 12a9c5f0ce Update fire2.glsl 2014-05-21 16:43:55 -04:00
myownfriend f5579d9816 Update cool1.glsl 2014-05-21 16:42:18 -04:00
myownfriend cd6aa34979 Update acidmetal.glsl 2014-05-21 16:38:25 -04:00
myownfriend c3864db4b3 Update 32bit.glsl 2014-05-21 16:36:46 -04:00
myownfriend 41f13f9c99 Update primarycolors.glsl 2014-05-21 16:29:25 -04:00
myownfriend c2e5e030b0 Update asciiart.glsl 2014-05-21 15:15:48 -04:00
myownfriend 28c1e6c6ca Update 16bit.glsl
Sorry. Made a little copy and paste error.
2014-05-21 15:14:56 -04:00
myownfriend 9b022e023b Update firewater.glsl 2014-05-21 14:55:45 -04:00
myownfriend dd91d86095 Update 16bit.glsl 2014-05-21 14:53:48 -04:00
myownfriend d2a74bf294 Update chrismas.glsl 2014-05-21 14:52:46 -04:00
myownfriend fd1d0e6e1e Update posterize.glsl 2014-05-21 14:51:25 -04:00