Quantcast

Jump to content

» «
Photo

[GTAIV|REL|BETA] ENBSeries graphic modification

24,755 replies to this topic
remington122
  • remington122

    w02f

  • Members
  • Joined: 20 Jun 2011

#23041

Posted 22 June 2011 - 06:55 PM

using codes from Dpeasant3 and gp65cj04. Thanks guys, you're geniuses! :3
and thanks to Icelaglace too ^^
user posted image user posted image

EnbTester
  • EnbTester

    Rat

  • BUSTED!
  • Joined: 11 May 2011

#23042

Posted 22 June 2011 - 07:32 PM

DKT70
Do you remember your video "RealityIV Bloom Test - GTAIV "
can u post a link for the settings u used in there

HexagoN
  • HexagoN

    Greenback Boogie

  • Members
  • Joined: 16 May 2011
  • None

#23043

Posted 22 June 2011 - 08:18 PM

user posted image

Dpeasant, thanks for new effect.txt. This is awesome! smile.gif

ninilenain1
  • ninilenain1

    Player Hater

  • Members
  • Joined: 31 Jan 2011

#23044

Posted 22 June 2011 - 08:21 PM

QUOTE (Dpeasant3 @ Wednesday, Jun 22 2011, 17:07)
This is a 3-pass effect.txt i use with AA. so youll get FXAA(with lowered qulity) + colourshift + sharpening + noise. You should edit it to your tastes.


CODE
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//http://enbdev.com
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/*
THIS IS HLSL FILE FORMAT FOR EXECUTING ADDITIONAL
POST PROCESSING EFFECTS. MAKE THE COPY BEFORE CHANGING IT!
*/

//enable blurring, useless, disabled at all
//#define EBLURRING

//enable sharpening
#define ESHARPENING

//if defined, color sharpen, otherwise sharp by gray
#define ESHARPENINGCOLOR

//enable noise in dark areas
#define ENOISE


float ShiftSamplingRange=0.1;
float SamplingRange=1.0; //sharpening or blurring range
float SharpeningAmount=9.5;
float ScanLineAmount=0.0;
float ScanLineRepeat=1.0; //0.5, 0.3333, 0.25, 0.125, so on
float NoiseAmount=0.22;


//keyboard controled variables
float tempF1;
float tempF2;
float tempF3;
float tempF4;
float tempF5;
float tempF6;
float tempF7;
float tempF8;
float tempF9;
float tempF0;

//global variables, already set before executing this code
float ScreenSize; //width of the display resolution (1920 f.e.)
float ScreenScaleY; //screen proportions (1.333 for 1920/1080)

//textures
texture2D texColor;
texture2D texNoise;

sampler2D SamplerColor = sampler_state
{
Texture = <texColor>;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = NONE;//NONE;
AddressU = Clamp;
AddressV = Clamp;
SRGBTexture=FALSE;
MaxMipLevel=0;
MipMapLodBias=0;
};

sampler2D SamplerNoise = sampler_state
{
Texture = <texNoise>;
MinFilter = POINT;
MagFilter = POINT;
MipFilter = NONE;//NONE;
AddressU = Wrap;
AddressV = Wrap;
SRGBTexture=FALSE;
MaxMipLevel=0;
MipMapLodBias=0;
};

struct VS_OUTPUT_POST {
float4 vpos : POSITION;
float2 txcoord : TEXCOORD0;
};

struct VS_INPUT_POST {
float3 pos : POSITION;
float2 txcoord : TEXCOORD0;
};

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
VS_OUTPUT_POST VS_PostProcess(VS_INPUT_POST IN)
{
VS_OUTPUT_POST OUT;

float4 pos=float4(IN.pos.x,IN.pos.y,IN.pos.z,1.0);

OUT.vpos=pos;
OUT.txcoord.xy=IN.txcoord.xy;

return OUT;
}

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//--------------------Fast Approximate Anti-Aliasing --------------------------
// FXAA v2 CONSOLE by TIMOTHY LOTTES @ NVIDIA
// Ported to ENBSeries by MysTer92 (Svyatoslav Gampel)
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++






float4 PS_PostProcess(VS_OUTPUT_POST i) : COLOR
{
#define FXAA_SUBPIX_SHIFT (1.0/8.0)
#define FXAA_REDUCE_MIN (1.0/16.0)
#define FXAA_REDUCE_MUL (1.0/16.0)
#define FXAA_SPAN_MAX 8.0

half2 rcpFrame = half2(1/ScreenSize, 1/(ScreenSize/ScreenScaleY));

half4 posPos;
posPos.xy = i.txcoord.xy;
posPos.zw = posPos.xy - (rcpFrame.xy * (0.5 + FXAA_SUBPIX_SHIFT));

half3 rgbNW = tex2D(SamplerColor, posPos.zw ).xyz;
half3 rgbNE = tex2D(SamplerColor, posPos.zw + half2(rcpFrame.x, 0.0) ).xyz;
half3 rgbSW = tex2D(SamplerColor, posPos.zw + half2(0.0, rcpFrame.y) ).xyz;
half3 rgbSE = tex2D(SamplerColor, posPos.zw +rcpFrame.xy ).xyz;
half3 rgbM = tex2D(SamplerColor, posPos.xy).xyz;

half3 luma = half3(0.299, 0.587, 0.114);
half lumaNW = dot(rgbNW, luma);
half lumaNE = dot(rgbNE, luma);
half lumaSW = dot(rgbSW, luma);
half lumaSE = dot(rgbSE, luma);
half lumaM = dot(rgbM, luma);

half lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));
half lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));

