Can someone help porting Pirate_Kitty's FXAA?

  • Posts: 1
3 months 1 week ago #1 by InsertDisc2
Hey folks!

Since i dont have an idea of programming these kinda files ima just gonna ask here. I recently discovered an older (for me better) version of an FXAA effect from Pirate_Kitty, but unfortunately it's not working on the newer versions. Is it possible to port it over and make it working again without alot hassle. Much appreciate if someone could look into this.

The code looks like this:

//===================================================================================================================
#include "Pirate_Global.fxh"
//===================================================================================================================

uniform float FXAA_RADIUS <
ui_label = "FXAA - Radius";
ui_type = "drag";
ui_min = 0.5; ui_max = 2.0;
ui_tooltip = "Try to keep close to 1.0.";
> = 1.0;
uniform float FXAA_STRENGTH <
ui_label = "FXAA - Strength";
ui_type = "drag";
ui_min = 0.0001; ui_max = 1.0;
ui_tooltip = "Self Explanatory.";
> = 1.0;
uniform bool FXAA_DEBUG <
ui_label = "FXAA - Debug";
ui_tooltip = "Shows which area of the screen is being blurred.";
> = false;

//===================================================================================================================
//===================================================================================================================

float4 FastFXAA(float4 colorIN : COLOR, float2 coord : TEXCOORD) : COLOR {
const float2 tap[8] = {
float2(1.0, 0.0),
float2(-1.0, 0.0),
float2(0.0, 1.0),
float2(0.0, -1.0),
float2(-1.0, -1.0),
float2( 1.0, -1.0),
float2( 1.0, 1.0),
float2(-1.0, 1.0)
};
float4 ret;
float edge;
float3 blur = colorIN.rgb;
float intensity = dot(blur, 0.3333);

for(int i=0; i < 8; i++) {
ret = tex2D(SamplerColor, coord + tap * PixelSize * FXAA_RADIUS);
float weight = abs(intensity - dot(ret.rgb, 0.33333));
blur = lerp(blur, ret.rgb, weight / 8);
edge += weight;
}

edge /= 8;
ret.rgb = lerp(colorIN.rgb, blur, FXAA_STRENGTH);

if (FXAA_DEBUG) ret.rgb = edge;

return ret;
}

//===================================================================================================================
//===================================================================================================================

float4 PS_FXAA(float4 vpos : SV_Position, float2 texcoord : TEXCOORD) : COLOR
{
return FastFXAA(tex2D(SamplerColor, texcoord), texcoord);
}

//===================================================================================================================
//===================================================================================================================

technique Pirate_FXAA
{
pass FXAA_Pass
{
VertexShader = VS_PostProcess;
PixelShader = PS_FXAA;
}
}

it just gives compiling errors in new reshade versions.

Please Log in or Create an account to join the conversation.

  • Posts: 206
3 months 1 week ago #2 by Duran.te
It does work with the current version as well.
You need to place "Pirate_Global.fxh" in your Shaders folder, too.

github.com/Heathen/Pirate-Shaders

Please Log in or Create an account to join the conversation.