[Sammelthread] Grand Theft Auto Series / GTA V / Trilogy Definitive Edition

Muss sagen bin überrascht wie gut die ENB von Schakusa läuft trotz Downsampling etc. das hatte ich schlimmer in erinnerung...im großen und ganzen eigentlich noch ganz gut spielbar. Zwar keien 60fps durchgehend aber naja :d

Und ohne Motion Blur siehts auch super aus. Hab eigentlich die ganze nacht nur mit dem Zmodeler und mit der ENB rumgespielt...glaub ich brauch mal Urlaub um mich da volld rauf zu fokusieren ^^
 
Wenn Du diese Anzeige nicht sehen willst, registriere Dich und/oder logge Dich ein.
Moin Männer, dass wie immer klasse bilder dabei sind, brauch ich ja nich sagen !!!!111one

und nu ich ma, hab ne karre zu ~90% fertig, nur noch 2-3 sachen zu tun
merkt euch schon ma das teil :d


Ingame bilder folgen, .. insofern zmod es verkraftet, also daumen drücken :bigok:
 
Hey Leute, mit dll rein und fertig ist nischt, die sampler der enbeffect sind anders, die müssen bei machen enbeffects auf r0 Basis geändert werden, die L3EVO können glaub ich bleiben.

man mir qualmen die Finger, ich hab ne 19 KB effect.txt gescratcht.^^

BTW: irgendwer hier hat Bilder mit Cross Process gemacht. Wer war das bitte und wie hat er das gemacht, falls per enbeffect, her damit :d
 
Hey Leute, mit dll rein und fertig ist nischt, die sampler der enbeffect sind anders, die müssen bei machen enbeffects auf r0 Basis geändert werden, die L3EVO können glaub ich bleiben.
man mir qualmen die Finger, ich hab ne 19 KB effect.txt gescratcht.^^
BTW: irgendwer hier hat Bilder mit Cross Process gemacht. Wer war das bitte und wie hat er das gemacht, falls per enbeffect, her damit :d
Das ist doof :grrr: Könntest du das mal in meiner editieren??

// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// | Schakusas ENB effect file (v2.1) |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// | Original Codes & Shaders are made by: |
// | Boris, Ice, Dkt70, AAA, AMD, gp65cj04 and specially MasterKontrol |
// | Edited and modifed by Schakusa: |
// | Added different DoF-Versions, new tweaking lines and edited values |
// | Many more ... |
// | Edited by Crosire: |
// | DoF code fully overhauled and rewritten, file designed (tweaking) and optimized |
// | New effects injected ...
// |
// | Settings modified by Legacyy |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

// If you need, tweak, but read! ////////////////////////////////////////////////////////

// +---------------------------------------+
// #### | Brightness | #######################################
// +---------------------------------------+

/*------------------------------------------------------------------------------
| Change global Brightness and adaptation to brightness of the game. |
| Lower values, darker game. |
------------------------------------------------------------------------------*/
float AdaptationValue = 1.00; // Brightness Adaption
float Brightness = 1.50; // Overall Brigthness


// +---------------------------------------+
// #### | Saturation | #######################################
// +---------------------------------------+

/*------------------------------------------------------------------------------
| 1 = Default Saturation |
| 0 = Black and White colors |
------------------------------------------------------------------------------*/
#define GlobalSaturation
float Saturation = 1.25; // Overall Color Saturation


// +---------------------------------------+
// #### | Colorcorrection | #### icelaglace #######################
// +---------------------------------------+

/*------------------------------------------------------------------------------
| Gamma Correction .... |
| Higher = More gamma = More contrasted image |
| Lower = Less gamma = More natural image |
------------------------------------------------------------------------------*/
#define GAMMACORRECTION
float GammaAmount = 1.40; // Overall Gamma

/*------------------------------------------------------------------------------
| Bleach Bypass (Bleach bypass - Wikipedia, the free encyclopedia) |
| Mainly reduces saturation, increases the contrast & changes the exposure |
------------------------------------------------------------------------------*/
//#define BLEACH
float BP_Factor = 0.00; // Overall bleaching

/*------------------------------------------------------------------------------
| Filmic curve tone mapping. (Filmic Games) |
| Change the value from A to W to tweak like you want. |
------------------------------------------------------------------------------*/
//#define FILMICCURVE
float A = 0.20; // Shoulder Strength
float B = 1.50; // Linear Strength
float C = 0.20; // Linear Angle
float D = 1.90; // Toe Strength
float E = 0.02; // Toe Numerator
float F = 1.50; // Toe Denominator
float W = 11.2; // White Scale

/*------------------------------------------------------------------------------
| Techicolor |
------------------------------------------------------------------------------*/
#define TECHNICOLORCORRECTION
float TechniAmount = 0.35; // Maximum: 1.0
float TechniPower = 3.8; // Power of colors
float NegativeAmountR = 0.98; // Lower => More redish image
float NegativeAmountG = 0.98; // Lower => More greenish image
float NegativeAmountB = 0.98; // Lower => More blueish image

/*------------------------------------------------------------------------------
| "KBL Pwning Colorcorrection 1.0 Best". Whole picture gets a more contrasted |
| and colors are stronger. |
------------------------------------------------------------------------------*/
//#define KBLCOLORCORRECTION
float fRatio = 0.02; // Strongness
float MoodR = 1.0;
float MoodG = 1.0;
float MoodB = 1.0;

/*------------------------------------------------------------------------------
| If you want to enable colorcorrection to gamecolors, remove the "//" as |
| usual. (Colors are adapted to original image then) |
------------------------------------------------------------------------------*/
//#define GAMECOLORCORRECTION

/*------------------------------------------------------------------------------
| Colorcorrection using a palette ("enbpalette.bmp" in the gamefolder) |
| This works ONLY on ENB version 0.082!! You can manually disable it here: |
------------------------------------------------------------------------------*/
//#define E_CC_PALETTE


// +---------------------------------------+
// #### | High Dynamic Range | #### DKT70 ############################
// +---------------------------------------+

/*------------------------------------------------------------------------------
| HDR color filter |
------------------------------------------------------------------------------*/
//#define HDR
float4 FogColor = {0.05, 0.05, 0.06, 0.04}; // Lens-style color filters
float Defog = 0.50; // Strength of color filters

/*------------------------------------------------------------------------------
| Extra image settings: |
------------------------------------------------------------------------------*/
float Exposure = 0.00; // Contrast settings
float BlueShift = 0.00; // Shifts entire color spectrum towards blue


// +---------------------------------------+
// #### | Bloom | #######################################
// +---------------------------------------+

/*------------------------------------------------------------------------------
| Overall bloom, globally. Higher values increase sun size and brightness too. |
------------------------------------------------------------------------------*/
float BloomAmountMix = 0.50; // Overall Bloom
float BloomAdditive = 0; // Additional Overall Bloom

/*------------------------------------------------------------------------------
| Color of the bloom. |
------------------------------------------------------------------------------*/
float BloomR = 0.80; // Red amount
float BloomG = 0.80; // Green amount
float BloomB = 1.00; // Blue amount


// +---------------------------------------+
// #### | Depth of Field | #### gp65cj04, icelaglace, Crosire ####
// +---------------------------------------+

/*------------------------------------------------------------------------------
| If you want (STATIC)DoF remove the "//" before "DOF". |
| For dynamic DoF remove them from "DYNAMIC" too, so both are enabled!!! |
------------------------------------------------------------------------------*/
#define DOF // Only Static DoF
//#define DYNAMIC // Add Dynamic DoF

/*------------------------------------------------------------------------------
| DoF Quality. Only enable ONE at the same time (but one HAS to be enabled)! |
| High quality is only recommended for screenshots because it eats performance |
------------------------------------------------------------------------------*/
//#define DOF_LOW_QUALITY
//#define DOF_NORMAL_QUALITY
#define DOF_HIGH_QUALITY

/*------------------------------------------------------------------------------
| If you use "AntiAliasing=true" in the enbseries.ini, change this to 2.00! |
| Multiplier of DoFAmount ... |
------------------------------------------------------------------------------*/
float DOFSizeMulti = 1.45; // Overall Dof Multiplier

/*------------------------------------------------------------------------------
| Change the intensity of DoF here |
------------------------------------------------------------------------------*/
float DOFAmount_HQ = 0.60; // Intensity when high quality enabled
float DOFAmount_LQ = 0.21; // Intensity when low/normal quality enabled

/*------------------------------------------------------------------------------
| Tuning Options for static DoF |
------------------------------------------------------------------------------*/
float SNearBlur = -45.0; // Distance for Near Blur Depth
float SFocalPlane = 1.5; // Depth of Focal Plane
float SFarBlur = 250.0; // Distance for Far Blur Depth
float SBlurCutoffConstant = 0.65; // Distance for Bluriness Cut-off

/*------------------------------------------------------------------------------
| Tuning Options for dynamic DoF |
------------------------------------------------------------------------------*/
float DNearBlur = -45.0; // Distance for Near Blur Depth
float DFocalPlane = 1.0; // Depth of Focal Plane
float DFarBlur = 25000.0; // Distance for Far Blur Depth
float DBlurCutoffConstant = 0.60; // Distance for Bluriness Cut-off

/*------------------------------------------------------------------------------
| This is where the dynamic DOF is focusing, if enabled. Center = 0.5. |
------------------------------------------------------------------------------*/
float2 FocusPoint = float2(0.35, 0.35);


// +---------------------------------------+
// #### | Motion Blur | #### MasterKontrol ####################
// +---------------------------------------+

/*------------------------------------------------------------------------------
| Quality and Strenght of Motion Blur |
------------------------------------------------------------------------------*/
int MBSteps = 16; // Quality of Motion Blur
int MBAmount = 0.03; // Strength of Motion Blur


// +---------------------------------------+
// #### | Vignette | ##### icelaglace ######################
// +---------------------------------------+

/*------------------------------------------------------------------------------
| Makes the image border edges a little darker. Choose version below: |
------------------------------------------------------------------------------*/
//#define VIGNETTE_FX_NEW
//#define VIGNETTE_FX_OLD

/*------------------------------------------------------------------------------
| Vignette settings for FX_NEW (skyrim vignette) |
------------------------------------------------------------------------------*/
float SquareTop = 0.366; // TOP of Screen
float SquareBottom = 0.366; // BOTTOM of Screen
float CircularPower = 0.666; // CIRCULAR Vignette Amount
float ColorDistortion = 0.966; // COLOR Distortion Strength
float ContrastSharpen = 1.366; // Contrast & Sharpness Increase
float NightStrength = 1.666; // Strength of Effect at Night

/*------------------------------------------------------------------------------
| Vignette settings for FX_OLD (icenhancer vignette) |
------------------------------------------------------------------------------*/
float VignetteFocus = 12.0; // Focus
float VignetteAmount = 1.3; // Amount


// If you need, tweak, but read! ////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////////////////
//
// sampler2D AdapLumSampler;
// sampler2D BloomSampler;
// float4 ColorCorrect;
// float4 ColorShift;
// float Exposure;
// sampler2D GBufferTextureSampler2;
// sampler2D GBufferTextureSampler3;
// sampler2D HDRSampler;
// sampler2D JitterSampler;
// float PLAYER_MASK;
// sampler2D StencilCopySampler;
// float4 TexelSize;
// float4 ToneMapParams;
// float4 deSatContrastGamma;
// float4 dofBlur;
// float4 dofDist;
// float4 dofProj;
// float gDirectionalMotionBlurLength;
// float4 globalScreenSize;
// row_major float4x4 motionBlurMatrix;
//
// Registers:
//
// Name Reg Size
// ---------------------------- ----- ----
// globalScreenSize c44 1
// Exposure c66 1
// motionBlurMatrix c72 4
// TexelSize c76 1
// dofProj c77 1
// dofDist c78 1
// dofBlur c79 1
// gDirectionalMotionBlurLength c80 1
// ToneMapParams c81 1
// deSatContrastGamma c82 1
// ColorCorrect c83 1
// ColorShift c84 1
// PLAYER_MASK c85 1
// GBufferTextureSampler2 s0 1
// GBufferTextureSampler3 s1 1
// HDRSampler s2 1
// BloomSampler s3 1
// AdapLumSampler s4 1
// JitterSampler s5 1
// StencilCopySampler s6 1
//
/////////////////////////////////////////////////////////////////////////////////////////

struct VS_OUTPUT_POST
{
float4 vpos : POSITION;
float2 txcoord0 : TEXCOORD0;
};
struct VS_INPUT_POST
{
float3 pos : POSITION;
float2 txcoord0 : TEXCOORD0;
};

float4 _c44 : register(c44);
float4 _c66 : register(c66);
float4 _c72 : register(c72);
float4 _c73 : register(c73);
float4 _c74 : register(c74);
float4 _c75 : register(c75);
float4 _c76 : register(c76);
float4 _c77 : register(c77);
float4 _c78 : register(c78);
float4 _c79 : register(c79);
float4 _c80 : register(c80);
float4 _c81 : register(c81);
float4 _c82 : register(c82);
float4 _c83 : register(c83);
float4 _c84 : register(c84);
float4 _c85 : register(c85);

