[XCX] Re-add sharpen pass as default setting

XCX engine quick/cheap blur AA combined with a sharpen pass.
This aproximates original setting but scales to any res.
Edit sharpen_strength to personal preference
const float sharpen_strength = 0.2;  //0 off, 1 full (edge haloing)
note, off = use only blur aa
This commit is contained in:
getdls 2018-03-19 22:40:37 +01:00
parent 9a9362e0c3
commit 696d9f0d07

View File

@ -5,14 +5,13 @@ $fullHeight = $argv[2];
$scaleFactorX = always_decimal_format($fullWidth / 1280.0); $scaleFactorX = always_decimal_format($fullWidth / 1280.0);
$scaleFactorY = always_decimal_format($fullHeight / 720.0); $scaleFactorY = always_decimal_format($fullHeight / 720.0);
?> ?>
#version 420 #version 420
#extension GL_ARB_texture_gather : enable #extension GL_ARB_texture_gather : enable
const float sharpen_strength = 0.1; const float sharpen_strength = 0.2; //0 off, 1 full (edge haloing) note, off = use only blur aa
// shader 59df1c7e1806366c // shader 59df1c7e1806366c
// aa-restore. Intial version // aa-restore + sharpen pass. AA removal will override any setting here
//To - do //R2i.xyzw is possible a cemu bug. Replace with Alex FXAA
const float resScale = <?=$scaleFactorX?>; const float resScale = <?=$scaleFactorX?>;
//const float resScale = 3.0;
uniform ivec4 uf_remappedPS[2]; uniform ivec4 uf_remappedPS[2];
layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf4e12000 res 1280x720x1 dim 1 tm: 4 format 0001 compSel: 0 4 4 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 2 2 2 border: 0 layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf4e12000 res 1280x720x1 dim 1 tm: 4 format 0001 compSel: 0 4 4 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 2 2 2 border: 0
layout(binding = 1) uniform sampler2D textureUnitPS1;// Tex1 addr 0xf470a000 res 1280x720x1 dim 1 tm: 4 format 0816 compSel: 0 1 2 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler1 ClampX/Y/Z: 2 2 2 border: 0 layout(binding = 1) uniform sampler2D textureUnitPS1;// Tex1 addr 0xf470a000 res 1280x720x1 dim 1 tm: 4 format 0816 compSel: 0 1 2 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler1 ClampX/Y/Z: 2 2 2 border: 0
@ -253,11 +252,11 @@ R4i.x = ((PV0i.w == 0)?(R127i.x):(R127i.z));
R4i.y = ((PV0i.w == 0)?(R127i.w):(R126i.y)); R4i.y = ((PV0i.w == 0)?(R127i.w):(R126i.y));
R4i.z = ((PV0i.w == 0)?(R126i.z):(R126i.w)); R4i.z = ((PV0i.w == 0)?(R126i.z):(R126i.w));
} }
//vec2 uv = gl_FragCoord.xy / textureSize(textureUnitPS1, 0); vec2 uv = gl_FragCoord.xy / textureSize(textureUnitPS1, 0);
//vec4 sharpColour = vec4(texture(textureUnitPS1, uv).xyz - edgeStrength(uv) * sharpen_strength, 1.0); vec4 sharpColour = vec4(texture(textureUnitPS1, uv).xyz - edgeStrength(uv) * sharpen_strength, 1.0);
// export // export
passPixelColor0 = vec4(intBitsToFloat(R4i.x), intBitsToFloat(R4i.y), intBitsToFloat(R4i.z), intBitsToFloat(R4i.w)); //passPixelColor0 = vec4(intBitsToFloat(R4i.x), intBitsToFloat(R4i.y), intBitsToFloat(R4i.z), intBitsToFloat(R4i.w));
//passPixelColor0 = mix(sharpColour, vec4(intBitsToFloat(R4i.x), intBitsToFloat(R4i.y), intBitsToFloat(R4i.z), intBitsToFloat(R4i.w)), 0.5); passPixelColor0 = mix(sharpColour, vec4(intBitsToFloat(R4i.x), intBitsToFloat(R4i.y), intBitsToFloat(R4i.z), intBitsToFloat(R4i.w)), 0.5);
} }