Jump to content

  • Log In with Google      Sign In   
  • Create Account


SirIgor

Member Since 21 Mar 2013
Offline Last Active Apr 05 2013 05:43 AM
-----

Posts I've Made

In Topic: [DX9] Blur with variable radius

03 April 2013 - 07:45 AM

Update: The problem is solved. Thanks.

 

We're trying to implement 2-pass Gaussian blur on HSL2.0. Here is a code of shader for horizontal blur. Pixelwidth is a radius. This shader doesn't work, the result looks as without the shader, please can you help?

sampler s0: register(s0);

float1 pixelwidth: register(c0);

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

float1 Clip(float1 arg): float1
{
if (arg<0) arg=0;
if (arg>1) arg=1;
return arg;
}

float4 main_ps(float2 tex: TEXCOORD0):COLOR
{
float4 cl=(0,0,0,0);
float2 coord=tex;
for (int i=0; i<13; i++){
coord.x=Clip(tex.x+PixelKernel[i]*pixelwidth);
cl+=tex2D(s0, coord)*BlurWeights[i];
}
return cl;
}

In Topic: [DX9] Blur with variable radius

28 March 2013 - 07:21 AM

We afraid that Summed Area Tables on PS 2.0 will not work fast enough.

 

Computable shaders is a good idea, but it require DX11 or Cuda.


In Topic: [DX9] Blur with variable radius

27 March 2013 - 08:38 AM

Thanks, I'll try Summed Area Tables.


In Topic: [DX9] Blur with variable radius

27 March 2013 - 07:45 AM

Thanks for your responses!

 

I need to apply a dynamic blur to photography for multimedia application in realtime. Blur radius will change in every frame smoothly. Radius will be between 0 and around 150.

 

Hodgman,

I see very nice blur on your screenshot. My congratulations! Regrettably I need variable blur adjustable by user (templates).


In Topic: [DX9] How to correctly render several alpha textures to alpha RT?

22 March 2013 - 12:49 PM

phil_t,

 

Results are brilliant! Exactly what we need for a correct alpha blending. Thank you!


PARTNERS