how to code ThunderForce III's sinusoidal deformation?

Started by
0 comments, last by Antheus 12 years, 4 months ago
Hi guys,

old-school gamers may remember Technosoft's ThunderForce III/Thunder Spirits (shoot'em up): actually, I would be interested in coding a shoot'em up which could include a sinusoidal deformation applied on a background texture (as seen in the fire level => please, see this picture: sinusoidal deformation in the background ).

To code this graphic effect, do you have any hint or piece of info to share ? (or some math tricks?) :)

Thank you very much for your help!!!

PS: depending on your answers, I would use Java or C# or C++/SDL to code my game.
Advertisement
The easiest way today would probably be using shaders.

Something you can try out here (using WebGL).

// copy paste into the editor
#ifdef GL_ES
precision highp float;
#endif

uniform vec2 resolution;
uniform float time;
uniform sampler2D tex0;
uniform sampler2D tex1;

void main(void)
{
vec2 p = -1.0 + 2.0 * gl_FragCoord.xy / resolution.xy;
vec2 uv;

uv.x = p.x + 0.25*sin(6.0*p.y+time);
uv.y = p.y;

gl_FragColor = vec4(texture2D(tex0,uv).xyz, 1.0);
}

This topic is closed to new replies.

Advertisement