half2 dir;

half lumaNWNE = lumaNW + lumaNE;
half lumaSWSE = lumaSW + lumaSE;

dir.x = -((lumaNWNE) - (lumaSWSE));
dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));

half dirReduce = max( (lumaSWSE + lumaNWNE) * (0.25 * FXAA_REDUCE_MUL),
FXAA_REDUCE_MIN);
half rcpDirMin = 1.0/(min(abs(dir.x), abs(dir.y)) + dirReduce);
dir = min(half2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),
max(half2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),
dir * rcpDirMin)) * rcpFrame.xy;

half3 rgbA = (1.0/2.0) * (
tex2D(SamplerColor, posPos.xy + dir * (1.0/3.0 - 0.5) ).xyz +
tex2D(SamplerColor, posPos.xy + dir * (2.0/3.0 - 0.5) ).xyz);
half3 rgbB = rgbA * (1.0/2.0) + (1.0/4.0) * (
tex2D(SamplerColor, posPos.xy + dir * (0.0/3.0 - 0.5) ).xyz +
tex2D(SamplerColor, posPos.xy + dir * (3.0/3.0 - 0.5) ).xyz);
half lumaB = dot(rgbB, luma);

if((lumaB < lumaMin) || (lumaB > lumaMax))
return half4(rgbA, 1.0);

return float4(rgbB, 1.0);
}


float4 PS_PostProcess5(VS_OUTPUT_POST IN, float2 vPos : VPOS) : COLOR
{
float4 res;
float4 coord=0.0;

coord.xy=IN.txcoord.xy;
float4 origcolor;

coord.w=0.0;


origcolor=tex2Dlod(SamplerColor, coord);

// coord.x=IN.txcoord.x-(1.5/ScreenSize);
// float4 lshift=tex2Dlod(SamplerColor, coord);
// coord.x=IN.txcoord.x+(1.5/ScreenSize);
// float4 rshift=tex2Dlod(SamplerColor, coord);


float2 offset[8]=
{
float2(1.0, 1.0),
float2(-1.0, -1.0),
float2(-1.0, 1.0),
float2(1.0, -1.0),

float2(1.41, 0.0),
float2(-1.41, 0.0),
float2(0.0, 1.41),
float2(0.0, -1.41)
};
int i=0;

float4 tcol=origcolor;
float invscreensize=1.0/ScreenSize;
//for (i=0; i<8; i++) //higher quality
for (i=0; i<8; i++)
{
float2 tdir=offset[i].xy;
coord.xy=IN.txcoord.xy+tdir.xy*invscreensize*SamplingRange;//*1.0;
float4 ct=tex2Dlod(SamplerColor, coord);

tcol+=ct;
}
tcol*=0.111; // 1.0/(4+1)
//tcol*=0.111; // 1.0/(8+1) //higher quality


/*
//not interesting
#ifdef EBLURRING
//blur
res=tcol;
#endif
*/

//sharp
#ifdef ESHARPENING

#ifdef ESHARPENINGCOLOR
//color
res=origcolor*(1.0+((origcolor-tcol)*SharpeningAmount));
#else
//non color
float difffact=dot((origcolor.xyz-tcol.xyz), 0.333);
res=origcolor*(1.0+difffact*SharpeningAmount);
#endif

//less sharpening for bright pixels
float rgray=origcolor.z; //blue fit well
//float rgray=max(origcolor.x, max(origcolor.y, origcolor.z));
rgray=pow(rgray, 3.0);
res=lerp(res, origcolor, saturate(rgray));

#endif




//grain noise
#ifdef ENOISE
float origgray=max(res.x, res.y);//dot(res.xyz, 0.333);
origgray=max(origgray, res.z);
coord.xy=IN.txcoord.xy*16.0 + origgray;
float4 cnoi=tex2Dlod(SamplerNoise, coord);
res=lerp(res, (cnoi.x+0.5)*res, NoiseAmount*saturate(1.0-origgray*1.8));
#endif


res.w=1.0;
return res;
}

float4 PS_Process6(VS_OUTPUT_POST IN, float2 vPos : VPOS) : COLOR
{
float4 res;
float4 coord=0.0;

coord.xy=IN.txcoord.xy;
float4 origcolor;

coord.w=0.0;


origcolor=tex2Dlod(SamplerColor, coord);

// coord.x=IN.txcoord.x-(1.5/ScreenSize);
// float4 lshift=tex2Dlod(SamplerColor, coord);
// coord.x=IN.txcoord.x+(1.5/ScreenSize);
// float4 rshift=tex2Dlod(SamplerColor, coord);


float2 offset[8]=
{
float2(1.0, 1.0),
float2(-1.0, -1.0),
float2(-1.0, 1.0),
float2(1.0, -1.0),

float2(1.41, 0.0),
float2(-1.41, 0.0),
float2(0.0, 1.41),
float2(0.0, -1.41)
};
int i=0;

float4 tcol=origcolor;
float2 invscreensize=1.0/ScreenSize;
invscreensize.y=invscreensize.y/ScreenScaleY;
//for (i=0; i<8; i++) //higher quality
/* for (i=0; i<4; i++)
{
float2 tdir=offset[i].xy;
coord.xy=IN.txcoord.xy+tdir.xy*invscreensize*SamplingRange;//*1.0;
float4 ct=tex2Dlod(SamplerColor, coord);

tcol+=ct;
}
tcol*=0.2; // 1.0/(4+1)
//tcol*=0.111; // 1.0/(8+1) //higher quality
*/

coord.xy=IN.txcoord.xy;
origcolor=tex2Dlod(SamplerColor, coord);
res.y=origcolor.y;

coord.xy=IN.txcoord.xy;
coord.y-=invscreensize*ShiftSamplingRange;
origcolor=tex2Dlod(SamplerColor, coord);
res.x=origcolor.x;

coord.xy=IN.txcoord.xy;
coord.y+=invscreensize*ShiftSamplingRange;
origcolor=tex2Dlod(SamplerColor, coord);
res.z=origcolor.z;


res.w=1.0;
return res;
}


//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//--------------------Fast Approximate Anti-Aliasing Techniques -------------
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

technique PostProcess
{
pass P0
{
VertexShader = compile vs_3_0 VS_PostProcess();
PixelShader = compile ps_3_0 PS_PostProcess();

FogEnable=FALSE;
ALPHATESTENABLE=FALSE;
SEPARATEALPHABLENDENABLE=FALSE;
AlphaBlendEnable=FALSE;
FogEnable=FALSE;
SRGBWRITEENABLE=FALSE;
}
}
technique PostProcess2
{
pass P0
{

VertexShader = compile vs_3_0 VS_PostProcess();
PixelShader = compile ps_3_0 PS_PostProcess5();

DitherEnable=FALSE;
ZEnable=FALSE;
CullMode=NONE;
ALPHATESTENABLE=FALSE;
SEPARATEALPHABLENDENABLE=FALSE;
AlphaBlendEnable=FALSE;
StencilEnable=FALSE;
FogEnable=FALSE;
SRGBWRITEENABLE=FALSE;
}
}
technique PostProcess3
{
pass P0
{

VertexShader = compile vs_3_0 VS_PostProcess();
PixelShader = compile ps_3_0 PS_Process6();

DitherEnable=FALSE;
ZEnable=FALSE;
CullMode=NONE;
ALPHATESTENABLE=FALSE;
SEPARATEALPHABLENDENABLE=FALSE;
AlphaBlendEnable=FALSE;
StencilEnable=FALSE;
FogEnable=FALSE;
SRGBWRITEENABLE=FALSE;
}
}

Hello dpeasant and all the modders
I have a few question about FXAA and AA

i tried two solutions :
- your settings with FXAA and without AA look very well (a few aliasing about some objects but nothing important)
- your settings with FXAA and with AA (I tried AA=2) lookk pretty well too but for me not so good as without AA

So why not to give up AA and improve FXAA that seems to be a good way to improve the global quality of the game without owning a big graphic card?
I know you ve focused the development of your settings with AA but it seems to work well without so...

Anyway, your settings are awesome and you are my favorite modder sigh.gif
Thanks to all

AlexFake
  • AlexFake

    Gamer!

  • Members
  • Joined: 12 Nov 2010

#23045

Posted 22 June 2011 - 08:42 PM Edited by AlexFake, 22 June 2011 - 08:46 PM.

Use: FXAA v2 effect.txt Original. My own timecyc. My own enbeffect (with jumper_311 dof code) & enbseries. 082b7. AA f*ck off false!

user posted imageuser posted image
user posted imageuser posted image
user posted imageuser posted image
user posted imageuser posted image

I love FXAA!

ninilenain1
  • ninilenain1

    Player Hater

  • Members
  • Joined: 31 Jan 2011

#23046

Posted 22 June 2011 - 08:59 PM

hello Alex
where can i find this?
your latest settings? (your last deposit files date from 15-5-2011)

AlexFake
  • AlexFake

    Gamer!

  • Members
  • Joined: 12 Nov 2010