texture2D texs0 : register(s0);
texture2D texs1 : register(s1);
texture2D texs2 : register(s2);
texture2D texs3 : register(s3);
texture2D texs4 : register(s4);
texture2D texs5 : register(s5);
texture2D texs6 : register(s6);
texture2D texs7 : register(s7);
texture2D texs15 : register(s15);

sampler2D s2=sampler_state { Texture=<texs2>; };
sampler2D s4=sampler_state { Texture=<texs4>; };
//sampler2D s5=sampler_state { Texture=<texs5>; };
sampler2D s6=sampler_state { Texture=<texs6>; };
sampler2D s7=sampler_state { Texture=<texs7>; };
sampler2D s15=sampler_state { Texture=<texs15>; };

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

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

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

sampler2D s5 = sampler_state
{
Texture = <texs5>;
MinFilter = GaussianQuad;
MagFilter = GaussianQuad;
MipFilter = LINEAR;
AddressU = Wrap;
AddressV = wrap;
SRGBTexture=FALSE;
MaxMipLevel=0;
MipMapLodBias=0;
};

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

float4 PS_C215BE6E(VS_OUTPUT_POST IN) : COLOR
{
float4 _oC0=0.0; //output

float4 _c0=float4(0, 0.212500006, 0.715399981, 0.0720999986);
float4 _c1=float4(0.25, 1, 256, 0);
float4 _c2=float4(0, 2, 4, 8);
float4 _c3=float4(58.1640015, 47.1300011, 0, 0);
float4 _c4=float4(-0.5, -1.5, 1.5, 0.5);
float4 _c5=float4(2, -1, 0.125, 0);
float4 _c6=float4(256, 2, 4, 8);
float4 _c7=float4(1.0, 0.1, 0.8, 1.0);
float4 _c8=float4(0.0, 0.1, 0.8, 0.333);
float4 _c9=float4(0.06, 0.1, 0.8, 0.1);
float4 _c10=float4(0.01, 1.4, 0.0, 0.32);
float4 _c11=float4(0.333333, 1.0, 0.0, 0.0);
float4 _c12=float4(0.299, 0.587, 0.114, 0.0);
float4 _c13=float4(0.0, 0.0, 0.0, 0.00001);
float4 _c150=float4(0.55, 0.9, 0.85, 0.9);
float4 _c195=float4(0.0, 0.0, 0.0, 0.07);//0.7
float4 r0;
float4 r1;
float4 r2;
float4 r3;
float4 r4;
float4 r5;
float4 r6;
float4 r7;
float4 r8;
float4 r9;
float4 r10;
float4 r11;

float4 _v0=0.0;
_v0.xy=IN.txcoord0.xy;

r0=tex2D(s1, _v0.xy); //GBufferTextureSampler3
r0.y=-_c77.x + _c77.y; //-dofProj.x + dofProj.y
r0.y=1.0/r0.y;
r0.z=r0.y * _c77.y; //dofProj.y
r0.z=r0.z * -_c77.x; //dofProj.x
r0.x=_c77.y * -r0.y + r0.x;
r0.x=1.0/r0.x;
r0.y=r0.z * r0.x;

r1=tex2D(s2, _v0.xy); //HDRSampler
r2=tex2D(s3, _v0.xy); //BloomSampler

float2 center;
float depth;
float focus;
float distance;

r0=tex2D(s1, _v0.xy); //GBufferTextureSampler3
r0.y=-_c77.x + _c77.y; //-dofProj.x + dofProj.y
r0.y=1.0/r0.y;
r0.z=r0.y * _c77.y; //dofProj.y
r0.z=r0.z * -_c77.x; //dofProj.x
r0.x=_c77.y * -r0.y + r0.x;
r0.x=1.0/r0.x;
r0.y=r0.z * r0.x;

r0.w=abs(_c79.w);
r3=_c4; //-0.5, -1.5, 1.5, 0.5

depth=r0.z * r0.x - _c78.w; //dofDist.w
depth+=_c78.y * -r3.w; //dofDist.y
depth+=148;//offset
center.x=_v0.x-0.5;
center.y=0.5-_v0.y;

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

#ifdef DOF

float4 vDofParams;

vDofParams = float4(SNearBlur, SFocalPlane, SFarBlur, SBlurCutoffConstant);

#ifdef DYNAMIC

vDofParams = float4(DNearBlur, DFocalPlane, DFarBlur, DBlurCutoffConstant);

r4=tex2D(s1, FocusPoint); //GBufferTextureSampler3
r4.y=-_c77.x + _c77.y; //-dofProj.x + dofProj.y
r4.y=1/r4.y;
r4.z=r4.y * _c77.y; //dofProj.y
r4.z=r4.z * -_c77.x; //dofProj.x
r4.x=_c77.y * -r4.y + r4.x;
r4.x=1/r4.x;
r4.y=r4.z * r4.x;

float cdepth;
cdepth=r4.z * r4.x - _c78.w; //dofDist.w
cdepth+=_c78.y * -r3.w; //dofDist.y
cdepth+=148;//offset

r4.w = tex2D(s0, FocusPoint).w;
if(r4.w > 0)
{
vDofParams.z = cdepth*2.0;
vDofParams.y = cdepth;
}
#endif

depth = max(depth, 0); //fix zoom bug
float dist;

if(depth < vDofParams.y)
{
dist = (depth - vDofParams.y)/(vDofParams.y - vDofParams.x);
}
else
{
dist = (depth - vDofParams.y)/(vDofParams.z - vDofParams.y);
dist = clamp(dist, 0, vDofParams.w);
}

dist = dist * 0.5 + 0.5;

#ifdef DOF_LOW_QUALITY
int DoF_Taps = 5;
float radiusScale = DOFAmount_LQ;
static float3 poisson[5]=
{
float3 (0.809, 0.41, 1),
float3 (-0.809, 0.41, 1),
float3 (0, 1 , 1),
float3 (-0.58, -0.809, 1),
float3 (0.58, -0.809, 1)
};
#endif
#ifdef DOF_NORMAL_QUALITY
int DoF_Taps = 24;
float radiusScale = DOFAmount_LQ;
static float3 poisson[24]=
{
float3(1.0, 0.0, 1.0000 ), //0 degrees
float3(0.0, -1.0, 1.0000 ),
float3(-1.0, 0.0, 1.0000 ),
float3(0.0, 1.0, 1.0000 ),
float3(0.7071, 0.7071, 1.0000 ), //45 degrees
float3(0.7071, 0.7071, 1.0000 ),
float3(-0.7071, -0.7071, 1.0000 ),
float3(-0.7071, 0.7071, 1.0000 ),
float3(0.9659, 0.2588, 1.0000 ), //15 degrees
float3(0.2588, -0.9659, 1.0000 ),
float3(-0.9659, -0.2588, 1.0000 ),
float3(-0.2588, 0.9659, 1.0000 ),
float3(0.8660, 0.5000, 1.0000 ), //60 degrees
float3(0.5000, -0.8660, 1.0000 ),
float3(-0.8660, -0.5000, 1.0000 ),
float3(-0.5000, 0.8660, 1.0000 ),
float3(0.5000, 0.8660, 1.0000 ), //30 degrees
float3(0.8660, -0.5000, 1.0000 ),
float3(-0.5000, -0.8660, 1.0000 ),
float3(-0.8660, 0.5000, 1.0000 ),
float3(0.2588, 0.9659, 1.0000 ), //75 degrees
float3(0.9659, -0.2588, 1.0000 ),
float3(-0.2588, -0.9659, 1.0000 ),
float3(-0.9659, 0.2588, 1.0000 ),
};
#endif
#ifdef DOF_HIGH_QUALITY
int DoF_Taps = 60;
float radiusScale = DOFAmount_HQ;
static float3 poisson[60] =
{
float3( 0.2165, 0.1250, 1.0000 ),
float3( 0.0000, 0.2500, 1.0000 ),
float3( -0.2165, 0.1250, 1.0000 ),
float3( -0.2165, -0.1250, 1.0000 ),
float3( -0.0000, -0.2500, 1.0000 ),
float3( 0.2165, -0.1250, 1.0000 ),
float3( 0.4330, 0.2500, 1.0000 ),
float3( 0.0000, 0.5000, 1.0000 ),
float3( -0.4330, 0.2500, 1.0000 ),
float3( -0.4330, -0.2500, 1.0000 ),
float3( -0.0000, -0.5000, 1.0000 ),
float3( 0.4330, -0.2500, 1.0000 ),
float3( 0.6495, 0.3750, 1.0000 ),
float3( 0.0000, 0.7500, 1.0000 ),
float3( -0.6495, 0.3750, 1.0000 ),
float3( -0.6495, -0.3750, 1.0000 ),
float3( -0.0000, -0.7500, 1.0000 ),
float3( 0.6495, -0.3750, 1.0000 ),
float3( 0.8660, 0.5000, 1.0000 ),
float3( 0.0000, 1.0000, 1.0000 ),
float3( -0.8660, 0.5000, 1.0000 ),
float3( -0.8660, -0.5000, 1.0000 ),
float3( -0.0000, -1.0000, 1.0000 ),
float3( 0.8660, -0.5000, 1.0000 ),
float3( 0.2163, 0.3754, 0.8670 ),
float3( -0.2170, 0.3750, 0.8670 ),
float3( -0.4333, -0.0004, 0.8670 ),
float3( -0.2163, -0.3754, 0.8670 ),
float3( 0.2170, -0.3750, 0.8670 ),
float3( 0.4333, 0.0004, 0.8670 ),
float3( 0.4328, 0.5004, 0.8847 ),
float3( -0.2170, 0.6250, 0.8847 ),
float3( -0.6498, 0.1246, 0.8847 ),
float3( -0.4328, -0.5004, 0.8847 ),
float3( 0.2170, -0.6250, 0.8847 ),
float3( 0.6498, -0.1246, 0.8847 ),
float3( 0.6493, 0.6254, 0.9065 ),
float3( -0.2170, 0.8750, 0.9065 ),
float3( -0.8663, 0.2496, 0.9065 ),
float3( -0.6493, -0.6254, 0.9065 ),
float3( 0.2170, -0.8750, 0.9065 ),
float3( 0.8663, -0.2496, 0.9065 ),
float3( 0.2160, 0.6259, 0.8851 ),
float3( -0.4340, 0.5000, 0.8851 ),
float3( -0.6500, -0.1259, 0.8851 ),
float3( -0.2160, -0.6259, 0.8851 ),
float3( 0.4340, -0.5000, 0.8851 ),
float3( 0.6500, 0.1259, 0.8851 ),
float3( 0.4325, 0.7509, 0.8670 ),
float3( -0.4340, 0.7500, 0.8670 ),
float3( -0.8665, -0.0009, 0.8670 ),
float3( -0.4325, -0.7509, 0.8670 ),
float3( 0.4340, -0.7500, 0.8670 ),
float3( 0.8665, 0.0009, 0.8670 ),
float3( 0.2158, 0.8763, 0.9070 ),
float3( -0.6510, 0.6250, 0.9070 ),
float3( -0.8668, -0.2513, 0.9070 ),
float3( -0.2158, -0.8763, 0.9070 ),
float3( 0.6510, -0.6250, 0.9070 ),
float3( 0.8668, 0.2513, 0.9070 )
};
#endif

float2 pixelSizeHigh;
float2 pixelSizeLow;

pixelSizeHigh.x = 2.0 / _c44.x;
pixelSizeHigh.y = 2.0 / _c44.y;
pixelSizeHigh.xy *= DOFSizeMulti;
pixelSizeLow.xy = pixelSizeHigh.xy;

float2 vMaxCoC = float2(5.0, 10.0);
float discRadius;
float discRadiusLow;
float centerDepth;
float4 tdepth;
float4 tapHigh;
float4 tapLow;

centerDepth = dist;
discRadius = abs(centerDepth * vMaxCoC.y - vMaxCoC.x);
discRadiusLow = discRadius * radiusScale;
r1 = 0.0;

for(int t = 0; t < DoF_Taps; t++)
{
float2 coordLow = _v0.xy + (pixelSizeLow.xy * poisson[t].xy * discRadiusLow);
float2 coordHigh = _v0.xy + (pixelSizeHigh.xy * poisson[t].xy * discRadius);

tapLow = tex2D(s2, coordLow.xy) * poisson[t].z;
tapHigh = tex2D(s2, coordHigh.xy) * poisson[t].z;

tdepth = tex2D(s1, coordHigh.xy); //GBufferTextureSampler3
tdepth.y = -_c77.x + _c77.y; //-dofProj.x + dofProj.y
tdepth.y = 1.0 / tdepth.y;
tdepth.z = tdepth.y * _c77.y; //dofProj.y
tdepth.z = tdepth.z * -_c77.x; //dofProj.x
tdepth.x = _c77.y * -tdepth.y + tdepth.x;
tdepth.x = 1.0 / tdepth.x;
tdepth.w = tdepth.z * tdepth.x - _c78.w; //dofDist.w
tdepth.w += _c78.y * -r3.w; //dofDist.y
//gp65cj04 fixed by Crosire
tdepth.w += 148;//offset

tdepth.w = max(tdepth.w, 0); //fix zoom bug

if(tdepth.w < vDofParams.y)
{
tapHigh.w = (tdepth.w - vDofParams.y)/(vDofParams.y - vDofParams.x);
}
else
{
tapHigh.w = (tdepth.w - vDofParams.y)/(vDofParams.z - vDofParams.y);
tapHigh.w = clamp(tapHigh.w, 0, vDofParams.w);
}

tapHigh.w = tapHigh.w * 0.5 + 0.5;
tapLow.w = tapHigh.w;

float tapBlur = abs(tapHigh.w * 2.0 - 1.0);
float4 tap = lerp(tapHigh, tapLow, tapBlur);

if(tap.w >= centerDepth)
{
tap.w = 1;
}
else
{
tap.w = abs(tap.w * 2.0 - 1.0);
}

r1.xyz += tap.xyz * tap.w;
r1.w += tap.w;
}

r1.xyz /= r1.w;

#endif

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

r1.w=dot(r1.xyz, r1.xyz); //dp3
r1.w=1.0/r1.w;
r3 = lerp(_c0.x, r1, saturate(r1.w * 10000));
r4 = r3;
r5 = r3;
r6 = r3;
r7 = r3;

r0.x=r0.z * r0.x - _c78.w; //dofDist.w
r0.x=_c78.y * -r3.w + r0.x; //dofDist.y
r1.w=max(r0.x, _c0.x); //0.0
r0.x=1.0/_c78.z; //dofDist.z
r0.x=r1.w * r0.x;
r1.w=lerp(_c79.y, _c79.z, r0.x);//dofBlur
r0.x=min(_c79.z, r1.w); //dofBlur.z
r0.z=dot(r7.xyz, _c0.yzw); //0.212500006, 0.715399981, 0.0720999986
r8.x=dot(r3.xyz, _c0.yzw); //0.212500006, 0.715399981, 0.0720999986
r8.y=dot(r4.xyz, _c0.yzw); //0.212500006, 0.715399981, 0.0720999986
r8.z=dot(r5.xyz, _c0.yzw); //0.212500006, 0.715399981, 0.0720999986
r8.w=dot(r6.xyz, _c0.yzw); //0.212500006, 0.715399981, 0.0720999986
r1.w=dot(r8, _c1.xxxx); //0.25

r8=r8 - r1.w;
r2.w=dot(r8, r8);
r0.z=r0.z - r1.w;
r0.z=r0.z * r0.z - r2.w;
r0.x=r0.x*r0.x;
if (r0.z<0.0)
{
r0.x=r0.x;
} else r0.x=_c1.y; //1.0

r8=tex2D(s0, _v0.xy); //GBufferTextureSampler2
r8.yz=_c1.yz; // 1.0, 256.0
r9=r8.w * -r8.z + _c2; //0, 2, 4, 8
if (r9.w<0.0)
{
r9=_c1.w; //0.0
} else r9=_c1.y; //1.0
//r9 is filtered sky mask

//r10=r8.w + tempc6;//c6.yzwx; //256, 2, 4, 8
r10=r8.w * -_c6.x + _c6.yzwx; //256, 2, 4, 8

if (r10.x<0.0)
{
r10.x=-_c1.w; //0.0
} else r10.x=-_c1.y; //1.0

if (r10.y<0.0)
{
r10.y=-_c1.w; //0.0
} else r10.y=-_c1.y; //1.0

if (r10.z<0.0)
{
r10.z=-_c1.w; //0.0
} else r10.z=-_c1.y; //1.0

if (r10.w<0.0)
{
r10.w=-_c1.w; //0.0
} else r10.w=-_c1.y; //1.0

r9=r9 + r10;
r9=r9 * _c4.x; //-0.5

r0.z=dot(r9, _c1.yyyy); //1.0
r0.z=r0.z + _c4.w; //0.5
r0.z=1.0/r0.z;
r8.xzw=r3.xyz * r9.x;

r7.xyz=r7 * _c4.w + r8.xzw; //0.5
r7.xyz=r4 * r9.y + r7;
r7.xyz=r5 * r9.z + r7;
r7.xyz=r6 * r9.w + r7;
r7.xyz=r0.z * r7;
r0.z=-r0.x + _c1.y; //1.0
r1.w=r0.x * _c1.x; //0.25

r3.xyz=r3 * r1.w;
r3.xyz=r7 * r0.z + r3;
r3.xyz=r4 * r1.w + r3;
r3.xyz=r5 * r1.w + r3;
r3.xyz=r6 * r1.w + r3;

//r4.xyz=_v0.yxy * _c5.x + _c5.y; //2, -1
r4.x=_v0.y * _c5.x + _c5.y;
r4.y=_v0.x * _c5.x + _c5.y;
r4.z=_v0.y * _c5.x + _c5.y;

r0.z=r4.y * _c77.z; //dofProj.z
r0.z=r0.y * r0.z;
r1.w=-r4.x * _c77.w; //dofProj.w
r1.w=r0.y * r1.w;
r5.xyz=r1.w * _c73; //motionBlurMatrix.2
r5.xyz=r0.z * _c72 + r5; //motionBlurMatrix.1
r5.xyz=-r0.y * _c74 + r5; //motionBlurMatrix.3
r5.xyz=r5 + _c75; //motionBlurMatrix.4

r0.y=-r5.z * _c77.z; //dofProj.z
r0.y=1/r0.y;
r6.x=r5.x * r0.y;
r0.y=r5.z * _c77.w; //dofProj.w
r0.y=1/r0.y;
r6.y=r5.y * r0.y;
//r0.yz=-r4 + r6.xxyw;
r0.yz=-r4.yz + r6.xy;

//MOTION BLUR - MasterKontrol 2012
//r0.xy=r0.xyw * _c80.zxyw; //MK - This One = just landscape blur
r0.xy=r0.xy * _c80.wxyz; //MK - LAST
r0.z=r0.z * _c80.x; //MK - LAST
r0.w=r0.w * _c80.y; //MK - LAST
//r0.y=r0.y * _c80.x;
//r0.z=r0.z * _c80.x;

r4.xy=r0.yz * _c5.z;
r5=tex2D(s6, _v0.xy);
//r1.w=r5.xy * _c85.xy + -_c85.wzx; //Player Mask, MK - This One = just landscape blur
r1.w=r5.x + -_c85.xy; //Player Mask, MK - This one = all objects blur
//r1.w=r5.x - _c85.x;
r4.zw=r3.xy * _c2.w;
r4.zw=_v0.xy * _c3.xy + r4.zw;
r5=tex2D(s5, r4.zw);
r4.zw=r4.xy * (r5.x - 4) + _v0.xy;
r5.xyz=r3.xyz;
r2.w=_c1.y;
r3.w=_c1.y;

//MOTION BLUR STRENGTH - Masterkontrol 2012
for (int iii=0; iii<MBSteps; iii++)
{
r6.x=r4.x * r3.w + r4.z;
r6.y=r4.y * r3.w + r4.w;
r7=tex2D(s6, r6.xy);
r5.w=r7.x - _c85.x;
if (r5.w<MBAmount)
{
r5.w=_c1.y; //1.0
} else r5.w=_c1.w; //0.0
r6=tex2D(s2, r6.xy);
r5.xyz=r6.xyz * r5.w + r5.xyz;
r2.w=r2.w + r5.w;
r3.w=r3.w + _c1.y; //1.0
}

r2.w=1.0/r2.w;

r0.y=r0.y * _c44.x; //GlobalScreenSize
r0.z=r0.z * _c44.y; //GlobalScreenSize
r0.y=dot(r0.yz, r0.yz)+_c0.x; //dp2
//r0.y=sqrt(r0.y);
//r0.y=1.0/r0.y;
r0.y=pow(r0.y, _c4.w); //0.5
r0.y=r0.y * _c4.w; //0.5
r0.x=r0.x + _c1.y; //1.0
r0.x=1.0/r0.x;
r0.x=saturate(r0.y * r0.x);
r4.xyz=r5 * r2.w - r3;
r0.xyz=r0.x * r4 + r3;

if (-r1.w<0.0) r0.xyz=r3.xyz;
if (-r0.w<0.0) r0.xyz=r1.xyz;

r11=r0;

r1=tex2D(s4, _c0.x); //AdapLumSampler , 0.0
r0.w=1.0/r1.x;
r0.w=r0.w * _c81.y; //ToneMapParams.y
r1.x=1.0/r0.w;
r1.x=r1.x * _c81.x; //ToneMapParams.x
r1.xyz=r2 * _c66.x - r1.x; //Exposure.x
r2.xyz=max(r1, _c0.x); //0.0
r1.xyz=r2 * _c81.z; //ToneMapParams.z
r1.xyz=r1 * _c1.x; //0.25
r0.xyz=r0 * _c66.x + r1; //Exposure.x
r1.xyz=r0.w * r0;
r1.x=dot(r1.xyz, _c0.yzw); //0.2125, 0.7154, 0.0721
r0.xyz=r0 * r0.w - r1.x;
r0.xyz=_c82.x * r0 + r1.x; //deSatContrastGamma.x
r0.w=r1.x * _c84.w; //ColorShift.w
r1.yzw=r0.w * _c84.xxyz; //ColorShift

//darken as DarkeningAmount, but keeps colors
r2.x=saturate(r0.w);
r0.xyz=r0.xyz - _c84.xyz * r0.w; //ColorShift
r0.xyz=r2.x * r0.xyz + r1.yzww;

//coloring (green, brown, ...)
r0.xyz=2.0 * r0.xyz * _c83.xyz; //ColorCorrect

//keeps colors, changes luma
r1.x=saturate(r1.x);
r0.w=_c82.z - _c1.y; //deSatContrastGamma.z
r2.x=pow(r1.x, r0.w);

_oC0.xyz=r0.xyz * r2.x; //orig
_oC0.w=_c1.y; //1.0

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

r5=tex2D(s4, _c0.x);//adaptation luminance
r0=tex2D(s2, _v0.xy);//hdr color
r0=r11;

//ADAPTION
r5.w=r5.x;
r5.w=AdaptationValue/r5.w;
r0.xyz=r0 * r5.w;
r3.xy=_c10.xwxw;
r3.xy=r3.xy * r5.w;

//BLOOM
r7=tex2D(s3, _v0.xy);
r7.r *= BloomR;
r7.g *= BloomG;
r7.b *= BloomB;
r0=r7 * BloomAdditive + r0; //0.05 //TEMP DISABLED

//BRIGHTNESS
r10=dot(r0.xyz, _c12.xyz);
r9.x=r10.x * Brightness;
r10.x=1.0/r10.x;
r10=r10 * r9.x;
r0=r0 * r10.x;
r0=r0 * _c7.y;
r1=r0 * _c7.z;
r1=r1 + _c7.w;
r1.xyz=1.0/r1.xyz;
r0=r0 * r1;

//SATURATION
#ifdef GlobalSaturation
float luma = dot(r0.xyz,_c12.xyz);
float gris = dot(r0.xyz, 0.333);
float3 PoweredColor = pow(r0.xyz, Saturation);
float newgris = dot(PoweredColor.xyz, 0.333);
r0.xyz = PoweredColor.xyz*gris/(newgris+0.0001);
#endif

//HDR - DKT70
#ifdef HDR
r0.rgb = max(0, r0.rgb - Defog * FogColor.rgb);
r0.rgb *= pow(2.0f, Exposure);
float3 bshift = r0.rgb * float3(1.05f, 0.97f, 1.27f);
r0.rgb = lerp(r0.rgb, bshift, BlueShift);
#endif

//GAMMA
#ifdef GAMMACORRECTION
r0=pow(r0,1/GammaAmount);
#endif

//TECHNICOLOR
#ifdef TECHNICOLORCORRECTION
float4 greenfilter = float4(0.30, 1.0, 0.0, 1.0);
float4 redorangefilter = float4(1.05, 0.620, 0.0, 1.0);
float4 cyanfilter = float4(0.0, 1.30, 1.0, 1.0);
float4 magentafilter = float4(1.0, 0.0, 1.05, 1.05);
float4 yellowfilter = float4(1.6, 1.6, 0.05, 1.0);
float4 filtgreen = r0 * greenfilter;
float4 filtblue = r0 * magentafilter;
float4 filtred = r0 * redorangefilter;
float4 rednegative = float((filtred.r + filtred.g + filtred.b)/(NegativeAmountR * TechniPower));
float4 greennegative = float((filtgreen.r + filtgreen.g + filtgreen.b)/(NegativeAmountG* TechniPower));
float4 bluenegative = float((filtblue.r+ filtblue.g + filtblue.b)/(NegativeAmountB* TechniPower));
float4 redoutput = rednegative + cyanfilter;
float4 greenoutput = greennegative + magentafilter;
float4 blueoutput = bluenegative + yellowfilter;
float4 result = redoutput * greenoutput * blueoutput;
r0.rgb = lerp(r0.rgb, result, TechniAmount);
#endif

//BLEACH BYPASS
#ifdef BLEACH
luma = dot(r0.xyz, _c12.xyz);
float3 blend = luma.xxx;
float L = min(1, max(0, 10*(luma - 0.45)));
float3 result1 = 2.0 * r0.xyz * blend;
float3 result2 = 1.0 - 2.0*(1.0 - blend)*(1.0 - r0.xyz);
float3 newColor = lerp(result1.xyz, result2.xyz, L);
float3 mixrgb = BP_Factor * newColor.xyz;
mixrgb += ((1.0f - BP_Factor) * r0.xyz);
r0.xyz = mixrgb;
#endif

//BLOOM ADDTIVE
r0=BloomAmountMix*r7 * r3.x + r0;

//FILMIC CURVE TONEMAPPING
#ifdef FILMICCURVE
float4 curr = ((r0*(A*r0+C*B)+D*E)/(r0*(A*r0+B)+D*F))-E/F;
float4 whiteScale = ((W*(A*W+C*B)+D*E)/(W*(A*W+B)+D*F))-E/F;
r0 = curr*whiteScale;
#endif

//COLORCORRECTION to GAMECOLORS
#ifdef GAMECOLORCORRECTION
r0.w=1.0;
luma=0.27*r0.r + 0.67*r0.g + 0.06*r0.b;
r0.xyz=r0.xyz * r0.w - luma;
r0.xyz=_c82.x * r0.xyz + luma;
r0.w=luma * _c84.w;
r1.xyz=r0.w * _c84.xyz;
r0.xyz=r0.xyz - _c84.xyz * r0.w;
r0.xyz=saturate(r0.w) * r0.xyz + r1.xyz;
r0.xyz=2.0 * r0.xyz * _c83.xyz;
luma=saturate(luma);
r0.w=_c82.z - _c1.y;
r0.xyz=r0.xyz * pow(luma, r0.w);
#endif

//KBL COLORCORRECTION
#ifdef KBLCOLORCORRECTION
float weight;
r2.x = dot(r0.xyz, 0.333);
r2.x = 1 - pow(2.71, -r2.x*5.2);
r2.x = r2.x * 0.17;
r0.xyz = saturate(r0.xyz - r2.x);
r0.xyz = sin(r0.xyz*1.57);
weight = 0.6 - r2.x * 0.3;
r0.xyz = lerp(r0.xyz, r0.xyz, weight);

r10.x = dot(r0.xyz, _c12.xyz);
r0.xyz = lerp(r0.xyz, r10.x, 0.1);
float4 colInput = r0;
float4 colMood = 1.0f;
colMood.r = MoodR;
colMood.g = MoodG;
colMood.b = MoodB;
float fLum = ( colInput.r + colInput.g + colInput.b ) / 3;
colMood = lerp(0, colMood, saturate(fLum * 2.0));
colMood = lerp(colMood, 1, saturate(fLum - 0.5) * 2.0);
float4 colOutput = lerp(colInput, colMood, saturate(fLum * fRatio));
r0.rgb=max(0, colOutput);
r0.a=1.0;
#endif

//PALETTE (ENB 0.082 Feature)
#ifdef E_CC_PALETTE
r0.rgb=saturate(r0.rgb);
float3 brightness=0.001;
float3 palette;
float4 uvsrc=0.0;
uvsrc.y=brightness.r;
uvsrc.x=r0.r;
palette.r=tex2Dlod(s13, uvsrc).r;
uvsrc.x=r0.g;
uvsrc.y=brightness.g;
palette.g=tex2Dlod(s13, uvsrc).g;
uvsrc.x=r0.b;
uvsrc.y=brightness.b;
palette.b=tex2Dlod(s13, uvsrc).b;
r0.rgb=palette.rgb;
#endif

//OLD VIGNETTE - Icelaglace
#ifdef VIGNETTE_FX_OLD
focus = length(center.xy)*1.41421;
focus = pow(focus, VignetteFocus);
r0.xyz -= focus * VignetteAmount;
#endif

//NEW VIGNETTE - Icelaglace
#ifdef VIGNETTE_FX_NEW
float rovigpwr = CircularPower; //for a circular vignette
float2 sqvigpwr = float2( SquareTop, SquareBottom ); // for the top and bottom of the screen
float vsatstrength = ColorDistortion; // color distortion
float vignettepow = ContrastSharpen; // increases the contrast and sharpness
float vstrengthatnight = NightStrength;

float2 inTex = _v0;
float vhnd = 0.5;
float4 voriginal = r0;
float4 vcolor = voriginal;
vcolor.xyz=1;
inTex -= 0.5; // center
inTex.y += 0.01; // offset from the center
float vignette = 1.0 - dot( inTex, inTex );
vcolor *= pow( vignette, vignettepow );

float4 rvigtex = vcolor;
rvigtex.xyz = pow( vcolor, 1 );
rvigtex.xyz = lerp(float3(0.5, 0.5, 0.5), rvigtex.xyz, 2.0); // contrast
rvigtex.xyz = lerp(float3(1,1,1),rvigtex.xyz,rovigpwr); // strength of the circular vinetty

//darken the top and bottom
float4 vigtex = vcolor;
vcolor.xyz = float3(1,1,1);
float3 topv = min((inTex.y+0.5)*2,1.5) * 2; // top
float3 botv = min(((0-inTex.y)+0.5)*2,1.5) * 2; // botton
topv= lerp(float3(1,1,1), topv, sqvigpwr.x);
botv= lerp(float3(1,1,1), botv, sqvigpwr.y);
vigtex.xyz = (topv)*(botv);
//vigtex.xyz = lerp(float3(1,1,1),vigtex.xyz,sqvigpwr); // strength of the top and bottom
vigtex.xyz*=rvigtex.xyz;
vigtex.xyz = lerp(vigtex.xyz,float3(1,1,1),(1-vstrengthatnight)*(1-vhnd)); //for a dark screen
vigtex.xyz = min(vigtex.xyz,1);
vigtex.xyz = max(vigtex.xyz,0);
float3 vtintensity = dot(r0.xyz, float3(0.2125, 0.7154, 0.0721));
r0.xyz = lerp(vtintensity, r0.xyz, ((((1-(vigtex.xyz*2))+2)-1)*vsatstrength)+1);
//color.xyz+=0.02;
r0.xyz *= (vigtex.xyz);
#endif

_oC0.xyz=r0.xyz;
return _oC0;
}

