Play with Furcifer sprite deformation shader

deformation shader from play with Furcifer 

 

you guys are awsome 

 

Shader code
shader_type canvas_item;

uniform vec2 deformation = vec2(0, 0);
uniform float sideWaysDeformationFactor = 5.0;
uniform float knockbackFactor = 0.4;

void vertex() {
	vec2 deformationStrength = abs(deformation);
	float sideWaysDeformation = min(deformationStrength.x, deformationStrength.y);
	float spriteWidth = abs(VERTEX.x);
	if (sign(VERTEX.y) != sign(deformation.y)) {
		VERTEX.x += sideWaysDeformation * sideWaysDeformationFactor * spriteWidth * sign(deformation.x);
	}
	vec2 scale = 1.0 - deformationStrength;
	
	VERTEX.x *= scale.x / scale.y;
	VERTEX.y *= scale.y / scale.x;
	VERTEX.xy += deformation * spriteWidth * knockbackFactor;
}
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

More from snesmocha

Samuel Wolffang based rgb shift shader

more shaders converted (enviroment)

Shader Toy Conversion by scarm

Related shaders

Frosty Rotative Deformation

2d sprite based vfx gradient shader

Shining Sprite Effect

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments