wall debris testing
This commit is contained in:
parent
53bcacb044
commit
2609dda88a
@ -2263,77 +2263,71 @@ void V_TickForever(WaveLaneCtx *lane)
|
|||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
//- Wall particles
|
//- Wall particles
|
||||||
|
|
||||||
// if (material != P_MaterialKind_Flesh)
|
if (material != P_MaterialKind_Flesh)
|
||||||
// {
|
{
|
||||||
// //- Wall debris
|
//- Wall debris
|
||||||
// {
|
{
|
||||||
// V_Emitter emitter = Zi;
|
V_Emitter emitter = Zi;
|
||||||
// {
|
{
|
||||||
// // emitter.flags |= V_ParticleFlag_PruneWhenStill;
|
// emitter.flags |= V_ParticleFlag_PruneWhenStill;
|
||||||
// // emitter.flags |= V_ParticleFlag_StainOnPrune;
|
// emitter.flags |= V_ParticleFlag_StainOnPrune;
|
||||||
|
|
||||||
|
|
||||||
// emitter.count = 4;
|
emitter.kind = V_ParticleKind_Debris;
|
||||||
|
emitter.count = 4;
|
||||||
|
|
||||||
// emitter.start = hit_entry;
|
emitter.pos.p0 = emitter.pos.p1 = hit_entry;
|
||||||
// emitter.end = emitter.start;
|
|
||||||
|
|
||||||
// emitter.color_lin = LinearFromSrgb(VEC4(0.4, 0.3, 0.2, 0.75));
|
emitter.speed.min = 0;
|
||||||
// emitter.color_spread = VEC4(0, 0, 0, 0.25);
|
emitter.speed.max = 20;
|
||||||
|
|
||||||
// emitter.speed = 2;
|
// emitter.velocity_falloff = 5;
|
||||||
// // emitter.speed_spread = emitter.speed * 2;
|
// emitter.velocity_falloff_spread = emitter.velocity_falloff_spread * 1.5;
|
||||||
// emitter.speed_spread = emitter.speed * 2.5;
|
|
||||||
|
|
||||||
// emitter.velocity_falloff = 5;
|
Vec2 dir = hit_entry_normal;
|
||||||
// emitter.velocity_falloff_spread = emitter.velocity_falloff_spread * 1.5;
|
|
||||||
|
|
||||||
// Vec2 dir = hit_entry_normal;
|
f32 angle = AngleFromVec2(dir);
|
||||||
|
f32 angle_spread = Tau * 0.5;
|
||||||
|
|
||||||
// emitter.angle = AngleFromVec2(dir);
|
emitter.angle.min = angle - angle_spread / 2;
|
||||||
// emitter.angle_spread = Tau * 0.5;
|
emitter.angle.max = angle + angle_spread / 2;
|
||||||
|
|
||||||
// // emitter.lifetime = 0.25;
|
// emitter.lifetime = 0.25;
|
||||||
// // emitter.lifetime = 0.05;
|
// emitter.lifetime = 0.05;
|
||||||
// // emitter.lifetime = 0.04;
|
// emitter.lifetime = 0.04;
|
||||||
// emitter.lifetime_spread = emitter.lifetime * 2;
|
// emitter.lifetime_spread = emitter.lifetime * 2;
|
||||||
// }
|
}
|
||||||
// V_PushParticles(emitter);
|
V_PushParticles(emitter);
|
||||||
// }
|
}
|
||||||
|
|
||||||
// //- Wall dust
|
//- Wall dust
|
||||||
// {
|
// {
|
||||||
// V_Emitter emitter = Zi;
|
// V_Emitter emitter = Zi;
|
||||||
// {
|
// {
|
||||||
// // emitter.flags |= V_ParticleFlag_PruneWhenStill;
|
// emitter.kind = V_ParticleKind_Smoke;
|
||||||
|
// emitter.count = 128;
|
||||||
|
|
||||||
// emitter.count = 32;
|
// emitter.pos.p0 = emitter.pos.p1 = hit_entry;
|
||||||
|
|
||||||
// emitter.start = hit_entry;
|
// // emitter.color_lin = LinearFromSrgb(VEC4(0.5, 0.5, 0.5, 0.75));
|
||||||
// emitter.end = emitter.start;
|
|
||||||
|
|
||||||
// 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.velocity_falloff = 12;
|
||||||
// // emitter.speed_spread = emitter.speed * 2;
|
// // emitter.velocity_falloff_spread = emitter.velocity_falloff_spread * 1.5;
|
||||||
// emitter.speed_spread = emitter.speed * 2;
|
|
||||||
|
|
||||||
// emitter.velocity_falloff = 12;
|
// Vec2 dir = hit_entry_normal;
|
||||||
// emitter.velocity_falloff_spread = emitter.velocity_falloff_spread * 1.5;
|
// 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;
|
// V_PushParticles(emitter);
|
||||||
|
// }
|
||||||
// emitter.lifetime = 1;
|
}
|
||||||
// // emitter.lifetime = 0.05;
|
|
||||||
// // emitter.lifetime = 0.04;
|
|
||||||
// emitter.lifetime_spread = emitter.lifetime * 2;
|
|
||||||
// }
|
|
||||||
// V_PushParticles(emitter);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
//- Blood particles
|
//- Blood particles
|
||||||
|
|||||||
@ -20,12 +20,15 @@ Vec4 V_ColorFromParticle(V_ParticleDesc desc, u32 particle_idx, u32 density)
|
|||||||
|
|
||||||
// Apply density
|
// Apply density
|
||||||
{
|
{
|
||||||
if (desc.layer == V_ParticleLayer_Air)
|
if (AnyBit(desc.flags, V_ParticleFlag_GasBlend))
|
||||||
{
|
{
|
||||||
// f32 t = saturate(density / 10.0);
|
// 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);
|
// 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)
|
else if (desc.kind == V_ParticleKind_BloodTrail || desc.kind == V_ParticleKind_BloodDebris)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -33,6 +33,7 @@ Enum(V_ParticleFlag)
|
|||||||
V_ParticleFlag_StainWhenPruned = (1 << 1),
|
V_ParticleFlag_StainWhenPruned = (1 << 1),
|
||||||
V_ParticleFlag_NoReflect = (1 << 2),
|
V_ParticleFlag_NoReflect = (1 << 2),
|
||||||
V_ParticleFlag_OnlyCollideWithWalls = (1 << 3),
|
V_ParticleFlag_OnlyCollideWithWalls = (1 << 3),
|
||||||
|
V_ParticleFlag_GasBlend = (1 << 4),
|
||||||
};
|
};
|
||||||
|
|
||||||
Enum(V_ParticleLayer)
|
Enum(V_ParticleLayer)
|
||||||
@ -78,25 +79,33 @@ Enum(V_ParticleLayer)
|
|||||||
/* Layer */ V_ParticleLayer_Mid, \
|
/* Layer */ V_ParticleLayer_Mid, \
|
||||||
/* Stain rate, pen chance */ 0, 0, \
|
/* Stain rate, pen chance */ 0, 0, \
|
||||||
/* Lifetime */ Inf, \
|
/* 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 \
|
/* Base color */ 2, 0.5, 0, 1 \
|
||||||
) \
|
) \
|
||||||
\
|
\
|
||||||
/* Air particles */ \
|
/* 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( \
|
X( \
|
||||||
/* Name */ BulletTrail, \
|
/* Name */ BulletTrail, \
|
||||||
/* Flags */ V_ParticleFlag_OnlyCollideWithWalls, \
|
/* Flags */ V_ParticleFlag_OnlyCollideWithWalls | V_ParticleFlag_GasBlend, \
|
||||||
/* Layer */ V_ParticleLayer_Air, \
|
/* Layer */ V_ParticleLayer_Mid, \
|
||||||
/* Stain rate, pen chance */ 0, 0, \
|
/* Stain rate, pen chance */ 0, 0, \
|
||||||
/* Lifetime */ 0.075, \
|
/* Lifetime */ 0.075, \
|
||||||
/* Base color */ 0.8, 0.6, 0.2, 0.25 \
|
/* 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 */ \
|
/* Test particles */ \
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user