Professional Documents
Culture Documents
Effect Functions
Effect Functions
-----
// Helpers
//---------------------------------------------------------------------------------
-----
//mine
float3 curr = ((color*(A*color+C*B)+D*E)/(color*(A*color+B)+D*F))-E/F;
float3 whiteScale = ((W*(A*W+C*B)+D*E)/(W*(A*W+B)+D*F))-E/F;
color = curr*whiteScale;
color = color*ExpAdjust;
//end of mine
return colorInput;
}
float4 FilmPass(float4 B)
{
float4 G = B;
float4 H = 0.01;
B = pow(abs(B), Linearization);
B = lerp(H, B, Contrast);
float A = GetLuminance(B.rgb);
float4 D = A;
float a = RedCurve;
float b = GreenCurve;
float c = BlueCurve;
float d = BaseCurve;
float4 C = B;
float4 Di = 1.0 - D;
float4 iF = F;
float N = GetLuminance(F.rgb);
float4 Cn = F;
if (N < 0.5)
Cn = (2.0 * N - 1.0) * (F - F * F) + F;
else
Cn = (2.0 * N - 1.0) * (sqrt(F) - F) + F;
image1 +=CrossBrightness;
return color;
}
return colorInput;
}
return colorInput;
}
float4 res;
res =tex2D(InputSampler, uvsrc);
float ScaleXY= (1/1024);
res+=tex2D(InputSampler, uvsrc+float2(-0.94201624*ScaleXY, -
0.39906216*ScaleXY));
res+=tex2D(InputSampler, uvsrc+float2( 0.94558609*ScaleXY, -
0.76890725*ScaleXY));
res+=tex2D(InputSampler, uvsrc+float2(-0.09418410*ScaleXY, -
0.92938870*ScaleXY));
res+=tex2D(InputSampler, uvsrc+float2( 0.34495938*ScaleXY,
0.29387760*ScaleXY));
res+=tex2D(InputSampler, uvsrc+float2(-0.91588581*ScaleXY,
0.45771432*ScaleXY));
res+=tex2D(InputSampler, uvsrc+float2(-0.81544232*ScaleXY, -
0.87912464*ScaleXY));
res+=tex2D(InputSampler, uvsrc+float2(-0.38277543*ScaleXY,
0.27676845*ScaleXY));
res+=tex2D(InputSampler, uvsrc+float2( 0.97484398*ScaleXY,
0.75648379*ScaleXY));
res+=tex2D(InputSampler, uvsrc+float2( 0.44323325*ScaleXY, -
0.97511554*ScaleXY));
res+=tex2D(InputSampler, uvsrc+float2( 0.53742981*ScaleXY, -
0.47373420*ScaleXY));
res+=tex2D(InputSampler, uvsrc+float2(-0.26496911*ScaleXY, -
0.41893023*ScaleXY));
res+=tex2D(InputSampler, uvsrc+float2( 0.79197514*ScaleXY,
0.19090188*ScaleXY));
res+=tex2D(InputSampler, uvsrc+float2(-0.24188840*ScaleXY,
0.99706507*ScaleXY));
res+=tex2D(InputSampler, uvsrc+float2(-0.81409955*ScaleXY,
0.91437590*ScaleXY));
res+=tex2D(InputSampler, uvsrc+float2( 0.19984126*ScaleXY,
0.78641367*ScaleXY));
res+=tex2D(InputSampler, uvsrc+float2( 0.14383161*ScaleXY, -
0.14100790*ScaleXY));
res /= 17;
res.xyz=res.xyz-float3(LenzThresh,LenzThresh,LenzThresh);
if(res.x < 0)
{
res.x=0;
}
if(res.y < 0)
{
res.y=0;
}
if(res.z < 0)
{
res.z=0;
}
res.w= 1.0;
res *= 4;
return res;
}
sepia *= ColorTone;
float4 depth=nonlinearDepth;
depth.y=-dofProj.x + dofProj.y;
depth.y=1.0/depth.y;
depth.z=depth.y * dofProj.y;
depth.z=depth.z * -dofProj.x;
depth.x=dofProj.y * -depth.y + depth.x;
depth.x=1.0/depth.x;
depth.y=depth.z * depth.x;
depth.x=max(depth.x, 0.0);
return depth.x;
}