spinning propeller blade

Create a MeshInstance3D, set the mesh type to a plane then add this shader to it to see the effect.

Shader code
shader_type spatial;

uniform vec3 color = vec3(0.0);
const float lim = 0.0;
const float speed = 2.5;

void fragment() {
	ALBEDO = vec3(0.5);
	
	float angle = TIME * speed;
	float x = cos(angle)*(UV.x-0.5) + sin(angle)*(UV.y-0.5);
	float y = -sin(angle)*(UV.x-0.5) + cos(angle)*(UV.y-0.5);
	
	float dist = sqrt(pow(x, 2) + pow(y, 2));
	if(dist < 0.5){
		ALPHA = 0.25 - (((pow(x, 2)/dist) - pow(y, 2)/2.0) * 5.0);
		ALPHA /= 2.0;
		if(ALPHA < lim){
			ALPHA = lim;
		};
		ALPHA += 0.15;
	}else{ ALPHA = 0.0; }
}
Tags
3d, animated, hellicopter blades
The shader code and all code snippets in this post are under MIT license and can be used freely. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

More from Matthias

Carbon fiber wrap

Matrix style 3D hologram

Brick Wall

Subscribe
Notify of
guest

2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
GEG-fairbear8974
7 months ago

This is great!

cyzaine
cyzaine
16 days ago

The code as written ignores the color parameter, just change line 8 to ALBEDO = color; to fix that.

The effect is also only on 1 side of the mesh as written. Add
render_mode cull_disabled;
To see it from other anles.

Last edited 16 days ago by cyzaine