Hi there :)
Thanks to Marek I finally managed to get most of my shaders I've written
to work with the OB SDK.
I've written a couple of shaders in GLSL before I started using the OB
SDK, and now I try to "convert by hand" some of them to HLSL.
My primary target now is a blur-shader.
I tried creating a horizontal blur so far - but it doesnt really look
like vertical blur!?
Images:
http://img268.imageshack.us/img268/4949/brokenblur.jpg
http://img196.imageshack.us/img196/7596/brokenblur2.jpg
My next question would be, how I could add another pass (my vertical blur)?
so long
-------
[post_hor_blur_ps20.fxc]
#include "common_ps_fxc.h"
sampler BaseTextureSampler : register( s0 );
// Pixel width in texels
float pixelWidth = 1;
float PixelKernel[13] =
{
-6,
-5,
-4,
-3,
-2,
-1,
0,
1,
2,
3,
4,
5,
6,
};
static const float BlurWeights[13] =
{
0.002216,
0.008764,
0.026995,
0.064759,
0.120985,
0.176033,
0.199471,
0.176033,
0.120985,
0.064759,
0.026995,
0.008764,
0.002216,
};
HALF4 main(float2 iTexCoord : TEXCOORD0) : COLOR
{
float4 color = 0;
float2 samp = iTexCoord;
samp.y = iTexCoord.y;
for (int i = 0; i < 13; i++) {
samp.x = iTexCoord.x + PixelKernel[i] * pixelWidth;
color += tex2D(BaseTextureSampler, samp.xy) * BlurWeights[i];
}
return color;
}
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders