17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-04 01:52:05 +01:00

Let the smoke leave the exhaust as a widening jet that fades in

This commit is contained in:
2026-10-20 18:00:51 +02:00
parent abbdca4773
commit cf36b24e8d
8 changed files with 42 additions and 6 deletions

View File

@@ -48,5 +48,9 @@ void main()
vec3 color = source.oldcolor.rgb;
if (options.x > 0.5)
color = source.color.rgb * particle_light((view * vec4(world, 1.0)).xyz, world, options.y);
particle_emit(world, size, vec3(particle.position.w, 0.0, 0.0), color, clamp(particle.state.x, 0.0, 1.0), uint(options.z));
float opacity = clamp(particle.state.x, 0.0, 1.0);
// showing up after the birth (smoke_source::fade_in())
if (source.settling.w > 0.0)
opacity *= smoothstep(0.0, source.settling.w, particle.state.y);
particle_emit(world, size, vec3(particle.position.w, 0.0, 0.0), color, opacity, uint(options.z));
}