For anamorphic blur (separate kernel for horizontal and vertical blur) I run it something like this:
Code: Select all
python gaussianGenerator.py --taps %taps% --notfinal
python gaussianGenerator.py --taps %taps% --prefix gaussianVert --append
Code: Select all
#include "gaussianWeights.fxh"
float4 horizontalGaussian(sampler2D samp, float2 uv, float pixelsize)
{
float4 color = tex2D(samp, uv) * gaussianWeights[0];
for (int i = 1; i < gaussianLoopLength; i++)
{
color += tex2D(tex, uv + float2(gaussianOffsets[i], 0.0) * pixelsize) * gaussianWeights[i];
color += tex2D(tex, uv - float2(gaussianOffsets[i], 0.0) * pixelsize) * gaussianWeights[i];
}
return color;
}
float4 verticalGaussian(sampler2D samp, float2 uv, float pixelsize)
{
float4 color = tex2D(samp, uv) * gaussianVertWeights[0];
for (int i = 1; i < gaussianVertLoopLength; i++)
{
color += tex2D(tex, uv + float2(0.0, gaussianVertOffsets[i]) * pixelsize) * gaussianVertWeights[i];
color += tex2D(tex, uv - float2(0.0, gaussianVertOffsets[i]) * pixelsize) * gaussianVertWeights[i];
}
return color;
}