I'm writing to you today because i found in you a kind of hope.
I saw a topic where someone converted a GLSL code to HLSL code.
Currently, i'm working on THE GAME OF MY LIFE every minutes of my life, and i'm stuck for some weeks.
I found this shockwave effect that i needed on this website :
http://www.geeks3d.com/20091116/shader- ... lter-glsl/
And this website found the shader on this website :
http://empire-defense.crystalin.fr/blog ... ith_shader
I tried to learn hlsl and glsl but i'm too far to succeed.
I know that's not your job to "do my work" but i'll be happy if you can give me a hand.
Here is the code I would like to convert :
Code: Select all
uniform sampler2D sceneTex; // 0
uniform vec2 center; // Mouse position
uniform float time; // effect elapsed time
uniform vec3 shockParams; // 10.0, 0.8, 0.1
void main()
{
vec2 uv = gl_TexCoord[0].xy;
vec2 texCoord = uv;
float distance = distance(uv, center);
if ( (distance <= (time + shockParams.z)) &&
(distance >= (time - shockParams.z)) )
{
float diff = (distance - time);
float powDiff = 1.0 - pow(abs(diff*shockParams.x),
shockParams.y);
float diffTime = diff * powDiff;
vec2 diffUV = normalize(uv - center);
texCoord = uv + (diffUV * diffTime);
}
gl_FragColor = texture2D(sceneTex, texCoord);
}
(And sorry for my awful english...)