#23047

Posted 22 June 2011 - 09:03 PM

QUOTE (ninilenain1 @ Wednesday, Jun 22 2011, 20:59)
hello Alex
where can i find this?
your latest settings? (your last deposit files date from 15-5-2011)

special for gtaforums i post my closed beta test setts from 12 of june 2011. Its non latest my cfg!!!

http://rghost.ru/10445061
pswrd: 0o9i8u7y

ninilenain1
  • ninilenain1

    Player Hater

  • Members
  • Joined: 31 Jan 2011

#23048

Posted 22 June 2011 - 09:31 PM

Thx Alex
i m trying it now icon14.gif


squared
  • squared

    Player Hater

  • Members
  • Joined: 22 Jun 2011

#23049

Posted 22 June 2011 - 09:39 PM

QUOTE (AlexFake @ Wednesday, Jun 22 2011, 21:03)
QUOTE (ninilenain1 @ Wednesday, Jun 22 2011, 20:59)
hello Alex
where can i find this?
your latest settings? (your last deposit files date from 15-5-2011)

special for gtaforums i post my closed beta test setts from 12 of june 2011. Its non latest my cfg!!!

http://rghost.ru/10445061
pswrd: 0o9i8u7y

Holy s**t! I just tried this out w/ my other mods, and I gotta say, it's one of the best I've come across yet! So thank you!

user posted image

user posted image

user posted image

ikt
  • ikt

    *poof*

  • Members
  • Joined: 02 Oct 2006
  • None

#23050

Posted 22 June 2011 - 09:42 PM

I can't seem to implement the adaptive DoF code in Dpeasants enbeffect.fx.

How did you guys manage to do that?

Jigglyass
  • Jigglyass

    Homie

  • Members
  • Joined: 18 Dec 2008
  • None

#23051

Posted 22 June 2011 - 09:54 PM

Is there a version of alice that works with patch 7? Primarily want o use it for that in game enb editor...

ninilenain1
  • ninilenain1

    Player Hater

  • Members
  • Joined: 31 Jan 2011

#23052

Posted 22 June 2011 - 10:01 PM

hello alex
not working for me (too dark and saturated colors)
you are working with patch 1.0.0.4 ? (and I ve got 1.0.4.0)

doesn't matter , keep up your work!!! confused.gif

ninilenain1
  • ninilenain1

    Player Hater

  • Members
  • Joined: 31 Jan 2011

#23053

Posted 22 June 2011 - 10:07 PM

QUOTE (squared @ Wednesday, Jun 22 2011, 21:39)
QUOTE (AlexFake @ Wednesday, Jun 22 2011, 21:03)
QUOTE (ninilenain1 @ Wednesday, Jun 22 2011, 20:59)
hello Alex
where can i find this?
your latest settings? (your last deposit files date from 15-5-2011)

special for gtaforums i post my closed beta test setts from 12 of june 2011. Its non latest my cfg!!!

http://rghost.ru/10445061
pswrd: 0o9i8u7y

Holy s**t! I just tried this out w/ my other mods, and I gotta say, it's one of the best I've come across yet! So thank you!

user posted image

user posted image

user posted image

hello very beautiful screens!!! icon14.gif
what patch did u use? (1.0.0.4 or 1.0.4.0?)
alex settings don't work for me (too dark or too bright)
can you post your settings pliz?

THX

tomtom38
  • tomtom38

    Player Hater

  • Members
  • Joined: 19 Jun 2011

#23054

Posted 22 June 2011 - 10:17 PM

Reinstalled from scratch to try out Alexfake's config.
Reconciled me with ENB.

Plain awesome. Thanks a lot for sharing your work.

---Clean install from scratch | Patch 1.0.0.4 | Copy-pasta worked fine.

AlexFake
  • AlexFake

    Gamer!

  • Members
  • Joined: 12 Nov 2010

#23055

Posted 22 June 2011 - 10:30 PM

AA false. FXAA. SSAO.
user posted imageuser posted image
user posted imageuser posted image
user posted imageuser posted image
user posted image


tomtom38
  • tomtom38

    Player Hater

  • Members
  • Joined: 19 Jun 2011

#23056

Posted 22 June 2011 - 10:50 PM Edited by tomtom38, 22 June 2011 - 11:57 PM.

Hey, Thanks again for your set.

But I do have one more question. In your screen it looks like AA'ed. I read the thread up, and if I don't get it wrong, it's FXAA.
Since I don't have it in-game actually, it seems I've missed a step.

When you say "Use: FXAA v2 effect.txt Original.", is it included in your config pack ? or is it the code a bit above in the thread ?
How could I get it on ?

Thanks !

---oookay, managed to activate.
Found FXAA_tweaked_for_ENBSeries.zip somewhere above, but lost the exact post confused.gif

Sharks80fr
  • Sharks80fr

    Mack Pimp

  • Members
  • Joined: 28 Apr 2011

