Explosion/Implosion pixel shader code in GLSL:
uniform sampler2D tex;
void main()
{
vec2 cen = vec2(0.5,0.5) - gl_TexCoord[0].xy;
vec2 mcen = - // delete minus for implosion effect
0.07*log(length(cen))*normalize(cen);
gl_FragColor = texture2D(tex, gl_TexCoord[0].xy+mcen);
}
By applying this filter to image below

we get such explosion effect

and such implosion effect

No comments:
Post a Comment
Comment will be posted after comment moderation.
Thank you for your appreciation.