//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

technique Shader_C215BE6E
{
pass p0
{
PixelShader = compile ps_3_0 PS_C215BE6E();
}
}

technique Shader_ORIGINALPOSTPROCESS
{
pass p0
{

PixelShader=
asm
{

/////////////////////////////////////////////////////////////////////////////////////////
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.23.949.2378
//
// Parameters:
// sampler2D AdapLumSampler;
// sampler2D BloomSampler;
// float4 ColorCorrect;
// float4 ColorShift;
// float Exposure;
// sampler2D GBufferTextureSampler2;
// sampler2D GBufferTextureSampler3;
// sampler2D HDRSampler;
// sampler2D JitterSampler;
// float PLAYER_MASK;
// sampler2D StencilCopySampler;
// float4 TexelSize;
// float4 ToneMapParams;
// float4 deSatContrastGamma;
// float4 dofBlur;
// float4 dofDist;
// float4 dofProj;
// float gDirectionalMotionBlurLength;
// float4 globalScreenSize;
// row_major float4x4 motionBlurMatrix;
//
// Registers:
//
// Name Reg Size
// ---------------------------- ----- ----
// globalScreenSize c44 1
// Exposure c66 1
// motionBlurMatrix c72 4
// TexelSize c76 1
// dofProj c77 1
// dofDist c78 1
// dofBlur c79 1
// gDirectionalMotionBlurLength c80 1
// ToneMapParams c81 1
// deSatContrastGamma c82 1
// ColorCorrect c83 1
// ColorShift c84 1
// PLAYER_MASK c85 1
// GBufferTextureSampler2 s0 1
// GBufferTextureSampler3 s1 1
// HDRSampler s2 1
// BloomSampler s3 1
// AdapLumSampler s4 1
// JitterSampler s5 1
// StencilCopySampler s6 1
//
/////////////////////////////////////////////////////////////////////////////////////////

ps_3_0
def c0, 0, 0.212500006, 0.715399981, 0.0720999986
def c1, 0.25, 1, 256, 0
def c2, 0, 2, 4, 8
def c3, 58.1640015, 47.1300011, 0, 0
def c4, -0.5, -1.5, 1.5, 0.5
def c5, 2, -1, 0.125, 0
def c6, 256, 2, 4, 8
def c180, 0.0, 0.0, 0.0, 100.5
def c181, 1.0, 0.0, 0.0, 20.01
def c183, 800.0, 600.0, 0.0, 100.5
defi i0, 7, 0, 0, 0
dcl_texcoord v0.xy
dcl_2d s0
dcl_2d s1
dcl_2d s2
dcl_2d s3
dcl_2d s4
dcl_2d s5
dcl_2d s6
texld r0, v0, s1
add r0.y, -c77.x, c77.y
rcp r0.y, r0.y
mul r0.z, r0.y, c77.y
mul r0.z, r0.z, -c77.x
mad r0.x, c77.y, -r0.y, r0.x
rcp r0.x, r0.x
mul r0.y, r0.z, r0.x
texld r1, v0, s2
texld r2, v0, s3
abs r0.w, c79.w
mov r3, c4
mad r4.xy, c76, r3, v0
texld r4, r4, s2
mad r5.xy, c76, r3.zxzw, v0
texld r5, r5, s2
mad r3.xz, c76.xyyw, r3.wyzw, v0.xyyw
texld r6, r3.xzzw, s2
mad r3.xy, c76, r3.ywzw, v0
texld r7, r3, s2
dp3 r1.w, r4, r4
rcp r1.w, r1.w
cmp r3.xyz, -r1.w, c0.x, r4
dp3 r1.w, r5, r5
rcp r1.w, r1.w
cmp r4.xyz, -r1.w, c0.x, r5
dp3 r1.w, r6, r6
rcp r1.w, r1.w
cmp r5.xyz, -r1.w, c0.x, r6
dp3 r1.w, r7, r7
rcp r1.w, r1.w
cmp r6.xyz, -r1.w, c0.x, r7
dp3 r1.w, r1, r1
rcp r1.w, r1.w
cmp r7.xyz, -r1.w, c0.x, r1
mad r0.x, r0.z, r0.x, -c78.w
mad r0.x, c78.y, -r3.w, r0.x
max r1.w, r0.x, c0.x
rcp r0.x, c78.z
mul r0.x, r1.w, r0.x
lrp r1.w, r0.x, c79.z, c79.y
min r0.x, c79.z, r1.w
dp3 r0.z, r7, c0.yzww
dp3 r8.x, r3, c0.yzww
dp3 r8.y, r4, c0.yzww
dp3 r8.z, r5, c0.yzww
dp3 r8.w, r6, c0.yzww
dp4 r1.w, r8, c1.x
add r8, r8, -r1.w
dp4 r2.w, r8, r8
add r0.z, r0.z, -r1.w
mad r0.z, r0.z, r0.z, -r2.w
mul r0.x, r0.x, r0.x
cmp r0.x, r0.z, c1.y, r0.x
texld r8, v0, s0
mov r8.yz, c1
mad r9, r8.w, -r8.z, c2
cmp r9, r9, c1.y, c1.w
mad r10, r8.w, -c6.x, c6.yzwx
cmp r10, r10, -c1.y, -c1.w
add r9, r9, r10
mul r9, r9, c4.x
dp4 r0.z, r9, c1.y
add r0.z, r0.z, c4.w
rcp r0.z, r0.z
mul r8.xzw, r3.xyyz, r9.x
mad r7.xyz, r7, c4.w, r8.xzww
mad r7.xyz, r4, r9.y, r7
mad r7.xyz, r5, r9.z, r7
mad r7.xyz, r6, r9.w, r7
mul r7.xyz, r0.z, r7
add r0.z, -r0.x, c1.y
mul r1.w, r0.x, c1.x
mul r3.xyz, r3, r1.w
mad r3.xyz, r7, r0.z, r3
mad r3.xyz, r4, r1.w, r3
mad r3.xyz, r5, r1.w, r3
mad r3.xyz, r6, r1.w, r3
mad r4.xyz, v0.yxyw, c5.x, c5.y
mul r0.z, r4.y, c77.z
mul r0.z, r0.y, r0.z
mul r1.w, -r4.x, c77.w
mul r1.w, r0.y, r1.w
mul r5.xyz, r1.w, c73
mad r5.xyz, r0.z, c72, r5
mad r5.xyz, -r0.y, c74, r5
add r5.xyz, r5, c75
mul r0.y, -r5.z, c77.z
rcp r0.y, r0.y
mul r6.x, r5.x, r0.y
mul r0.y, r5.z, c77.w
rcp r0.y, r0.y
mul r6.y, r5.y, r0.y
add r0.yz, -r4, r6.xxyw
mul r0.yz, r0, c80.x
mul r4.xy, r0.yzzw, c5.z
texld r5, v0, s6
add r1.w, r5.x, -c85.x
mul r4.zw, r3.xyxy, c2.w
mad r4.zw, v0.xyxy, c3.xyxy, r4
texld r5, r4.zwzw, s5
add r2.w, r5.x, c4.x
mad r4.zw, r4.xyxy, r2.w, v0.xyxy
mov r5.xyz, r3
mov r2.w, c1.y
mov r3.w, c1.y

rep i0
mad r6.xy, r4, r3.w, r4.zwzw
texld r7, r6, s6
add r5.w, r7.x, -c85.x
cmp r5.w, r5.w, c1.w, c1.y
texld r6, r6, s2
mad r5.xyz, r6, r5.w, r5
add r2.w, r2.w, r5.w
add r3.w, r3.w, c1.y
endrep

rcp r2.w, r2.w
mul r0.yz, r0, c183.xxyw//c44.xxyw
dp2add r0.y, r0.yzzw, r0.yzzw, c0.x
rsq r0.y, r0.y
rcp r0.y, r0.y
mul r0.y, r0.y, c4.w
add r0.x, r0.x, c1.y
rcp r0.x, r0.x
mul_sat r0.x, r0.y, r0.x
mad r4.xyz, r5, r2.w, -r3
mad r0.xyz, r0.x, r4, r3
cmp r0.xyz, r1.w, r3, r0
cmp r0.xyz, -r0.w, r0, r1
texld r1, c0.x, s4
rcp r0.w, r1.x
mul r0.w, r0.w, c81.y
rcp r1.x, r0.w
mul r1.x, r1.x, c81.x
mad r1.xyz, r2, c66.x, -r1.x
max r2.xyz, r1, c0.x
mul r1.xyz, r2, c81.z
mul r1.xyz, r1, c1.x
mad r0.xyz, r0, c66.x, r1
mul r1.xyz, r0.w, r0
dp3 r1.x, r1, c0.yzww
mad r0.xyz, r0, r0.w, -r1.x
mad r0.xyz, c82.x, r0, r1.x
mul r0.w, r1.x, c84.w
mul r1.yzw, r0.w, c84.xxyz
mov_sat r2.x, r0.w
mad r0.xyz, c84, -r0.w, r0
mad r0.xyz, r2.x, r0, r1.yzww
mul r0.xyz, r0, c83
add r0.xyz, r0, r0
mov_sat r1.x, r1.x
add r0.w, -r8.y, c82.z
pow r2.x, r1.x, r0.w
//mul r2.x, r2.x, c181.x
mul oC0.xyz, r0, r2.x
mov oC0.w, c1.y
//texld r1, v0, s2
//mul oC0.xyz, r1, c199.z
};
}
}