#23057

Posted 23 June 2011 - 01:14 AM

FXAA is just amazing omg ...

user posted image

user posted image

fzn09
  • fzn09

    Rat

  • Members
  • Joined: 15 Jul 2009

#23058

Posted 23 June 2011 - 01:25 AM Edited by fzn09, 23 June 2011 - 01:43 AM.

QUOTE (Jakshi @ Wednesday, Jun 22 2011, 18:17)
Hey fzn 09 could you upload your enbeffect.fx and effect.txt. When I try to put the dof code into the file it brakes enb and it looks like vanilla. also i'm not sure if fxaa is working as it should.

here, works with dp3 set. no negative film like and bloom issues tounge.gif
i dont use the newest gps and dp3 effect.txt and enbeffec.fx, too much lag and jaggies for my rig sad.gif

http://www.mediafire...are9bdhfssyxkjk

user posted image
user posted image
user posted image
user posted image

which part in enbeffect.fx gives the bokeh DOF effect?

but i have this issues with based dp3 set, look the distance and the bloom behavior

user posted image
user posted image
user posted image
user posted image


i changed the config bloom,timecyc bloom, but didnt resolve this problem sad.gif

nkjellman
  • nkjellman

    Boss

  • Members
  • Joined: 28 Aug 2008
  • United-States

#23059

Posted 23 June 2011 - 01:29 AM

How do you guys get your clouds to be biger like that. Every attempt I have I only have a few tiny ones. Also you guys have more of them then I do.

luckymanhog
  • luckymanhog

    MacDiddy10

  • BUSTED!
  • Joined: 31 May 2011

#23060

Posted 23 June 2011 - 02:24 AM

QUOTE (squared @ Wednesday, Jun 22 2011, 21:39)
QUOTE (AlexFake @ Wednesday, Jun 22 2011, 21:03)
QUOTE (ninilenain1 @ Wednesday, Jun 22 2011, 20:59)
hello Alex
where can i find this?
your latest settings? (your last deposit files date from 15-5-2011)

special for gtaforums i post my closed beta test setts from 12 of june 2011. Its non latest my cfg!!!

http://rghost.ru/10445061
pswrd: 0o9i8u7y

Holy s**t! I just tried this out w/ my other mods, and I gotta say, it's one of the best I've come across yet! So thank you!

snip

snip

snip

What other mods you used besides this i like this 1.

NaidRaida
  • NaidRaida

    Inactive user

  • Members
  • Joined: 14 Dec 2010

#23061

Posted 23 June 2011 - 02:42 AM

QUOTE (ikt @ Wednesday, Jun 22 2011, 21:42)
I can't seem to implement the adaptive DoF code in Dpeasants enbeffect.fx.

How did you guys manage to do that?

You should ask ielaglace about that, or visit his help chat from his signature.
He helped me also with Dps settings. He has some kind of "already implemented" version of his code with this new DOF.

portal2x2
  • portal2x2

    HDRL By Portal2x2

  • Members
  • Joined: 20 Jun 2011

#23062

Posted 23 June 2011 - 03:10 AM

user posted image
http://fotki.yandex....x2/view/573881/
user posted image
http://fotki.yandex....x2/view/573879/
user posted image
http://fotki.yandex....x2/view/573875/
user posted image
http://fotki.yandex....x2/view/573872/
user posted image
http://fotki.yandex....x2/view/573868/
user posted image
http://fotki.yandex....x2/view/573861/

icelaglace
  • icelaglace

    See futures in balls

  • Members
  • Joined: 04 May 2011

#23063

Posted 23 June 2011 - 04:03 AM Edited by icelaglace, 23 June 2011 - 04:07 AM.

Here we go...



Preview of the upcoming settings.
Really almost done.
+ some surprises inside.


jumper_311
  • jumper_311

    Crackhead

  • Members
  • Joined: 22 Jun 2010

#23064

Posted 23 June 2011 - 04:40 AM Edited by jumper_311, 23 June 2011 - 05:14 AM.

QUOTE (AlexFake @ Wednesday, Jun 22 2011, 20:42)
  FXAA v2 effect.txt Original. My own timecyc. My own enbeffect (with jumper_311 dof code) & enbseries. 082b7. AA

I love FXAA!

Nice picture~AlexFake

but I just want to explain my dof code is from gp65cj04.that code is great! rolleyes.gif

gp65cj04
  • gp65cj04

    Snitch

  • Members
  • Joined: 07 Mar 2010

#23065

Posted 23 June 2011 - 05:32 AM

NVIDIA FXAA III.8 by TIMOTHY LOTTES

http://timothylottes...e-released.html


CODE


/*============================================================================
                        FXAA QUALITY - TUNING KNOBS
============================================================================*/
#ifndef FXAA_QUALITY__EDGE_THRESHOLD
   //
   // The minimum amount of local contrast required to apply algorithm.
   //
   // 1/3 - too little
   // 1/4 - low quality
   // 1/6 - default
   // 1/8 - high quality
   // 1/16 - overkill
   //
   #define FXAA_QUALITY__EDGE_THRESHOLD (1.0/6.0)
#endif
/*--------------------------------------------------------------------------*/
#ifndef FXAA_QUALITY__EDGE_THRESHOLD_MIN
   //
   // Trims the algorithm from processing darks.
   //
   // 1/32 - visible limit
   // 1/16 - high quality
   // 1/12 - upper limit (default, the start of visible unfiltered edges)
   //
   #define FXAA_QUALITY__EDGE_THRESHOLD_MIN (1.0/12.0)
#endif
/*--------------------------------------------------------------------------*/
#ifndef FXAA_QUALITY__SUBPIX_CAP
   //
   // Insures fine detail is not completely removed.
   // This partly overrides FXAA_SUBPIX_TRIM.
   //
   // 3/4 - default amount of filtering
   // 7/8 - high amount of filtering
   // 1 - no capping of filtering
   //
   #define FXAA_QUALITY__SUBPIX_CAP (3.0/4.0)
#endif
/*--------------------------------------------------------------------------*/
#ifndef FXAA_QUALITY__SUBPIX_TRIM
   //
   // Controls removal of sub-pixel aliasing,
   //
   // 1/2 - low removal (sharper but more sub-pixel aliasing)
   // 1/3 - medium removal
   // 1/4 - default removal
   // 1/8 - high removal
   // 0 - complete removal (softer but less sub-pixel aliasing)
   //
   #define FXAA_QUALITY__SUBPIX_TRIM (1.0/4.0)
#endif



effect.txt

CODE

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//http://enbdev.com
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/*
THIS IS HLSL FILE FORMAT FOR EXECUTING ADDITIONAL
POST PROCESSING EFFECTS. MAKE THE COPY BEFORE CHANGING IT!
*/

//keyboard controled variables
float tempF1;
float tempF2;
float tempF3;
float tempF4;
float tempF5;
float tempF6;
float tempF7;
float tempF8;
float tempF9;
float tempF0;

//global variables, already set before executing this code
float ScreenSize; //width of the display resolution (1920 f.e.)
float ScreenScaleY; //screen proportions (1.333 for 1920/1080)

//textures
texture2D texColor;

sampler2D SamplerColor = sampler_state
{
Texture   = <texColor>;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = NONE;//NONE;
AddressU  = Clamp;
AddressV  = Clamp;
SRGBTexture=FALSE;
MaxMipLevel=0;
MipMapLodBias=0;
};

struct VS_OUTPUT_POST {
float4 vpos  : POSITION;
float2 txcoord : TEXCOORD0;
};

struct VS_INPUT_POST {
float3 pos  : POSITION;
float2 txcoord : TEXCOORD0;
};

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
VS_OUTPUT_POST VS_PostProcess(VS_INPUT_POST IN)
{
VS_OUTPUT_POST OUT;

float4 pos=float4(IN.pos.x,IN.pos.y,IN.pos.z,1.0);

OUT.vpos=pos;
OUT.txcoord.xy=IN.txcoord.xy;

return OUT;
}


/*============================================================================
   FXAA3 QUALITY - PC
  NVIDIA FXAA III.8 by TIMOTHY LOTTES
============================================================================*/

   #define FXAA_LINEAR 0
   #define FXAA_QUALITY__EDGE_THRESHOLD (1.0/16.0)
   #define FXAA_QUALITY__EDGE_THRESHOLD_MIN (1.0/16.0)
   #define FXAA_QUALITY__SUBPIX_CAP (3.0/4.0)
   #define FXAA_QUALITY__SUBPIX_TRIM (1.0/4.0)
   #define FXAA_QUALITY__SUBPIX_TRIM_SCALE  (1.0/(1.0 - FXAA_QUALITY__SUBPIX_TRIM))
   #define FXAA_SEARCH_STEPS     8
   #define FXAA_SEARCH_THRESHOLD (1.0/4.0)

