Jump to content
  • Advertisement
Sign in to follow this  

how to code ThunderForce III's sinusoidal deformation?

This topic is 2867 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post

Link to post
Share on other sites
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;

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);

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!