Comments on: (Shader Library) 2D Shockwave Post Processing Filter (GLSL) https://www.geeks3d.com/20091116/shader-library-2d-shockwave-post-processing-filter-glsl/ Graphics Cards and GPUs News, Graphics Programming, Home of FurMark Wed, 12 Feb 2014 21:14:16 +0000 hourly 1 https://wordpress.org/?v=6.7.1 By: Koren https://www.geeks3d.com/20091116/shader-library-2d-shockwave-post-processing-filter-glsl/#comment-27511 Fri, 22 Feb 2013 14:44:50 +0000 http://www.geeks3d.com/?p=6140#comment-27511 Thanks !
It was realy usefull to me. There is the HLSL version I made from your code:

texture myTexture;
sampler2D samplerState = sampler_state {
Texture = ;
MinFilter = Point;
MagFilter = Point;
MipFilter = Linear;
AddressU = CLAMP;
AddressV = CLAMP;
};

float xcenter;
float ycenter;
float magnitude;
float width;

struct VS_OUTPUT
{
float4 Position : POSITION;
float2 TexCoords : TEXCOORD0;
};

float4 shockwave (VS_OUTPUT Input) : COLOR0
{

float4 colour;
float xdif = Input.TexCoords.x – xcenter;
float ydif = Input.TexCoords.y – ycenter;
float2 center;
center.x = xdif;
center.y = ydif;
float distance = sqrt(xdif * xdif + ydif * ydif);

if((distance = magnitude – width)){
float diff = (distance – magnitude);
float powDiff = 1.0 – pow(abs(diff*10.0), 1.5);
float diffTime = diff * powDiff;
float2 diffUV = normalize(Input.TexCoords – center);
Input.TexCoords = Input.TexCoords + (diffUV * diffTime);
}

colour = tex2D(samplerState, Input.TexCoords);

return colour;
}

technique Main {
pass P0{
PixelShader = compile ps_2_0 shockwave();
}
}

]]>
By: UnrealPHD Studios https://www.geeks3d.com/20091116/shader-library-2d-shockwave-post-processing-filter-glsl/#comment-15768 Sun, 14 Nov 2010 20:10:44 +0000 http://www.geeks3d.com/?p=6140#comment-15768 That’s a neat effect. I will check it out in GeeXLab, thanks!

]]>