Industrial Smoke

A simple industrial smoke shader (Godot 4.0). No restrictions. Use it for whatever you like.

Shader code
shader_type fog;

uniform sampler2D noise00;
uniform sampler2D noise01;
uniform float density_multiplicator = 3.;
uniform vec3 base_color: source_color = vec3(.2, .2, .2);
uniform vec3 fade_out_color: source_color = vec3(.8, .8, .8);
uniform float fade_out_level = .5;
uniform float speed = .25;

mat2 rot2d(float a) {
	return mat2(vec2(cos(2), -sin(a)), vec2(sin(a), cos(a)));
}

void fog() {
	vec3 uvw = UVW;
	uvw.y -= fract(TIME * speed) - .5; // -0.5 ... 0.5
	
	float n00 = texture(noise00, rot2d(abs(sin(TIME * .2))) * UVW.xz).r;
	float n01 = texture(noise01, rot2d(abs(sin(TIME * .2))) * UVW.xz).r * 1.4;
	float d = step(.4 * n01, uvw.y) - step(.50 * n01, uvw.y);
	
	d *= n00;
	d *= 3. * (1. - UVW.y); // fade out
	
	d *= density_multiplicator;
	DENSITY = d;

	vec3 col = mix(base_color, fade_out_color, pow(fade_out_level, 1./2.2));
	ALBEDO = col;
}
Tags
Fog, industrial, Smoke, toxic
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 a python script

Lava Shader

Fractal Pyramid

Related shaders

Smoke Shader

Omen’s Smoke Bomb from Valorant

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments