Qa GL47 CR
Qa GL47 CR
/////////////////////////TEXTURES / INTERNAL
PARAMETERS/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////
/////////////////////////TEXTURES / INTERNAL
PARAMETERS/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////
sampler2D SamplerColor
{
Texture = texColor;
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = LINEAR;
AddressU = Clamp;
AddressV = Clamp;
};
/////////////////////////VERTEX
SHADER/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/////////////////////////VERTEX
SHADER/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
struct VS_OUTPUT_POST
{
float4 vpos : POSITION;
float2 txcoord : TEXCOORD0;
};
/////////////////////////PIXEL
SHADERS////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
/////////////////////////PIXEL
SHADERS////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////
float2 coord=IN.txcoord.xy*2.0-1.0;
float offsetfact=length(IN.txcoord.xy*2.0-1.0);
offsetfact=pow(offsetfact,fADOF_ImageChromaCurve)*fADOF_ImageChromaAmount*BUFFER_RC
P_WIDTH;
[unroll]
for (float c=0; c<iADOF_ImageChromaHues && c < 90; c++)
{
float temphue = c/iADOF_ImageChromaHues;
float3 tempchroma = saturate(float3(abs(temphue * 6.0 - 3.0) - 1.0,2.0
- abs(temphue * 6.0 - 2.0),2.0 - abs(temphue * 6.0 - 4.0)));
float tempoffset = (c + 0.5)/iADOF_ImageChromaHues - 0.5;
float3 tempsample = tex2Dlod(SamplerColor,
float4(coord.xy*(1.0+offsetfact*tempoffset)*0.5+0.5,0,0)).xyz;
scenecolor.xyz += tempsample.xyz*tempchroma.xyz;
chromaweight += tempchroma;
}
//not all hues have the same brightness, FF0000 and FFFF00 are obviously
differently bright but are just different hues.
//there is no generic way to make it work for all different hue options.
Sometimes / samples * 0.5 works, then * 0.666, then something completely different.
scenecolor.xyz /= dot(chromaweight.xyz, 0.333);
return scenecolor;
}
/////////////////////////
TECHNIQUES/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
/////////////////////////
TECHNIQUES/////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////