float4 FxaaPixelShader(VS_OUTPUT_POST IN, float2 vPos : VPOS) : COLOR
{  

#define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))
#define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))

float2 pos = IN.txcoord.xy;

float2 rcpFrame = float2(1/ScreenSize, ScreenScaleY/ScreenSize);
float4 rcpFrameOpt = float4(2/ScreenSize, 2*ScreenScaleY/ScreenSize, 0.5/ScreenSize, 0.5*ScreenScaleY/ScreenSize);

float lumaN = dot(FxaaTexOff(SamplerColor, pos.xy, float2(0, -1), rcpFrame.xy).xyz, float3(0.299, 0.587, 0.114));
float lumaW = dot(FxaaTexOff(SamplerColor, pos.xy, float2(-1, 0), rcpFrame.xy).xyz, float3(0.299, 0.587, 0.114));


float4 rgbyM;
rgbyM.xyz = FxaaTexTop(SamplerColor, pos.xy).xyz;
rgbyM.w = dot(rgbyM.xyz, float3(0.299, 0.587, 0.114));
float lumaE = dot(FxaaTexOff(SamplerColor, pos.xy, float2( 1, 0), rcpFrame.xy).xyz, float3(0.299, 0.587, 0.114));
float lumaS = dot(FxaaTexOff(SamplerColor, pos.xy, float2( 0, 1), rcpFrame.xy).xyz, float3(0.299, 0.587, 0.114));
float lumaM = rgbyM.w;


float rangeMin = min(lumaM, min(min(lumaN, lumaW), min(lumaS, lumaE)));
float rangeMax = max(lumaM, max(max(lumaN, lumaW), max(lumaS, lumaE)));
float range = rangeMax - rangeMin;

if(range < max(FXAA_QUALITY__EDGE_THRESHOLD_MIN, rangeMax * FXAA_QUALITY__EDGE_THRESHOLD)) return rgbyM;


float lumaNW = dot(FxaaTexOff(SamplerColor, pos.xy, float2(-1,-1), rcpFrame.xy).xyz, float3(0.299, 0.587, 0.114));
float lumaNE = dot(FxaaTexOff(SamplerColor, pos.xy, float2( 1,-1), rcpFrame.xy).xyz, float3(0.299, 0.587, 0.114));
float lumaSW = dot(FxaaTexOff(SamplerColor, pos.xy, float2(-1, 1), rcpFrame.xy).xyz, float3(0.299, 0.587, 0.114));
float lumaSE = dot(FxaaTexOff(SamplerColor, pos.xy, float2( 1, 1), rcpFrame.xy).xyz, float3(0.299, 0.587, 0.114));



float lumaL = (lumaN + lumaW + lumaE + lumaS) * 0.25;
float rangeL = abs(lumaL - lumaM);
float blendL = saturate((rangeL / range) - FXAA_QUALITY__SUBPIX_TRIM) * FXAA_QUALITY__SUBPIX_TRIM_SCALE;
blendL = min(FXAA_QUALITY__SUBPIX_CAP, blendL);

float edgeVert = abs(lumaNW + (-2.0 * lumaN) + lumaNE) + 2.0 * abs(lumaW  + (-2.0 * lumaM) + lumaE ) + abs(lumaSW + (-2.0 * lumaS) + lumaSE);
    float edgeHorz = abs(lumaNW + (-2.0 * lumaW) + lumaSW) + 2.0 * abs(lumaN  + (-2.0 * lumaM) + lumaS ) + abs(lumaNE + (-2.0 * lumaE) + lumaSE);
    bool horzSpan = edgeHorz >= edgeVert;

float lengthSign = horzSpan ? -rcpFrame.y : -rcpFrame.x;
if(!horzSpan) lumaN = lumaW;
if(!horzSpan) lumaS = lumaE;
float gradientN = abs(lumaN - lumaM);
float gradientS = abs(lumaS - lumaM);
lumaN = (lumaN + lumaM) * 0.5;
lumaS = (lumaS + lumaM) * 0.5;

bool pairN = gradientN >= gradientS;
if(!pairN) lumaN = lumaS;
if(!pairN) gradientN = gradientS;
if(!pairN) lengthSign *= -1.0;
float2 posN;
posN.x = pos.x + (horzSpan ? 0.0 : lengthSign * 0.5);
posN.y = pos.y + (horzSpan ? lengthSign * 0.5 : 0.0);


gradientN *= FXAA_SEARCH_THRESHOLD;

float2 posP = posN;
float2 offNP = horzSpan ?
float2(rcpFrame.x, 0.0) :
float2(0.0f, rcpFrame.y);
float lumaEndN;
float lumaEndP;
bool doneN = false;
bool doneP = false;
posN += offNP * (-1.5);
posP += offNP * ( 1.5);
for(int i = 0; i < FXAA_SEARCH_STEPS; i++)
{
 lumaEndN = dot(FxaaTexTop(SamplerColor, posN.xy).xyz, float3(0.299, 0.587, 0.114));
 lumaEndP = dot(FxaaTexTop(SamplerColor, posP.xy).xyz, float3(0.299, 0.587, 0.114));
 bool doneN2 = abs(lumaEndN - lumaN) >= gradientN;
 bool doneP2 = abs(lumaEndP - lumaN) >= gradientN;
 if(doneN2 && !doneN) posN += offNP;
 if(doneP2 && !doneP) posP -= offNP;
 if(doneN2 && doneP2) break;
 doneN = doneN2;
 doneP = doneP2;
 if(!doneN) posN -= offNP * 2.0;
 if(!doneP) posP += offNP * 2.0;
}

float dstN = horzSpan ? pos.x - posN.x : pos.y - posN.y;
float dstP = horzSpan ? posP.x - pos.x : posP.y - pos.y;

bool directionN = dstN < dstP;
lumaEndN = directionN ? lumaEndN : lumaEndP;

if(((lumaM - lumaN) < 0.0) == ((lumaEndN - lumaN) < 0.0))
lengthSign = 0.0;

float spanLength = (dstP + dstN);
dstN = directionN ? dstN : dstP;
float subPixelOffset = 0.5 + (dstN * (-1.0/spanLength));
subPixelOffset += blendL * (1.0/8.0);
subPixelOffset *= lengthSign;
float3 rgbF = FxaaTexTop(SamplerColor, float2(pos.x + (horzSpan ? 0.0 : subPixelOffset), pos.y + (horzSpan ? subPixelOffset : 0.0))).xyz;

   #if (FXAA_LINEAR == 1)
lumaL *= lumaL;
   #endif
   float lumaF = dot(rgbF, float3(0.299, 0.587, 0.114)) + (1.0/(65536.0*256.0));
   float lumaB = lerp(lumaF, lumaL, blendL);
   float scale = min(4.0, lumaB/lumaF);
   rgbF *= scale;

   return float4(rgbF, lumaM);
}


