diff --git a/src/pp/pp_vis/pp_vis_core.c b/src/pp/pp_vis/pp_vis_core.c index 1125ace6..526831cc 100644 --- a/src/pp/pp_vis/pp_vis_core.c +++ b/src/pp/pp_vis/pp_vis_core.c @@ -2263,77 +2263,71 @@ void V_TickForever(WaveLaneCtx *lane) ////////////////////////////// //- Wall particles - // if (material != P_MaterialKind_Flesh) - // { - // //- Wall debris - // { - // V_Emitter emitter = Zi; - // { - // // emitter.flags |= V_ParticleFlag_PruneWhenStill; - // // emitter.flags |= V_ParticleFlag_StainOnPrune; + if (material != P_MaterialKind_Flesh) + { + //- Wall debris + { + V_Emitter emitter = Zi; + { + // emitter.flags |= V_ParticleFlag_PruneWhenStill; + // emitter.flags |= V_ParticleFlag_StainOnPrune; - // emitter.count = 4; + emitter.kind = V_ParticleKind_Debris; + emitter.count = 4; - // emitter.start = hit_entry; - // emitter.end = emitter.start; + emitter.pos.p0 = emitter.pos.p1 = hit_entry; - // emitter.color_lin = LinearFromSrgb(VEC4(0.4, 0.3, 0.2, 0.75)); - // emitter.color_spread = VEC4(0, 0, 0, 0.25); + emitter.speed.min = 0; + emitter.speed.max = 20; - // emitter.speed = 2; - // // emitter.speed_spread = emitter.speed * 2; - // emitter.speed_spread = emitter.speed * 2.5; + // emitter.velocity_falloff = 5; + // emitter.velocity_falloff_spread = emitter.velocity_falloff_spread * 1.5; - // emitter.velocity_falloff = 5; - // emitter.velocity_falloff_spread = emitter.velocity_falloff_spread * 1.5; + Vec2 dir = hit_entry_normal; - // Vec2 dir = hit_entry_normal; + f32 angle = AngleFromVec2(dir); + f32 angle_spread = Tau * 0.5; - // emitter.angle = AngleFromVec2(dir); - // emitter.angle_spread = Tau * 0.5; + emitter.angle.min = angle - angle_spread / 2; + emitter.angle.max = angle + angle_spread / 2; - // // emitter.lifetime = 0.25; - // // emitter.lifetime = 0.05; - // // emitter.lifetime = 0.04; - // emitter.lifetime_spread = emitter.lifetime * 2; - // } - // V_PushParticles(emitter); - // } + // emitter.lifetime = 0.25; + // emitter.lifetime = 0.05; + // emitter.lifetime = 0.04; + // emitter.lifetime_spread = emitter.lifetime * 2; + } + V_PushParticles(emitter); + } - // //- Wall dust - // { - // V_Emitter emitter = Zi; - // { - // // emitter.flags |= V_ParticleFlag_PruneWhenStill; + //- Wall dust + // { + // V_Emitter emitter = Zi; + // { + // emitter.kind = V_ParticleKind_Smoke; + // emitter.count = 128; - // emitter.count = 32; + // emitter.pos.p0 = emitter.pos.p1 = hit_entry; - // emitter.start = hit_entry; - // emitter.end = emitter.start; + // // emitter.color_lin = LinearFromSrgb(VEC4(0.5, 0.5, 0.5, 0.75)); - // emitter.color_lin = LinearFromSrgb(VEC4(0.5, 0.5, 0.5, 0.75)); + // emitter.speed.min = 10; + // emitter.speed.max = 20; - // emitter.speed = 4; - // // emitter.speed_spread = emitter.speed * 2; - // emitter.speed_spread = emitter.speed * 2; + // // emitter.velocity_falloff = 12; + // // emitter.velocity_falloff_spread = emitter.velocity_falloff_spread * 1.5; - // emitter.velocity_falloff = 12; - // emitter.velocity_falloff_spread = emitter.velocity_falloff_spread * 1.5; + // Vec2 dir = hit_entry_normal; + // f32 angle = AngleFromVec2(dir); + // f32 angle_spread = Tau * 0.1; - // Vec2 dir = hit_entry_normal; + // emitter.angle.min = angle - angle_spread / 2; + // emitter.angle.max = angle + angle_spread / 2; - // emitter.angle = AngleFromVec2(dir); - // emitter.angle_spread = Tau * 0.1; - - // emitter.lifetime = 1; - // // emitter.lifetime = 0.05; - // // emitter.lifetime = 0.04; - // emitter.lifetime_spread = emitter.lifetime * 2; - // } - // V_PushParticles(emitter); - // } - // } + // } + // V_PushParticles(emitter); + // } + } ////////////////////////////// //- Blood particles diff --git a/src/pp/pp_vis/pp_vis_gpu.g b/src/pp/pp_vis/pp_vis_gpu.g index c9e014fa..43785e44 100644 --- a/src/pp/pp_vis/pp_vis_gpu.g +++ b/src/pp/pp_vis/pp_vis_gpu.g @@ -20,12 +20,15 @@ Vec4 V_ColorFromParticle(V_ParticleDesc desc, u32 particle_idx, u32 density) // Apply density { - if (desc.layer == V_ParticleLayer_Air) + if (AnyBit(desc.flags, V_ParticleFlag_GasBlend)) { // f32 t = saturate(density / 10.0); - f32 t = smoothstep(-10, 32, density); + // f32 t = smoothstep(-10, 32, density); + f32 t = smoothstep(-10, 50, density); // f32 t = smoothstep(0, 2, (f32)density); - result.a = lerp(0, 0.85, t); + + + result.a += (1.0 - result.a) * (t); } else if (desc.kind == V_ParticleKind_BloodTrail || desc.kind == V_ParticleKind_BloodDebris) { diff --git a/src/pp/pp_vis/pp_vis_shared.cgh b/src/pp/pp_vis/pp_vis_shared.cgh index c355a522..9b0d7334 100644 --- a/src/pp/pp_vis/pp_vis_shared.cgh +++ b/src/pp/pp_vis/pp_vis_shared.cgh @@ -33,6 +33,7 @@ Enum(V_ParticleFlag) V_ParticleFlag_StainWhenPruned = (1 << 1), V_ParticleFlag_NoReflect = (1 << 2), V_ParticleFlag_OnlyCollideWithWalls = (1 << 3), + V_ParticleFlag_GasBlend = (1 << 4), }; Enum(V_ParticleLayer) @@ -78,25 +79,33 @@ Enum(V_ParticleLayer) /* Layer */ V_ParticleLayer_Mid, \ /* Stain rate, pen chance */ 0, 0, \ /* Lifetime */ Inf, \ + /* Base color */ 0.4, 0.3, 0.2, 1 \ + ) \ + X( \ + /* Name */ Fire, \ + /* Flags */ V_ParticleFlag_StainWhenPruned, \ + /* Layer */ V_ParticleLayer_Mid, \ + /* Stain rate, pen chance */ 0, 0, \ + /* Lifetime */ Inf, \ /* Base color */ 2, 0.5, 0, 1 \ ) \ \ /* Air particles */ \ - X( \ - /* Name */ Smoke, \ - /* Flags */ V_ParticleFlag_OnlyCollideWithWalls, \ - /* Layer */ V_ParticleLayer_Air, \ - /* Stain rate, pen chance */ 0, 0, \ - /* Lifetime */ Inf, \ - /* Base color */ 0.15, 0.15, 0.15, 0.5 \ - ) \ X( \ /* Name */ BulletTrail, \ - /* Flags */ V_ParticleFlag_OnlyCollideWithWalls, \ - /* Layer */ V_ParticleLayer_Air, \ + /* Flags */ V_ParticleFlag_OnlyCollideWithWalls | V_ParticleFlag_GasBlend, \ + /* Layer */ V_ParticleLayer_Mid, \ /* Stain rate, pen chance */ 0, 0, \ /* Lifetime */ 0.075, \ /* Base color */ 0.8, 0.6, 0.2, 0.25 \ + ) \ + X( \ + /* Name */ Smoke, \ + /* Flags */ V_ParticleFlag_OnlyCollideWithWalls | V_ParticleFlag_GasBlend, \ + /* Layer */ V_ParticleLayer_Air, \ + /* Stain rate, pen chance */ 0, 0, \ + /* Lifetime */ Inf, \ + /* Base color */ 0.25, 0.25, 0.25, 0.75 \ ) \ \ /* Test particles */ \