Botw AA World/Inventory and FXAA Improved Further (#288)

* Update rules.txt

* Update 0f2b9ee517917425_00000000000003c9_ps.txt

botw Improved Inventory AA

* Update f14bb57cd5c9cb77_00000000000003c9_ps.txt

Improved World AA

* Update 0f2b9ee517917425_00000000000003c9_ps.txt

update resolution pack shader code inventory aa

* Update f14bb57cd5c9cb77_00000000000003c9_ps.txt

update botw world aa resolution pack
This commit is contained in:
Skal Fate 2018-12-03 21:42:04 -07:00 committed by GitHub
parent 82b942bf78
commit 5df59c72e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 55 additions and 54 deletions

View File

@ -6,8 +6,8 @@
// Used for: Removing/Restoring the native BotW Anti-Aliasing implementation to link in inventory screen
#define preset $preset
#define aaSharper $aaSharper
#define aaBlurrier $aaBlurrier
#define aaSharper $inventorySharper
#define aaBlurrier $inventoryBlurrier
#if (preset == 0) // Disabled
layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf49b1800 res 1280x720x1 dim 1 tm: 4 format 0019 compSel: 0 1 2 3 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 2 2 2 border: 1
@ -173,16 +173,16 @@ PV0i.z = R4i.z;
R5i.w = ((PV1i.x == 0)?(0):(0x3f800000));
PV0i.w = R5i.w;
// 9 --- Point fo Interest
R5i.x = floatBitsToInt(mul_nonIEEE(intBitsToFloat(PV0i.w), intBitsToFloat(uf_remappedPS[1].x))); // Default implmentation division took place here
PV1i.y = floatBitsToInt(mul_nonIEEE(intBitsToFloat(PV0i.z), intBitsToFloat(uf_remappedPS[1].x))); // Default implmentation division took place here
R5i.x = floatBitsToInt(mul_nonIEEE(intBitsToFloat(PV0i.w), intBitsToFloat(uf_remappedPS[1].x))); // Default implementation division took place here - useless though
PV1i.y = floatBitsToInt(mul_nonIEEE(intBitsToFloat(PV0i.z), intBitsToFloat(uf_remappedPS[1].x) / resX)); // Default implementation division took place here
PV1i.z = floatBitsToInt(max(intBitsToFloat(PV0i.x), -(intBitsToFloat(PV0i.x))));
R3i.w = floatBitsToInt(mul_nonIEEE(intBitsToFloat(PV0i.z), intBitsToFloat(uf_remappedPS[1].y))); // Default implmentation division took place here
R3i.w = floatBitsToInt(mul_nonIEEE(intBitsToFloat(PV0i.z), intBitsToFloat(uf_remappedPS[1].y) / resY)); // Default implementation division took place here
PS1i = floatBitsToInt(mul_nonIEEE(intBitsToFloat(R1i.x), intBitsToFloat(PV0i.z)));
// 10 --- Point of Interest
R127i.x = floatBitsToInt(intBitsToFloat(PV1i.z) * intBitsToFloat(R127i.y)); // Divide looks good same as below line ----------------------------------------------------------------------
R127i.x = clampFI32(R127i.x); // Divide looks good same as above line----------------------------------------------------------------------------------------------------
PV0i.x = R127i.x;
R127i.y = floatBitsToInt((mul_nonIEEE(intBitsToFloat(R5i.w),intBitsToFloat(uf_remappedPS[1].y)) + intBitsToFloat(PV1i.y))); // Default implmentation division took place here
R127i.y = floatBitsToInt((mul_nonIEEE(intBitsToFloat(R5i.w),intBitsToFloat(uf_remappedPS[1].y)) + intBitsToFloat(PV1i.y))); // Default implementation division took place here
R127i.z = floatBitsToInt((mul_nonIEEE(intBitsToFloat(R1i.z),intBitsToFloat(R5i.w)) + intBitsToFloat(PS1i)));
PV0i.z = R127i.z;
PV0i.w = floatBitsToInt(mul_nonIEEE(intBitsToFloat(R2i.z), intBitsToFloat(R4i.z)));
@ -681,7 +681,6 @@ passPixelColor0 = vec4(intBitsToFloat(R3i.x), intBitsToFloat(R3i.y), intBitsToFl
#define Subpix $subPix //[0.000 to 1.000] Choose the amount of sub-pixel aliasing removal.
#define EdgeThreshold $edgeThreshold //[0.000 to 1.000] Edge detection threshold. The minimum amount of local contrast required to apply algorithm.
#define EdgeThresholdMin $edgeThresholdMin //[0.000 to 1.000] Darkness threshold. Trims the algorithm from processing darks.
#define FxaaAdjust $fxaaAdjust //[0.0 to 4.0] Adjusts how smooth or sharp you want AA to be.
/*--------------------------------------------------------------------------*/
@ -1018,7 +1017,7 @@ FxaaFloat4 FxaaPixelShader(
}
vec2 RcpFrame = vec2(1.0 / resolution.x, 1.0 / resolution.y) * uf_fragCoordScale * FxaaAdjust;
vec2 RcpFrame = vec2(1.0 / resolution.x, 1.0 / resolution.y) * uf_fragCoordScale;
void main()
{
passPixelColor0 = FxaaPixelShader(passParameterSem2.xy, textureUnitPS0, textureUnitPS1, RcpFrame, Subpix, EdgeThreshold, EdgeThresholdMin);

View File

@ -7,10 +7,10 @@
// Used for: Removing/Restoring the native BotW World Anti-Aliasing Implementation
#define preset $preset
#define aaSharper $aaSharper
#define aaBlurrier $aaBlurrier
#define aaSharper $worldSharper
#define aaBlurrier $worldBlurrier
#if (preset == 0)
#if (preset == 0) // Native AA Disabled
layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf49b1800 res 1280x720x1 dim 1 tm: 4 format 0019 compSel: 0 1 2 3 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 2 2 2 border: 1
layout(location = 0) in vec4 passParameterSem2;
layout(location = 0) out vec4 passPixelColor0;
@ -20,7 +20,7 @@ passPixelColor0 = texture(textureUnitPS0, passParameterSem2.xy);
}
#endif
#if (preset == 1)
#if (preset == 1) // Native AA Enabled
uniform ivec4 uf_remappedPS[4];
layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf462d000 res 1280x720x1 dim 1 tm: 4 format 0019 compSel: 0 1 2 3 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 2 2 2 border: 1
layout(binding = 1) uniform sampler2D textureUnitPS1;// Tex1 addr 0x37f40000 res 1280x720x1 dim 1 tm: 4 format 0001 compSel: 0 4 4 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler1 ClampX/Y/Z: 2 2 2 border: 1
@ -84,7 +84,7 @@ R127f.w = min(R1f.z, R1f.x);
R127f.x = min(R1f.w, R1f.y);
PS0f = R127f.x;
// 1
R123f.x = (mul_nonIEEE(R2f.y,intBitsToFloat(uf_remappedPS[0].y)) + PV0f.z);
R123f.x = (mul_nonIEEE(R2f.y,intBitsToFloat(uf_remappedPS[0].y) * resX ) + PV0f.z); // Important line - multiply y - bundled with main point of interests looks better
PV1f.x = R123f.x;
PV1f.y = max(R1f.z, R1f.x);
R127f.z = PV0f.y + -(PV0f.x);
@ -115,8 +115,8 @@ PV1f.y = mul_nonIEEE(R126f.w, PS0f);
PV0f.z = max(PV1f.x, -(intBitsToFloat(uf_remappedPS[2].y)));
PV0f.w = max(PV1f.y, -(intBitsToFloat(uf_remappedPS[2].y)));
// 7 --- Point of Interest
R3f.x = min(PV0f.w, intBitsToFloat(uf_remappedPS[2].y)); // Important - Divide looks sharper and better and multiply looks blurier fuzzy
R1f.y = min(PV0f.z, intBitsToFloat(uf_remappedPS[2].y)); // Important - Divide looks sharper and better and multiply looks blurier fuzzy
R3f.x = min(PV0f.w, intBitsToFloat(uf_remappedPS[2].y)); // Important - Another way to do it - Divide looks sharper and better and multiply looks blurier fuzzy
R1f.y = min(PV0f.z, intBitsToFloat(uf_remappedPS[2].y)); // Important - Another Way to do it - Divide looks sharper and better and multiply looks blurier fuzzy
// 8
predResult = (R1f.x > R0f.z);
activeMaskStack[1] = predResult;
@ -173,13 +173,12 @@ passPixelColor0 = vec4(R2f.x, R2f.y, R2f.z, R2f.w);
}
#endif
#if (preset == 2)
#if (preset == 2) // FXAA
/*-----------------------------settings-------------------------------------*/
#define Subpix $subPix //[0.000 to 1.000] Choose the amount of sub-pixel aliasing removal.
#define EdgeThreshold $edgeThreshold //[0.000 to 1.000] Edge detection threshold. The minimum amount of local contrast required to apply algorithm.
#define EdgeThresholdMin $edgeThresholdMin //[0.000 to 1.000] Darkness threshold. Trims the algorithm from processing darks.
#define FxaaAdjust $fxaaAdjust //[0.0 to 4.0] Adjusts how smooth or sharp you want AA to be.
/*--------------------------------------------------------------------------*/
@ -190,6 +189,7 @@ layout(location = 0) out vec4 passPixelColor0;
uniform vec2 uf_fragCoordScale;
vec2 resolution = textureSize2D(textureUnitPS0,0); // Retrieve Texture Dimensions in float data type so we dont need to convert
const float resRatio = resolution.x/1280; // Needed in multiplying
#define FXAA_QUALITY__PS 12
#define FXAA_QUALITY__P0 1.0
@ -239,8 +239,8 @@ FxaaFloat4 FxaaPixelShader(
FxaaFloat2 posM;
posM.x = pos.x;
posM.y = pos.y;
FxaaFloat4 rgbyM = vec4(FxaaTexTop(tex, posM).xyz, FxaaTexTop(lum, posM).x);
#define lumaM rgbyM.w
FxaaFloat4 rgbyM = vec4(FxaaTexTop(tex, posM).xyz, FxaaTexTop(lum, posM).x / resRatio); // Important Line
#define lumaM rgbyM.w // Important line
FxaaFloat4 luma4A = textureGather(lum, posM);
FxaaFloat4 luma4B = textureGatherOffset(lum, posM, FxaaInt2(-1, -1));
#define lumaE luma4A.z
@ -263,14 +263,14 @@ FxaaFloat4 FxaaPixelShader(
FxaaBool earlyExit = range < rangeMaxClamped;
if(earlyExit)
return rgbyM;
FxaaFloat lumaNE = FxaaTexOff(lum, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy).x;
FxaaFloat lumaSW = FxaaTexOff(lum, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy).x;
FxaaFloat lumaNE = FxaaTexOff(lum, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy).x / resRatio; // Important divide x
FxaaFloat lumaSW = FxaaTexOff(lum, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy).x / resRatio; // Important divide x
FxaaFloat lumaNS = lumaN + lumaS;
FxaaFloat lumaWE = lumaW + lumaE;
FxaaFloat subpixRcpRange = 1.0/range;
FxaaFloat subpixNSWE = lumaNS + lumaWE;
FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;
FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;
FxaaFloat edgeHorz1 = (lumaM) + lumaNS; // Important line due to lumaM
FxaaFloat edgeVert1 = (lumaM) + lumaWE; // Important line due to lumaM
FxaaFloat lumaNESE = lumaNE + lumaSE;
FxaaFloat lumaNWNE = lumaNW + lumaNE;
FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;
@ -516,7 +516,7 @@ FxaaFloat4 FxaaPixelShader(
}
vec2 RcpFrame = vec2(1.0 / resolution.x, 1.0 / resolution.y) * uf_fragCoordScale * FxaaAdjust; // This is where the dimensions are used, Fxaaadjust can make it sharp to blurry
vec2 RcpFrame = vec2(1.0 / resolution.x, 1.0 / resolution.y) * uf_fragCoordScale;
void main()
{
passPixelColor0 = FxaaPixelShader(passParameterSem2.xy, textureUnitPS0, textureUnitPS1, RcpFrame, Subpix, EdgeThreshold, EdgeThresholdMin);

View File

@ -2,48 +2,54 @@
titleIds = 00050000101C9300,00050000101C9400,00050000101C9500
name = Anti-Aliasing
path = "The Legend of Zelda: Breath of the Wild/Graphics/Anti-Aliasing"
description = Enables and Disables Native Botw Anti-Aliasing. Also includes an alternative FXAA implementation. Check the "Anti-Aliasing/rules.txt" file in your Botw AA graphicPack folder for info about the individual settings.
description = Enables or Disables Native Botw Anti-Aliasing. Also includes an alternative FXAA implementation. Check the "Anti-Aliasing/rules.txt" file in your Botw AA graphicPack folder for info about the individual settings.
version = 3
[Preset]
name = Disable Native AA
$preset:int = 0
#
$aaSharper = 0.5 # Ignore
$aaBlurrier = 0.0 # Ignore
$inventorySharper = 0.0 # Ignore
$inventoryBlurrier = 0.0 # Ignore
$worldSharper = 0.0 # Ignore
$worldBlurrier = 0.0 # Ignore
#
$subPix = 0.75 # Ignore
$edgeThreshold = 0.0166 # Ignore
$edgeThresholdMin = 0.0833 # Ignore
$fxaaAdjust = 1.0 # Ignore
[Preset]
name = Enable Native AA
$preset:int = 1
#
$aaSharper = 0.5
$aaBlurrier = 0.0
$inventorySharper = 0.0
$inventoryBlurrier = 0.0
$worldSharper = 0.0
$worldBlurrier = 0.0
#
$subPix = 0.75 # Ignore
$edgeThreshold = 0.0166 # Ignore
$edgeThresholdMin = 0.0833 # Ignore
$fxaaAdjust = 1.0 # Ignore
[Preset]
name = FXAA
$preset:int = 2
#
$aaSharper = 0.5 # Ignore
$aaBlurrier = 0.0 # Ignore
$inventorySharper = 0.0 # Ignore
$inventoryBlurrier = 0.0 # Ignore
$worldSharper = 0.0 # Ignore
$worldBlurrier = 0.0 # Ignore
#
$subPix = 1.0
$edgeThreshold = 0.0125
$edgeThresholdMin = 0.0625
$fxaaAdjust = 2.0
# aaSharper / aaBlurrier - Only applies to enabled preset
# Adjusts native AA implmentation
# Values - [0.0 - 1.0] - keep one of the varaibles at 0 while adjusting the other one
# Adjust native AA implmentation - Only applies to Enabled preset
# --- keep one of the varaibles at 0 while adjusting the other one
# Sharper : Values - [0.0 - 1.0] - Recommended to Raise in increments of 0.1
# Blurrier : Values - [1.0 - 0.0] - Recommended to Lower in decrements of 0.1
# Subpix:
# Choose the amount of sub-pixel aliasing removal.
@ -68,9 +74,5 @@ $fxaaAdjust = 2.0
# 0.0625 - high quality (faster)
# 0.0312 - visible limit (slower)
# FxaaAdjust
# Makes FXAA more clearer or blurrier
# [0.0 - 1.0] values are used to divide by Var x 0.2
# [1.0 - 4.0] are used to multiply by Var x 2.0
# Credit: Kiri, NAVras
# Credit: SkalFate for proper V3 Import.

View File

@ -155,9 +155,9 @@ R5i.w = ((PV1i.x == 0)?(0):(0x3f800000));
PV0i.w = R5i.w;
// 9 --- Point fo Interest
R5i.x = floatBitsToInt(mul_nonIEEE(intBitsToFloat(PV0i.w), intBitsToFloat(uf_remappedPS[1].x))); // Default implmentation division took place here
PV1i.y = floatBitsToInt(mul_nonIEEE(intBitsToFloat(PV0i.z), intBitsToFloat(uf_remappedPS[1].x))); // Default implmentation division took place here
PV1i.y = floatBitsToInt(mul_nonIEEE(intBitsToFloat(PV0i.z), intBitsToFloat(uf_remappedPS[1].x) / resX)); // Default implmentation division took place here
PV1i.z = floatBitsToInt(max(intBitsToFloat(PV0i.x), -(intBitsToFloat(PV0i.x))));
R3i.w = floatBitsToInt(mul_nonIEEE(intBitsToFloat(PV0i.z), intBitsToFloat(uf_remappedPS[1].y))); // Default implmentation division took place here
R3i.w = floatBitsToInt(mul_nonIEEE(intBitsToFloat(PV0i.z), intBitsToFloat(uf_remappedPS[1].y) / resY)); // Default implmentation division took place here
PS1i = floatBitsToInt(mul_nonIEEE(intBitsToFloat(R1i.x), intBitsToFloat(PV0i.z)));
// 10 --- Point of Interest
R127i.x = floatBitsToInt(intBitsToFloat(PV1i.z) * intBitsToFloat(R127i.y)); // Divide looks good same as below line ----------------------------------------------------------------------

View File

@ -67,7 +67,7 @@ R127f.w = min(R1f.z, R1f.x);
R127f.x = min(R1f.w, R1f.y);
PS0f = R127f.x;
// 1
R123f.x = (mul_nonIEEE(R2f.y,intBitsToFloat(uf_remappedPS[0].y)) + PV0f.z);
R123f.x = (mul_nonIEEE(R2f.y,intBitsToFloat(uf_remappedPS[0].y) * resX ) + PV0f.z); //Important line
PV1f.x = R123f.x;
PV1f.y = max(R1f.z, R1f.x);
R127f.z = PV0f.y + -(PV0f.x);