CrossProcess war in der enbeffect hier drin:

//#define LightScatering // nvidia code ported by gp45cj07
#ifdef LightScatering // currently cut off
float Threshold2 = 30.0; // why i need this?
float Density = 0.85;
float Decay = 0.96;
float Weight = 0.25;
#endif
//#define SkyrimTonemap // skyrim enb v.103 tonemap by Boris Voroncov
#ifdef SkyrimTonemap // i'm using it ;)
float AdaptationMin = 0.13; //0.13
float AdaptationMax = 0.35;
float ToneMappingCurve = 4.25;
float IntensityContrast = 2.01;
float ColorSaturation = 1.8;
float CompensateSat = 2;
float ToneMappingOversaturation = 65;
#endif
//#define UnchartedTonemap // uncharted tone map
#ifdef UnchartedTonemap // mostly known as filmic curve shader
float ColorCorrectRatio = 0.045;
float3 dnsatd = float3( 0.55, 0.53, 0.5 );
float bchnd = 0.5;
float hbs = 0.5;

float A = 0.50;
float B = 0.50;
float C = 0.30;
float D = 2.50;
float E = 0.02;
float F = 1.50;
float W = 20.0; // 20

float3 Uncharted2Tonemap(float3 x)
{
return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;
}
#endif
//#define CrossProcessing
#ifdef CrossProcessing
float Contrast =0.95;
float Saturation2 = 1.12;
float Brightness = -0.052;
float Amount = 1;
float2 crossMatrix [3] =
{
float2 (1.1, -0.009),
float2 (1.0, 0.01),
float2 (1.0, 0.01),
};
#endif
//#define AUTOFOCUS
int DoF_TAPS = 5;
int PixelSizeMultiplier = 1;

