new build gui select
This commit is contained in:
43
Shaders/fire.gdshader
Normal file
43
Shaders/fire.gdshader
Normal file
@@ -0,0 +1,43 @@
|
||||
shader_type spatial;
|
||||
render_mode unshaded, cull_disabled;
|
||||
|
||||
// uniforms: detail_strength, scroll_speed, fire_height, fire_shape,
|
||||
// fire_thickness, fire_sharpness, intensity
|
||||
// noise parameters: noise_octaves, noise_lacunarity, noise_gain,
|
||||
// noise_amplitude, noise_frequency
|
||||
|
||||
//float hash(vec2 p) { /* ... */ }
|
||||
//float noise(vec2 x) { /* ... */ }
|
||||
//float fbm(vec2 p) { /* ...mix octaves...*/ }
|
||||
|
||||
void fragment() {
|
||||
vec2 uv = UV;
|
||||
vec2 muv = -uv;
|
||||
muv.x = mod(muv.x, 1.0) - 0.5;
|
||||
muv.y += 0.84;
|
||||
|
||||
float scroll = scroll_speed * detail_strength * TIME;
|
||||
float n = fbm(detail_strength * muv - vec2(0.0, scroll));
|
||||
|
||||
float fire_intensity = intensity - 16.0 * fire_sharpness * pow(
|
||||
max(0.0,
|
||||
length(
|
||||
muv * vec2((1.0/fire_thickness) + muv.y * fire_shape, 1.0/fire_height)
|
||||
) - n * max(0.0, muv.y + 0.25)
|
||||
), 1.2
|
||||
);
|
||||
|
||||
float fi1 = clamp(n * fire_intensity * (1.5 - pow(uv.y, 14.0)), 0.0, 1.0);
|
||||
|
||||
vec3 col = vec3(
|
||||
1.5 * fi1,
|
||||
1.5 * pow(fi1, 3.0),
|
||||
pow(fi1, 6.0)
|
||||
);
|
||||
|
||||
float alpha = fire_intensity * (1.0 - pow(uv.y, 3.0));
|
||||
vec4 final = vec4(mix(vec3(0.0), col, alpha), alpha);
|
||||
|
||||
ALBEDO = final.rgb;
|
||||
ALPHA = final.a;
|
||||
}
|
||||
1
Shaders/fire.gdshader.uid
Normal file
1
Shaders/fire.gdshader.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://by8d646frg4b5
|
||||
Reference in New Issue
Block a user