Engine flame

A shader that creates an effect of a jet/space engine exhaust. After some modifications can be used to create a simple fireplace.

Shader code
shader_type spatial;

uniform sampler2D noise;
uniform sampler2D gradient;

float fresnel(float amount, vec3 normal, vec3 view)
{
	return pow(
		(clamp(dot(normalize(normal), normalize(view)), 0.0, 1.0)),
		amount
	);
}

void fragment() {
	float basic_fresnel = fresnel(2.0, NORMAL, VIEW);
	vec4 pixel = texture(noise, UV * vec2(1, 0.25) + vec2(0, 2.0 * TIME));
	vec4 color = texture(gradient, vec2(UV.y, 0));
	ALBEDO = pixel.rgb * color.rgb;
	EMISSION = ALBEDO * 5.0;
	ALPHA = pixel.r * pow(UV.y, 1) * pow(basic_fresnel, 2.0);
}
Tags
engine, flame
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 miskatonicstudio

Hexagon pattern

UV light (2D and 3D)

Pride

guest

0 Comments
Inline Feedbacks
View all comments