float2 FoucsPoint = float2(0.5, 0.55);

float EColorSaturation = 1.5;

float BP_factor = 0.25;


float BloomR = 1.2;
float BloomG = 1.5;
float BloomB = 1.00;

//#define HD6_VIGNETTE
#ifdef HD6_VIGNETTE
float rovigpwr = 0.4; // For Round vignette // 0.2
float2 sqvigpwr = float2( 0.2, 0.1 ); // For square vignette: (top, bottom)
float vsatstrength = 0.85; // How saturated vignette is
float vignettepow = 1.5; // For Round vignette, higher pushes it to the corners and increases contrast/sharpness
float vstrengthatnight = 0.7; // How strong vignette is as night, 0-1
#endif

static const float LUMINANCE = float3(0.2125, 0.7154, 0.0721); // custom luma

bool linearLight< string UIName = "Linear Color Math?";> = true;

//#define ungamma22

bool useAmbientHemi< string UIName = "Use Hemispherical Ambient?";> = false;

float3 skyColor< string UIName = "Hemispherical Sky Color"; string Type = "Color";> = {0.7, 0.95, 1.0};

float3 groundColor< string UIName = "Hemispherical Ground Color"; string Type = "Color";> = {0.23, 0.27, 0.12};

bool useGlowMap< string UIName = "Use A Glow Texture?";> = false;

float glowIntensity<
float UIMin = 0.0;
float UIMax = 10.0;
float UIStep = 0.1;
string UIName = "Glow Map Intensity";
> = 1.0;

// Chromatic aberration parameters
float3 fvChroma = float3(0.995, 1.000, 1.005); // displacement scales of red, green and blue respectively
float fBaseRadius = 0.9; // below this radius the effect is less visible
float fFalloffRadius = 1.8; // over this radius the effects is maximal
float fChromaPower = 1.0; // power of the chromatic displacement (curve of the 'fvChroma' vector)


float4 crossProcess_PS(float4 color) : COLOR0
{
float4 image1 = color;
float4 image2 = color;

//float gray = dot(float3(0.3,0.59,0.1), image1); // ????? ?????? float3 ????? ????????? _?12
float gray = dot(float3(0.5,0.5,0.5), image1); // ????? ?????? float3 ????? ????????? _?12

image1 = lerp (gray, image1,Saturation2);

image1 = lerp (0.35, image1,Contrast);

image1 +=Brightness;
// image1 *=1.2;

image2.r = image1.r * crossMatrix[0].x + crossMatrix[0].y;
image2.g = image1.g * crossMatrix[1].x + crossMatrix[1].y;
image2.b = image1.b * crossMatrix[2].x + crossMatrix[2].y;

color = lerp(image1, image2, Amount);

return color;
}
float4 BloomDefuse_PS(float4 bloomInput) : COLOR0
{
float mavg=((bloomInput.x+bloomInput.y+bloomInput.z)*0.333);

bloomInput.xyz-=(mavg*0.3);
bloomInput.xyz=min(bloomInput.xyz,0.095);
bloomInput.xyz+=(mavg*0.22);
bloomInput.xyz*(mavg*1.2);

return bloomInput;
}
float4 SkyrimToneMap_PS( float4 colorInput, float grayadaptation) : COLOR0
{
grayadaptation=max(grayadaptation, 0.0);
grayadaptation=min(grayadaptation, 50.0);
colorInput.xyz=colorInput.xyz/(grayadaptation*AdaptationMax+AdaptationMin);

//colorInput.xyz*=EBrightnessV2;
colorInput.xyz+=0.01;
float3 xncol=normalize(colorInput.xyz);
float3 scl=colorInput.xyz/xncol.xyz;
scl=pow(scl, IntensityContrast);
xncol.xyz=pow(xncol.xyz, ColorSaturation);
colorInput.xyz=scl*xncol.xyz;

float lumamax=ToneMappingOversaturation;
colorInput.xyz=(colorInput.xyz * (1.0 + colorInput.xyz/lumamax))/(colorInput.xyz + ToneMappingCurve);
colorInput.w=1.0;
return colorInput;
}

float4 DistanceFunction_PS (float4 color, float dist, float focus): COLOR0
{
float luma=dot(color.xyz,0.333);
float degree=luma*3.1415926*0.5;//0~90
degree=sin(degree);

dist*=0.0004;
dist+=0.04;

luma=pow(luma,3);
luma=pow(2.71,-luma*2)*degree;

//r0.rgb=0.0;
color.r+=luma*clamp(dist,0.0,0.16);
color.g+=luma*clamp(dist,0.0,0.16*1.2);
color.b+=luma*clamp(dist,0.0,0.16*1.4)*1.15;
color.xyz+=max(focus*0.025,0.04)*luma;

//r0.xyz=1.0;
//r0.xyz=max(r0.xyz-focus*0.2,0);
color.w=1.0;

return color;

}
float4 BleachBypass_PS (float4 color ): COLOR0
{
float luma = dot(color.xyz, LUMINANCE);

float3 blend = luma.xxx;
float L = min(1, max(0, 10*(luma - 0.45)));
float3 result1 = 2.0 * color.xyz * blend;
float3 result2 = 1.0 - 2.0*(1.0 - blend)*(1.0 - color.xyz);
float3 newColor = lerp(result1.xyz, result2.xyz, L);
float3 mixRGB = BP_factor * newColor.xyz;
mixRGB += ((1.0f - BP_factor) * color.xyz);

color.xyz = mixRGB;
color.w=1.0;
return color;
}
float4 Technicolor_PS( float4 colorInput, float2 tex ) : COLOR0
{
float redNegativeAmount = 0.74;
float greenNegativeAmount = 0.7;
float blueNegativeAmount = 0.72;
float TechniPower = tex.x;
float TechniAmount = tex.y;
float4 redfilter = float4(0.8, 1.0, 0.8, 1.00);
float4 greenfilter = float4(0.30, 1.0, 0.0, 1.0);
float4 bluefilter = float4(0.25, 1.0, 1.0, 1.0);
float4 redorangefilter = float4(1.05, 0.620, 0.0, 1.0);
float4 cyanfilter = float4(0.0, 1.30, 1.0, 1.0);
float4 magentafilter = float4(1.0, 0.0, 1.05, 1.05);
float4 yellowfilter = float4(1.6, 1.6, 0.05, 1.0);
float4 tcol = colorInput;

float4 filtgreen = tcol * greenfilter;
float4 filtblue = tcol * magentafilter;
float4 filtred = tcol * redorangefilter;
float4 rednegative = float((filtred.r + filtred.g + filtred.b)/(redNegativeAmount * TechniPower));
float4 greennegative = float((filtgreen.r + filtgreen.g + filtgreen.b)/(greenNegativeAmount* TechniPower));
float4 bluenegative = float((filtblue.r+ filtblue.g + filtblue.b)/(blueNegativeAmount* TechniPower));
float4 redoutput = rednegative + cyanfilter;
float4 greenoutput = greennegative + magentafilter;
float4 blueoutput = bluenegative + yellowfilter;
float4 result = redoutput * greenoutput * blueoutput;

return lerp(tcol, result, TechniAmount);
}

struct VS_OUTPUT_POST
{
float4 vpos : POSITION;
float2 txcoord0 : TEXCOORD0;
};
struct VS_INPUT_POST
{
float3 pos : POSITION;
float2 txcoord0 : TEXCOORD0;
};


float4 _c0 : register(c0); float4 _c1 : register(c1);
float4 _c2 : register(c2); float4 _c3 : register(c3);
float4 _c4 : register(c4); float4 _c5 : register(c5);
float4 _c6 : register(c6); float4 _c44 : register(c44);
float4 _c66 : register(c66); float4 _c72 : register(c72);
float4 _c73 : register(c73); float4 _c74 : register(c74);
float4 _c75 : register(c75); float4 _c76 : register(c76);
float4 _c77 : register(c77); float4 _c78 : register(c78);
float4 _c79 : register(c79); float4 _c80 : register(c80);
float4 _c81 : register(c81); float4 _c82 : register(c82);
float4 _c83 : register(c83); float4 _c84 : register(c84);
float4 _c85 : register(c85); float maxi : register(c86);
float temp : register(c87);

texture2D texs0 : register(s0); texture2D texs1 : register(s1);
texture2D texs2 : register(s2); texture2D texs3 : register(s3);
texture2D texs4 : register(s4); texture2D texs5 : register(s5);
texture2D texs6 : register(s6); texture2D texs7 : register(s7);
texture2D texs13 : register(s13); texture2D texs15 : register(s15);

sampler2D s2 = sampler_state { Texture=<texs2>; };
sampler2D s4 = sampler_state { Texture=<texs4>; };
sampler2D s5 = sampler_state { Texture=<texs5>; };
sampler2D s6 = sampler_state { Texture=<texs6>; };
sampler2D s7 = sampler_state { Texture=<texs7>; };
sampler2D s15 = sampler_state { Texture=<texs15>;};

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

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

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