technique PostProcess
{
   pass P0
   {
VertexShader = compile vs_3_0 VS_PostProcess();
PixelShader  = compile ps_3_0 FxaaPixelShader();

FogEnable=FALSE;
ALPHATESTENABLE=FALSE;
SEPARATEALPHABLENDENABLE=FALSE;
AlphaBlendEnable=FALSE;
FogEnable=FALSE;
SRGBWRITEENABLE=FALSE;
}
}

technique PostProcess2
{
   pass P0
   {
VertexShader = compile vs_3_0 VS_PostProcess();
PixelShader  = compile ps_3_0 FxaaPixelShader();

FogEnable=FALSE;
ALPHATESTENABLE=FALSE;
SEPARATEALPHABLENDENABLE=FALSE;
AlphaBlendEnable=FALSE;
FogEnable=FALSE;
SRGBWRITEENABLE=FALSE;
}
}

technique PostProcess3
{
   pass P0
   {
VertexShader = compile vs_3_0 VS_PostProcess();
PixelShader  = compile ps_3_0 FxaaPixelShader();

FogEnable=FALSE;
ALPHATESTENABLE=FALSE;
SEPARATEALPHABLENDENABLE=FALSE;
AlphaBlendEnable=FALSE;
FogEnable=FALSE;
SRGBWRITEENABLE=FALSE;
}
}

technique PostProcess4
{
   pass P0
   {
VertexShader = compile vs_3_0 VS_PostProcess();
PixelShader  = compile ps_3_0 FxaaPixelShader();

FogEnable=FALSE;
ALPHATESTENABLE=FALSE;
SEPARATEALPHABLENDENABLE=FALSE;
AlphaBlendEnable=FALSE;
FogEnable=FALSE;
SRGBWRITEENABLE=FALSE;
}
}

icelaglace
  • icelaglace

    See futures in balls

  • Members
  • Joined: 04 May 2011

#23066

Posted 23 June 2011 - 05:38 AM Edited by icelaglace, 23 June 2011 - 05:55 AM.

Oh , he released it, pretty cool gp65 ;D
How about the changes, i mean visual changes, does it improve the AA a lot?
Cheers mate , great job as usual smile.gif

EDIT :

Definitely looks sharper. Finally the PC version is out haha.
Thanks for the conversion gp65 <3
At least it's more tweakable

jumper_311
  • jumper_311

    Crackhead

  • Members
  • Joined: 22 Jun 2010

#23067

Posted 23 June 2011 - 05:41 AM

QUOTE (gp65cj04 @ Thursday, Jun 23 2011, 05:32)
NVIDIA FXAA III.8 by TIMOTHY LOTTES


wow.gif Is this new code?

How can I use this code with old effect.txt? I just want to keep the sharp and noise code.

AlexFake
  • AlexFake

    Gamer!

  • Members
  • Joined: 12 Nov 2010

#23068

Posted 23 June 2011 - 06:05 AM

FXAA v.III. SSAO. AA=false.
user posted imageuser posted image
user posted imageuser posted image
Its fu*king amazing!)

tkd3796
  • tkd3796

    Player Hater

  • Members
  • Joined: 24 May 2011

#23069

Posted 23 June 2011 - 06:54 AM

QUOTE (AlexFake @ Thursday, Jun 23 2011, 06:05)
FXAA v.III. SSAO. AA=false.
user posted imageuser posted image
user posted imageuser posted image
Its fu**ing amazing!)

WOW!! you..your ENB is f*ckING AWESOME
where is new ENB??

AlexFake
  • AlexFake

    Gamer!

  • Members
  • Joined: 12 Nov 2010

#23070

Posted 23 June 2011 - 06:56 AM

@tkd3796 Yeah. new test enb.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users