sampler2D s13 = sampler_state
{
Texture = <texs13>;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = NONE;
AddressU = Clamp;
AddressV = Clamp;
SRGBTexture=FALSE;
MaxMipLevel=0;
MipMapLodBias=0;
};
float4 ChromaticAberration(float2 tex, float outOfFocus)
{
float d = distance(tex, float2(0.5, 0.5));
float f = smoothstep(fBaseRadius, fFalloffRadius, d + outOfFocus * d);
float3 chroma = pow(f + fvChroma, fChromaPower);

float2 tr = ((2.0 * tex - 1.0) * chroma.r) * 0.5 + 0.5;
float2 tg = ((2.0 * tex - 1.0) * chroma.g) * 0.5 + 0.5;
float2 tb = ((2.0 * tex - 1.0) * chroma.b) * 0.5 + 0.5;

float3 color = 0.12*float3(tex2D(s3, tr).r, tex2D(s3, tg).g, tex2D(s3, tb).b) * (1.0 - f);

return float4(color, 1.0);
}
float HueToRGB(float f1, float f2, float hue) {
if (hue < 0.0)
hue += 1.0;
else if (hue > 1.0)
hue -= 1.0;

float res;
if ((6.0 * hue) < 1.0)
res = f1 + (f2 - f1) * 6.0 * hue;
else if ((2.0 * hue) < 1.0)
res = f2;
else if ((3.0 * hue) < 2.0)
res = f1 + (f2 - f1) * ((2.0 / 3.0) - hue) * 6.0;
else
res = f1;

return res;
}

float3 RGBToHSL(float3 color) {
float3 hsl; // init to 0 to avoid warnings ? (and reverse if + remove first part)

/* re-range to be in [0,1] without loss of HDR */
color.r = 1.0 / (1.0 + color.r);
color.g = 1.0 / (1.0 + color.g);
color.b = 1.0 / (1.0 + color.b);

float fmin = min(min(color.r, color.g), color.b); // Min. value of RGB
float fmax = max(max(color.r, color.g), color.b); // Max. value of RGB
float delta = fmax - fmin; // Delta RGB value

hsl.z = (fmax + fmin) / 2.0; // Luminance

// This is a gray, no chroma...
if (delta == 0.0) {
hsl.x = 0.0; // Hue
hsl.y = 0.0; // Saturation
}
// Chromatic data...
else {
if (hsl.z < 0.5)
hsl.y = delta / ( fmax + fmin); // Saturation
else
hsl.y = delta / (2.0 - fmax - fmin); // Saturation

float deltaR = (((fmax - color.r) / 6.0) + (delta / 2.0)) / delta;
float deltaG = (((fmax - color.g) / 6.0) + (delta / 2.0)) / delta;
float deltaB = (((fmax - color.b) / 6.0) + (delta / 2.0)) / delta;

if (color.r == fmax )
hsl.x = deltaB - deltaG; // Hue
else if (color.g == fmax)
hsl.x = (1.0 / 3.0) + deltaR - deltaB; // Hue
else if (color.b == fmax)
hsl.x = (2.0 / 3.0) + deltaG - deltaR; // Hue

if (hsl.x < 0.0)
hsl.x += 1.0; // Hue
else if (hsl.x > 1.0)
hsl.x -= 1.0; // Hue
}

return hsl;
}

float3 HSLToRGB(float3 hsl) {
float3 rgb;

if (hsl.y == 0.0)
rgb = float3(hsl.z, hsl.z, hsl.z); // Luminance
else {
float f2;

if (hsl.z < 0.5)
f2 = hsl.z * (1.0 + hsl.y);
else
f2 = (hsl.z + hsl.y) - (hsl.y * hsl.z);

float f1 = 2.0 * hsl.z - f2;

rgb.r = HueToRGB(f1, f2, hsl.x + (1.0/3.0));
rgb.g = HueToRGB(f1, f2, hsl.x);
rgb.b = HueToRGB(f1, f2, hsl.x - (1.0/3.0));
}

/* recover HDR range HDR */
rgb.r = (1.0 / rgb.r) - 1.0;
rgb.g = (1.0 / rgb.g) - 1.0;
rgb.b = (1.0 / rgb.b) - 1.0;

return rgb;
}

float3 BlendColor(float3 base, float3 blend)
{
float3 blendHSL = RGBToHSL(blend);
return HSLToRGB(float3(blendHSL.r, blendHSL.g, RGBToHSL(base).b));
}
float4 PS_C215BE6E(VS_OUTPUT_POST IN) : COLOR
{
float4 _c0=float4(0, 0.212500006, 0.715399981, 0.0720999986); float4 _c1=float4(0.25, 1, 256, 0);
float4 _c2=float4(0, 2, 4, 8); float4 _c3=float4(58.1640015, 47.1300011, 0, 0);
float4 _c4=float4(-0.5, -1.5, 1.5, 0.5); float4 _c5=float4(2, -1, 0.125, 0);
float4 _c6=float4(256, 2, 4, 8); float4 _c7=float4(1.0, 0.1, 0.8, 1.0);
float4 _c8=float4(0.0, 0.1, 0.8, 0.333); float4 _c9=float4(0.06, 0.1, 0.8, 0.1);
float4 _c10=float4(0.01, 1.4, 0.0, 0.32); float4 _c11=float4(0.333333, 1.0, 0.0, 0.0);
float4 _c12=float4(0.27, 0.67, 0.06, 0.0); //float4 _c12=float4(0.299, 0.587, 0.114, 0.0);
float4 _c13=float4(0.0, 0.0, 0.0, 0.00001); float4 _c150=float4(0.55, 0.9, 0.85, 0.9);
float4 _c195=float4(0.0, 0.0, 0.0, 0.07);

float4 r0; float4 r1;
float4 r2; float4 r3;
float4 r4; float4 r5;
float4 r6; float4 r7;
float4 r8; float4 r9;
float4 r10; float4 r11;

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)
};

float4 _v0=0.0; _v0.xy=IN.txcoord0.xy; float2 coord=0.0;


r1=tex2D(s2, _v0.xy); //HDRSampler
r2=tex2D(s3, _v0.xy); //BloomSampler



//*************************

float2 center=float2(0.5,0.5);
float depth = 0;
float focus = 0;


r0=tex2D(s1, _v0.xy); //GBufferTextureSampler3
r0.y=-_c77.x + _c77.y; //-dofProj.x + dofProj.y
r0.y=1.0/r0.y;
r0.z=r0.y * _c77.y; //dofProj.y
r0.z=r0.z * -_c77.x; //dofProj.x
r0.x=_c77.y * -r0.y + r0.x;
r0.x=1.0/r0.x;
r0.y=r0.z * r0.x;
r0.w=abs(_c79.w);
r3=_c4; //-0.5, -1.5, 1.5, 0.5


depth=r0.z * r0.x - _c78.w; //dofDist.w
depth+=_c78.y * -r3.w; //dofDist.y
depth+=148;//offset
center.x=_v0.x-0.5;
center.y=0.5-_v0.y;

float4 vDofParams = float4(0, 1, 250, 0.75);

//*************************************

#ifdef AUTOFOCUS


r4=tex2D(s1, FoucsPoint); //GBufferTextureSampler3
r4.y=-_c77.x + _c77.y; //-dofProj.x + dofProj.y
r4.y=1.0/r4.y;
r4.z=r4.y * _c77.y; //dofProj.y
r4.z=r4.z * -_c77.x; //dofProj.x
r4.x=_c77.y * -r4.y + r4.x;
r4.x=1.0/r4.x;
r4.y=r4.z * r4.x;

float cdepth;

cdepth=r4.z * r4.x - _c78.w; //dofDist.w
cdepth+=_c78.y * -r3.w; //dofDist.y
cdepth+=148;//offset


r4.w = tex2D(s0, FoucsPoint).w;
if(r4.w > 0)
{
vDofParams.z = cdepth*2.0;
vDofParams.y = cdepth;
}
#endif

//***************



depth = max(depth, 0); //fix zoom bug

//float4 vDofParams = float4(0, 1.5, 900.0, 1.0); //near blur depth, focal plane depth, far blur depth, blurriness cut off constant
float dist;

if(depth < vDofParams.y)
dist = (depth - vDofParams.y)/(vDofParams.y - vDofParams.x);
else
{
dist = (depth - vDofParams.y)/(vDofParams.z - vDofParams.y);
dist = clamp(dist, 0, vDofParams.w);
}

dist = dist * 0.5 + 0.5;


static float3 poisson[60] =
{
float3( 0.2165, 0.1250, 1.0000 ),
float3( 0.0000, 0.2500, 1.0000 ),
float3( -0.2165, 0.1250, 1.0000 ),
float3( -0.2165, -0.1250, 1.0000 ),
float3( -0.0000, -0.2500, 1.0000 ),
float3( 0.2165, -0.1250, 1.0000 ),
float3( 0.4330, 0.2500, 1.0000 ),
float3( 0.0000, 0.5000, 1.0000 ),
float3( -0.4330, 0.2500, 1.0000 ),
float3( -0.4330, -0.2500, 1.0000 ),
float3( -0.0000, -0.5000, 1.0000 ),
float3( 0.4330, -0.2500, 1.0000 ),
float3( 0.6495, 0.3750, 1.0000 ),
float3( 0.0000, 0.7500, 1.0000 ),
float3( -0.6495, 0.3750, 1.0000 ),
float3( -0.6495, -0.3750, 1.0000 ),
float3( -0.0000, -0.7500, 1.0000 ),
float3( 0.6495, -0.3750, 1.0000 ),
float3( 0.8660, 0.5000, 1.0000 ),
float3( 0.0000, 1.0000, 1.0000 ),
float3( -0.8660, 0.5000, 1.0000 ),
float3( -0.8660, -0.5000, 1.0000 ),
float3( -0.0000, -1.0000, 1.0000 ),
float3( 0.8660, -0.5000, 1.0000 ),
float3( 0.2163, 0.3754, 0.8670 ),
float3( -0.2170, 0.3750, 0.8670 ),
float3( -0.4333, -0.0004, 0.8670 ),
float3( -0.2163, -0.3754, 0.8670 ),
float3( 0.2170, -0.3750, 0.8670 ),
float3( 0.4333, 0.0004, 0.8670 ),
float3( 0.4328, 0.5004, 0.8847 ),
float3( -0.2170, 0.6250, 0.8847 ),
float3( -0.6498, 0.1246, 0.8847 ),
float3( -0.4328, -0.5004, 0.8847 ),
float3( 0.2170, -0.6250, 0.8847 ),
float3( 0.6498, -0.1246, 0.8847 ),
float3( 0.6493, 0.6254, 0.9065 ),
float3( -0.2170, 0.8750, 0.9065 ),
float3( -0.8663, 0.2496, 0.9065 ),
float3( -0.6493, -0.6254, 0.9065 ),
float3( 0.2170, -0.8750, 0.9065 ),
float3( 0.8663, -0.2496, 0.9065 ),
float3( 0.2160, 0.6259, 0.8851 ),
float3( -0.4340, 0.5000, 0.8851 ),
float3( -0.6500, -0.1259, 0.8851 ),
float3( -0.2160, -0.6259, 0.8851 ),
float3( 0.4340, -0.5000, 0.8851 ),
float3( 0.6500, 0.1259, 0.8851 ),
float3( 0.4325, 0.7509, 0.8670 ),
float3( -0.4340, 0.7500, 0.8670 ),
float3( -0.8665, -0.0009, 0.8670 ),
float3( -0.4325, -0.7509, 0.8670 ),
float3( 0.4340, -0.7500, 0.8670 ),
float3( 0.8665, 0.0009, 0.8670 ),
float3( 0.2158, 0.8763, 0.9070 ),
float3( -0.6510, 0.6250, 0.9070 ),
float3( -0.8668, -0.2513, 0.9070 ),
float3( -0.2158, -0.8763, 0.9070 ),
float3( 0.6510, -0.6250, 0.9070 ),
float3( 0.8668, 0.2513, 0.9070 )
};
static float3 poisson2[5] =
{
float3 (0.809, 0.41, 1),
float3 (-0.809, 0.41, 1),
float3 (0, 1 , 1),
float3 (-0.58, -0.809, 1),
float3 (0.58, -0.809, 1)


};
float2 pixelSizeHigh;
float2 pixelSizeLow;


pixelSizeHigh.x = 1.000 / _c44.x;
pixelSizeHigh.y = 1.000 / _c44.y;

//pixelSizeHigh.x = 2.0 / _c44.x;
//pixelSizeHigh.y = 2.0 / _c44.y;

pixelSizeHigh.xy *= PixelSizeMultiplier;

pixelSizeLow.xy = pixelSizeHigh.xy;

float2 vMaxCoC = float2(5.0, 10.0);

float radiusScale = 0.35;

float discRadius;
float discRadiusLow;
float centerDepth;
float4 tdepth;

float4 tapHigh;
float4 tapLow;

centerDepth = dist;

discRadius = abs(centerDepth * vMaxCoC.y - vMaxCoC.x);
discRadiusLow = discRadius * radiusScale;

r1 = 0.0;

for(int t = 0; t < DoF_TAPS; t++)
{
float2 coordLow = _v0.xy + (pixelSizeLow.xy * poisson2[t].xy * discRadiusLow);
float2 coordHigh = _v0.xy + (pixelSizeHigh.xy * poisson2[t].xy * discRadius);

tapLow = tex2D(s2, coordLow.xy) * poisson2[t].z;
tapHigh = tex2D(s2, coordHigh.xy) * poisson2[t].z;

tdepth = tex2D(s1, coordHigh.xy); //GBufferTextureSampler3
tdepth.y = -_c77.x + _c77.y; //-dofProj.x + dofProj.y
tdepth.y = 1.0 / tdepth.y;
tdepth.z = tdepth.y * _c77.y; //dofProj.y
tdepth.z = tdepth.z * -_c77.x; //dofProj.x
tdepth.x = _c77.y * -tdepth.y + tdepth.x;
tdepth.x = 1.0 / tdepth.x;

tdepth.w = tdepth.z * tdepth.x - _c78.w; //dofDist.w
tdepth.w += _c78.y * -r3.w; //dofDist.y
tdepth.w += 148;//offset

tdepth.w = max(tdepth.w, 0); //fix zoom bug

if(tdepth.w < vDofParams.y)
tapHigh.w = (tdepth.w - vDofParams.y)/(vDofParams.y - vDofParams.x);
else
{
tapHigh.w = (tdepth.w - vDofParams.y)/(vDofParams.z - vDofParams.y);
tapHigh.w = clamp(tapHigh.w, 0, vDofParams.w);
}

tapHigh.w = tapHigh.w * 0.5 + 0.5;

tapLow.w = tapHigh.w;

float tapBlur = abs(tapHigh.w * 2.0 - 1.0);
float4 tap = lerp(tapHigh, tapLow, tapBlur);

if(tap.w >= centerDepth) tap.w = 1.0;
else tap.w = abs(tap.w * 2.0 - 1.0);

r1.xyz += tap.xyz * tap.w;
r1.w += tap.w;


}

r1.xyz /= r1.w;

//float4 dofcolor = r1;

//dofcolor.w = r1.w / DoF_TAPS;


//***************

r1.w=dot(r1.xyz, r1.xyz); //dp3
r1.w=1.0/r1.w;

//if (-r1.w<0.0) r3 = r1;
//else r3 = _c0.x;

r3 = lerp(_c0.x, r1, saturate(r1.w * 10000));

r4 = r3;
r5 = r3;
r6 = r3;
r7 = r3;

r0.x=r0.z * r0.x - _c78.w; //dofDist.w
r0.x=_c78.y * -r3.w + r0.x; //dofDist.y
r1.w=max(r0.x, _c0.x); //0.0
r0.x=1.0/_c78.z; //dofDist.z
r0.x=r1.w * r0.x;
r1.w=lerp(_c79.y, _c79.z, r0.x);//dofBlur
r0.x=min(_c79.z, r1.w); //dofBlur.z

r0.z=dot(r7.xyz, _c0.yzw); //0.212500006, 0.715399981, 0.0720999986
r8.x=dot(r3.xyz, _c0.yzw); //0.212500006, 0.715399981, 0.0720999986
r8.y=dot(r4.xyz, _c0.yzw); //0.212500006, 0.715399981, 0.0720999986
r8.z=dot(r5.xyz, _c0.yzw); //0.212500006, 0.715399981, 0.0720999986
r8.w=dot(r6.xyz, _c0.yzw); //0.212500006, 0.715399981, 0.0720999986
r1.w=dot(r8, _c1.xxxx); //0.25

r8=r8 - r1.w;
r2.w=dot(r8, r8);
r0.z=r0.z - r1.w;
r0.z=r0.z * r0.z - r2.w;
r0.x=r0.x*r0.x;
if (r0.z<0.0)
{
r0.x=r0.x;
} else r0.x=_c1.y; //1.0


r8=tex2D(s0, _v0.xy); //GBufferTextureSampler2


r8.yz=_c1.yz; // 1.0, 256.0
r9=r8.w * -r8.z + _c2; //0, 2, 4, 8
if (r9.w<0.0) //r9<0.0
{
r9=_c1.w; //0.0
} else r9=_c1.y; //1.0
//r9 is filtered sky mask

//r10=r8.w + tempc6;//c6.yzwx; //256, 2, 4, 8
r10=abs(r8.w * -_c6.x + _c6.yzwx); //256, 2, 4, 8



if (r10.x<0.0)
{
r10.x=-_c1.w; //0.0
} else r10.x=-_c1.y; //1.0

if (r10.y<0.0)
{
r10.y=-_c1.w; //0.0
} else r10.y=-_c1.y; //1.0

if (r10.z<0.0)
{
r10.z=-_c1.w; //0.0
} else r10.z=-_c1.y; //1.0

if (r10.w<0.0)
{
r10.w=-_c1.w; //0.0
} else r10.w=-_c1.y; //1.0


r9=r9 + r10;
r9=r9 * _c4.x; //-0.5


r0.z=dot(r9, _c1.yyyy); //1.0
r0.z=r0.z + _c4.w; //0.5
r0.z=1.0/r0.z;
r8.xzw=r3.xyz * r9.x;


r7.xyz=r7 * _c4.w + r8.xzw; //0.5
r7.xyz=r4 * r9.y + r7;
r7.xyz=r5 * r9.z + r7;
r7.xyz=r6 * r9.w + r7;
r7.xyz=r0.z * r7;
r0.z=-r0.x + _c1.y; //1.0
r1.w=r0.x * _c1.x; //0.25


r3.xyz=r3 * r1.w;
r3.xyz=r7 * r0.z + r3;
r3.xyz=r4 * r1.w + r3;
r3.xyz=r5 * r1.w + r3;
r3.xyz=r6 * r1.w + r3;


//r4.xyz=_v0.yxy * _c5.x + _c5.y; //2, -1
r4.x=_v0.y * _c5.x + _c5.y;
r4.y=_v0.x * _c5.x + _c5.y;
r4.z=_v0.y * _c5.x + _c5.y;

r0.z=r4.y * _c77.z; //dofProj.z
r0.z=r0.y * r0.z;
r1.w=-r4.x * _c77.w; //dofProj.w
r1.w=r0.y * r1.w;
r5.xyz=r1.w * _c73; //motionBlurMatrix.2
r5.xyz=r0.z * _c72 + r5; //motionBlurMatrix.1
r5.xyz=-r0.y * _c74 + r5; //motionBlurMatrix.3
r5.xyz=r5 + _c75; //motionBlurMatrix.4

r0.y=-r5.z * _c77.z; //dofProj.z
r0.y=1.0/r0.y;
r6.x=r5.x * r0.y;
r0.y=r5.z * _c77.w; //dofProj.w
r0.y=1.0/r0.y;
r6.y=r5.y * r0.y;
//r0.yz=-r4 + r6.xxyw;
r0.yz=-r4.yz + r6.xy;

//r0.yz=r0 * _c80.x; //gDirectionalMotionBlurLength.x
r0.y=r0.y * _c80.x;
r0.z=r0.z * _c80.x;
//r4.xy=r0.yzzw * _c5.z; //0.125
r4.x=r0.y * _c5.z;
r4.y=r0.z * _c5.z;
r5=tex2D(s6, _v0.xy); //StencilCopySampler
r1.w=r5.x + -_c85.x; //PLAYER_MASK.x
r4.zw=r3.xyxy * _c2.w; //8.0
//r4.z=r3.x * _c2.w;
//r4.w=r3.y * _c2.w;
//r4.zw=_v0.xyxy * _c3.xyxy + r4; //58.1640015, 47.1300011
r4.z=_v0.x * _c3.x + r4.z; //v2
r4.w=_v0.y * _c3.y + r4.w; //v2
r5=tex2D(s5, r4.zw); //JitterSampler
r2.w=r5.x + _c4.x; //-0.5
//r4.zw=r4.xyxy * r2.w + _v0.xyxy; //v0
r4.zw=r4.xy * (r5.x - 4) + _v0.xy; // fixed
r5.xyz=r3.xyz;
r2.w=_c1.y; //1.0
r3.w=_c1.y; //1.0

//motion blur
for (int iii=0; iii<7; iii++)
{
// r6.xy=r4 * r3.w + r4.zwzw; //v0
r6.x=r4.x * r3.w + r4.z; //v2
r6.y=r4.y * r3.w + r4.w; //v2
r7=tex2D(s6, r6.xy);
r5.w=r7.x - _c85.x;
if (r5.w<0.0)
{
r5.w=_c1.y; //1.0
} else r5.w=_c1.w; //0.0
r6=tex2D(s2, r6.xy);
r5.xyz=r6.xyz * r5.w + r5.xyz;
r2.w=r2.w + r5.w;
r3.w=r3.w + _c1.y; //1.0
}


r2.w=1.0/r2.w;

//r0.yz=r0 * _c44.xxyw; //globalScreenSize
r0.y=r0.y * _c44.x; //globalScreenSize
r0.z=r0.z * _c44.y; //globalScreenSize

r0.y=dot(r0.yz, r0.yz)+_c0.x;//dp2

//r0.y=sqrt(r0.y);
//r0.y=1.0/r0.y;
r0.y=pow(r0.y, _c4.w); //0.5

r0.y=r0.y * _c4.w; //0.5
r0.x=r0.x + _c1.y; //1.0
r0.x=1.0/r0.x;
//r0.y is wrong
r0.x=saturate(r0.y * r0.x);
r4.xyz=r5 * r2.w - r3;
r0.xyz=r0.x * r4 + r3;

//_oC0.xyz=0.5*r0.xyz;

if (-r1.w<0.0) r0.xyz=r3.xyz;
if (-r0.w<0.0) r0.xyz=r1.xyz;

float4 color = r0;
/*
int NUM_SAMPLES = 128;
float Decay = 0.96;
float Exposure = 1.0;
float Weight = 0.25;
float Density = 1.0;

float2 ScreenLightPos;

ScreenLightPos.x = tex2D(s3, _c13.xy).x/256;
ScreenLightPos.y = tex2D(s3, _c13.xy).y/256;
//ScreenLightPos.xy *=256;

float2 texCoord = _v0;
float2 deltaTexCoord = (texCoord.xy - ScreenLightPos.xy);

deltaTexCoord *= 1.0 / NUM_SAMPLES * Density;


float illuminationDecay = 1.0;

if((ScreenLightPos.x != 0)&&(ScreenLightPos.y != 0))
{
for(int x = 0; x < NUM_SAMPLES; x++)
{
texCoord -= deltaTexCoord;
float4 sample = 0.1*tex2D(s0, texCoord.xy);
if(sample.w) sample.xyz = 0.0;
else
{
sample = tex2D(s2, texCoord.xy);
//sample;
sample.w = saturate(dot(sample.xyz, 0.3333) - 20);
if(sample.w == 0) sample.xyz = 0.0;
sample.r *= 0.333;
sample.g *= 0.245;
sample.b *= 0.20;
}

sample *= illuminationDecay * Weight;
color += sample;
illuminationDecay *= Decay;
}
}
//color *= Exposure;
*/
r5=tex2D(s4, _c0.x);//adaptation luminance
r5.w=r5.x;
r5.w=1.0/r5.w;
color.xyz=color.xyz * r5.w;

float maximum=max(color.r,max(color.g, color.b));
//if (maximum>10) color=10;
float storedmaximum;

if (maximum<0.5*storedmaximum) storedmaximum = maximum;

if (maximum>storedmaximum) storedmaximum = maximum;


float4 colorbloom = tex2D(s3, _v0.xy);//0.5

//===========================================================================================
//================Simple==Sharpen==Filter==Code==By==Opezdl(AAA)=============================
//===========================================================================================

//r0=tex2D(s1, _v0.xy); //GBufferTextureSampler3

float4 ScreenSize=_c44;
int i=0;

float4 tcol=colorbloom;
float2 invscreensize=1.0/ScreenSize;
// invscreensize.y=invscreensize.y/ScreenScaleY;
for (i=0; i<8; i++) //higher quality
{

coord.xy=_v0.xy+offset.xy*0.001;//invscreensize*SharpSamplingRange;

float4 sharp=tex2D(s3, coord);

tcol+=sharp;
}
tcol*=0.111;
colorbloom=tcol;

//colorbloom = lerp(colorbloom, ChromaticAberration(coord.xy, 0.1), 0.01);

colorbloom *= r5.w * 0.1;
float hold = 20;
float bloommaximum = max(colorbloom.r, max(colorbloom.g, colorbloom.b));
// if (bloommaximum>hold) colorbloom.xyz = exp(1-colorbloom);

float cgray=dot(color, 0.25);//luma
float3 poweredcolor=pow(color.xyz, EColorSaturation);
float newgray=dot(poweredcolor.xyz, 0.333);
color.xyz=poweredcolor.xyz*cgray/(newgray+0.0001);

float3 oldcoln = color.xyz; // RGB controlled saturation
// so sweet thx HD6!
color.xyz *= dnsatd;
float3 greycn = float3(0.299, 0.587, 0.114);
//float3 greycn = float3(0.333,0.333,0.633); // screw perception
//float3 greycn = float3(0.811,0.523,0.996);
//float3 greycn = float3(0.61, 0.61, 0.61);

color.xyz += (oldcoln.x-(oldcoln.x*dnsatd.x)) * greycn.x;
color.xyz += (oldcoln.y-(oldcoln.y*dnsatd.y)) * greycn.y;
color.xyz += (oldcoln.z-(oldcoln.z*dnsatd.z)) * greycn.z;

//colorbloom.r *= BloomR;
//colorbloom.g *= BloomG;
//colorbloom.b *= BloomB;

colorbloom=BloomDefuse_PS(colorbloom);
color+=((color/1)*0.1);
color+=0.1;
colorbloom-=0.45;
colorbloom=max(colorbloom,0);
colorbloom+=0.22;
//colorbloom*=2;
// Soft Light: X = (((255-L)*U*L)+ (L*R_s))/255
//1 - ((1.0 - base) * (1.0 - blend))
//1 - ((255-U)*(255-L))/255
//colorbloom.xyz*=EBloomAmount;
float tmult = 20;
color/=tmult; colorbloom/=tmult;
color.x = 1.0 - ((1.0 - color.x) * (1.0 - colorbloom.x));
color.y = 1.0 - ((1.0 - color.y) * (1.0 - colorbloom.y));
color.z = 1.0 - ((1.0 - color.z) * (1.0 - colorbloom.z));
color*=tmult;

color.xyz = lerp(color.xyz, oldcoln.xyz *_c83.xyz, 0.15);


float3 curr = Uncharted2Tonemap(color);
float3 whiteScale = Uncharted2Tonemap(W);
color.xyz = curr*whiteScale;


color = pow(color, 0.55);
float3 nsat;
//nsat=float3(1,0.74,0.64); // perfect-ish - removes blue and green from fog and outdoors, makes dwarven ruins very white though
nsat=float3(1.35,0.80,0.74); // Touch greener
//nsat=float3(1,0.70,0.65); // Grey, very grey ice gaves almost white, but... foggy days go pink
//nsat=float3(0.85,0.75,0.7); // More reasnioable, still pink sky and snow in places
//nsat=float3(0.80,0.75,0.73);
//nsat=float3(1,0.64,0.58);
//nsat=float3(1,0.74,0.90);
//nsat=float3(0.8,0.56,0.46);
//nsat=float3(0.7,0.6,0.4); // desatures everything a bit
//nsat=float3(0,0,0); // no color in bloom, makes everything very desaturated, fire looks white almost

// colorbloom = 0.0085*tex2D(s3, _v0.xy);

colorbloom = 0.01*ChromaticAberration(coord.xy, 0.0);



float3 oldcol=colorbloom.xyz;

colorbloom.xyz *= nsat;

float3 greyc = float3(0.8,0.8,0.8); // screw perception
colorbloom.xyz += (oldcol.x-(oldcol.x*nsat.x)) * greyc.x;
colorbloom.xyz += (oldcol.y-(oldcol.y*nsat.y)) * greyc.y;
colorbloom.xyz += (oldcol.z-(oldcol.z*nsat.z)) * greyc.z;

color.xyz+=colorbloom.xyz;

color=BleachBypass_PS(color);

color.xyz = saturate(color.xyz);
color.xyz = lerp(color.xyz, 0.51 * (1 + sin((color.xyz - 0.65)*3.1415926)), 0.75);


color = crossProcess_PS(color);

color = DistanceFunction_PS(color, dist, focus);

//color=Technicolor_PS(color, float2(3, 0.15)); // technicolor pass

float grayadaptation = max(r5.x, max(r5.y,r5.z));
//color = SkyrimToneMap_PS(color, grayadaptation);

float colormin = min(color.r, min(color.g ,color.b));
//if (colormin<0.005) color.rgb=normalize(color.rbg)*colormin;


#ifdef HD6_VIGNETTE
// yes this is my own crazy creation after seing how boring the usual linear circle vignettes typically are
// no doubt I have done it in an overly convoluted way :-)

//float fExposureLevel = 1.0; // compensate for any change from vignette so center is same brightness
float2 inTex = _v0;
float4 voriginal = color;
float4 vcolor = voriginal;
vcolor.xyz=1;
inTex -= 0.5; // Centers vignette
inTex.y += 0.01; // Move it off center and up so it obscures sky less
float vignette = 1.0 - dot( inTex, inTex );
vcolor *= pow( vignette, vignettepow );


// Round Vignette
float4 rvigtex = vcolor;
rvigtex.xyz = pow( vcolor, 1 );
rvigtex.xyz = lerp(float3(0.5, 0.5, 0.5), rvigtex.xyz, 2.0); // Increase Contrast
rvigtex.xyz = lerp(float3(1,1,1),rvigtex.xyz,rovigpwr); // Set strength of round vignette

// Square Vignette (just top and bottom of screen)
float4 vigtex = vcolor;
vcolor.xyz = float3(1,1,1);
float3 topv = min((inTex.y+0.5)*2,0.5) * 2; // Top vignette
float3 botv = min(((0-inTex.y)+0.5)*2,0.5) * 2; // Bottom vignette

topv= lerp(float3(1,1,1), topv, sqvigpwr.x);
botv= lerp(float3(1,1,1), botv, sqvigpwr.y);
vigtex.xyz = (topv)*(botv);

//vigtex.xyz = lerp(float3(1,1,1),vigtex.xyz,sqvigpwr); // Set strength of square vignette

// Add round and square together
vigtex.xyz*=rvigtex.xyz;

vigtex.xyz = lerp(vigtex.xyz,float3(1,1,1),(1-vstrengthatnight)); // Alter Strength at night

vigtex.xyz = min(vigtex.xyz,1);
vigtex.xyz = max(vigtex.xyz,0);
//vigtex.xyz -= 0.5;
//(base < 0.5 ? (2.0 * base * blend) : (1.0 - 2.0 * (1.0 - base) * (1.0 - blend)))
vigtex.xyz = vigtex.xyz < 0.5 ? (2.0 * color.xyz * vigtex.xyz) : (1 - 2 * (1 - color.xyz) * (1 - vigtex.xyz));
// Crap I keep forgetting overlay mode doesnt work in floating point/32bit/hdr dur bee durr

// Increase saturation where edges were darkenned
float3 vtintensity = dot(color.xyz, float3(0.2125, 0.7154, 0.0721));
color.xyz = lerp(vtintensity, color.xyz, ((((1-(vigtex.xyz*2))+2)-1)*vsatstrength)+1 );

//color.xyz+=0.02;
color.xyz *= (vigtex.xyz);
//color.xyz *= fExposureLevel;

#endif
float Luminance = 0.08f;
static const float fMiddleGray = 0.15f;
static const float fWhiteCutoff = 1.5f;
//color *= fMiddleGray / ( Luminance + 0.001f );
//color *= ( 1.0f + ( color / ( fWhiteCutoff * fWhiteCutoff ) ) );
//color /= ( 1.0f + color );

float GContrast = 1.33;

//color.xyz = lerp(0.5, color, Contrast);
color.xyz = pow(color.xyz, GContrast) / (pow(saturate(color.xyz), GContrast) + pow(1.0 - saturate(color.xyz), GContrast));

if (any(color)&&linearLight) return pow(color,1/1.2);

#if ungamma
else if (any(color)&&linearLight) return pow(color,1.2);
groundColor = ungamma22(groundColor);
skyColor = ungamma22(skyColor);
else if(useAmbientHemi) return lerp(groundColor,skyColor,max(0,0.5*color.y+0.5)); //linearLightly interpolate between the two colors based on the World Normal's Y/up vector (shifted into 0-1 range)
else if(useAmbCube) return ungamma22(texCUBElod(s13, float4(N,7.8)).rgb)*ambCubeScale;
#endif ungamma

color.w=1.0;
return color;
}

technique Shader_C215BE6E
{
pass p0
{
PixelShader = compile ps_3_0 PS_C215BE6E();
}
}


Schak hat in seiner V3 noch eine andere drin...
 
Zuletzt bearbeitet:
@Lord
Immer noch ?!
is doch langsam nicht mehr normal mit dem teil, schon nervig genug diese absturzgefahr und texturen fresserei :stupid:

@Pic
Ja hat es, is aber ne carline :p

und wo wir schon mal dabei sind, nach nur unglaublichen 6 anläufen im zmod, ging es endlich :rolleyes:


rest is erst ma top ziekrät >: D
was aber auch daran liegt, dass lichter und so fehlen
 
die felge kommt geil, enn. komplett sälfmäd? :d

und mit der neuen .dll hab ich wieder 15fps weniger wie normal :(






 
Zuletzt bearbeitet:
Wo bekommt man denn die neue ENB?
 
mal die ersten bilder vom Patch 7

gtaiv2013011220343474.jpg

gtaiv2013011220360831.jpg

gtaiv2013011220364185.jpg

gtaiv2013011220525983.jpg

gtaiv2013011220531989.jpg

gtaiv2013011220534448.jpg

gtaiv2013011220540247.jpg

gtaiv2013011220540891.jpg

gtaiv2013011220544426.jpg

gtaiv2013011220551860.jpg

gtaiv2013011220534448.jpg

gtaiv2013011220555865.jpg

gtaiv2013011220571146.jpg

gtaiv2013011220575313.jpg
 
iwie fehlen die schatten unterm auto. aber die werte in der ini reagieren nicht drauf :(
 
@schak
jow, aber is "recycled" aus na anderen carline die ich mal für nen suv gemacht hab :d

volle ingame bilder folgen gleich :)
 
Hab mir jetzt die ENB runtergeladen. Wie funktioniert denn das jetzt? Welche Dateien müssen in den GTA Ordner? hab jetzt eine Injector und eine Wrapper Veriosn. Blick da gerade nicht so durch :(
 
Hab es hinbekommen mit der neuen ENB. SIeht aber allerdings sehr bescheiden aus. Hab jetzt natürlich alle dateien ersetzt und es ist nun alles verschwommen. Hab zwar mehr Frames aber was nützt das... :(
 
@all

ENBSeries • View topic - GTA 4 v0.135

effect.txt muss ja geändert werden


replace these
Code:
float tempF1;
float tempF2;
float tempF3;
....
float tempF9;
float tempF0;
by these
Code:
float4 tempF1;
float4 tempF2;
float4 tempF3;
replace these
Code:
float ScreenSize;
float ScreenScaleY;

by these
Code:
float4 ScreenSize;

Find in shaders all tempF1, tempF2, ... tempF0, replace them with tempF1.x, tempF1.y, ...tempF3.y
Find in shaders all ScreenSize and replace with ScreenSize.x
Find in shaders all ScreenScaleY and replace with ScreenSize.z
 
da reicht mein englisch nicht für aus :heul:

mal ne doofe frage,warum hat er das den nicht gleich geändert :confused:

jetzt hat´s klick gemacht,nur wer seine eigene effekt.txt benutzt :fresse:
 
Zuletzt bearbeitet:
einfach die einen sachen mit den anderen ersetzen.

Die enb sachen, die wir benutzen sind, sind ganz andere. Und vielen haben andere enbeffect dateien, deshalb geht das leider nicht :/
 
So dann lüftet wir mal das, was sich hinter der felge und dem strauch da oben verbirgt :fresse:

..einige @!§*'>| momente im zmod später







dann dachte ich mir, hey !!!! fixen wir mal den auspuff.. und wech waren die texturen
.. zmod, immer wieder ein erlebnis :rolleyes:

ach und der rote fleck auf der scheibe, sollte das darstellen, was dann aber anscheind anders kam als gedacht.
 
Zuletzt bearbeitet:
@ enn sehr gut der bmw:d
@ all wer lesen kann ist klar im vorteil, boris hat im downloadbereich extra darauf hingewiesen das die effect.txt geändert, bzw auf skyrim niveau gebracht werden muss, und nur die dll tauschen langt auch nicht aus, da die ini zur neuen enb dll anders aufgebaut ist. und fps einbrüche habe ich nicht damit, ist sogar besser geworden teilweise, aber mal warten aufs nächste update.
 

Lexus LFA Nurburgring by p4elkin :banana::banana:







 
So ich hab jetzt die neue ENB am laufen aber da ja alles so scheisse aus sah warum auch immer hab ich jetzt die "enbseries.ini" und die "effect.txt" von schakusa genommen. Wenn ich jetzt aber in der "enbseries.ini" die "d3d9.dll" einfüge startet das Spiel nicht mehr. Warum nicht?
 
Mit der dll und der effect.txt und angepassten enb mit meinen befehlen hab ich kaum FPS einbußen. Mit 2880x1620 Spiele ich mit 35-40 FPS. Selten mal drops auf 30-32 Fps.
Nur habe ich die shaders noch net angepasst wo finde ich die?
Und brauche ich die enbeffect.fx auch für die neue enb oder kann man da die alte nehmen?
 
Hardwareluxx setzt keine externen Werbe- und Tracking-Cookies ein. Auf unserer Webseite finden Sie nur noch Cookies nach berechtigtem Interesse (Art. 6 Abs. 1 Satz 1 lit. f DSGVO) oder eigene funktionelle Cookies. Durch die Nutzung unserer Webseite erklären Sie sich damit einverstanden, dass wir diese Cookies setzen. Mehr Informationen und Möglichkeiten zur Einstellung unserer Cookies finden Sie in unserer Datenschutzerklärung.


Zurück
Oben Unten refresh