View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0004957||The Dark Mod||Feature proposal||public||12.01.2019 09:39||12.01.2019 20:52|
|Product Version||TDM 2.07|
|Target Version||TDM 2.08||Fixed in Version|
|Summary||0004957: Snow and rain particles stopping on brushes|
|Description||Original post by Goldwell:|
Currently rain and snow particles fail through everything on their way. It is possible to make them stop/hit at desired place, but it is tedious.
This issue is to investigate the possibility of better rain/snow system which would automatically stop its particles on hitting brushes (and maybe even models).
|Tags||No tags attached.|
I have no idea yet how particle system works in the code.
But I'm pretty sure that all particles are modeled completely on CPU. Then it should be straightforward to add collision detection under some new spawnarg.
One issue to keep in mind is performance.
Collision detection is not free, and doing it for every particle every frame may be costly (and may be not --- to be found). That's why there are ideas like 1) using only brushes for collision, and 2) computing hit location once or once per 10 frames.
|Theoretically, it should be possible to calculate particle lifetimes offline such that no collisions with brushes occur. I imagine something like a lookup table that maps particle spawn position to particle lifetime, which could be calculated during dmap.|
Yes, this is third optimization (even more serious one): precompute particle path depending on point in emitter area.
One graphical way to do that is to render all solid objects from above into one bitmap with depth info, then depth at each pixels says how long the particle will go.
Note that the generic solution with always checking collision produces less artefacts. It always works good, even in presence of moving objects. Every optimization applied adds artefacts in some case: rain goes through crates if only brushes are taken into account, or rain going through AI when they are moving, etc.
That's why I suggest starting with slow but correct solution, profile, and then apply optimization in order of increasing severity.
|Right, good idea. There is also the option to do an offline-online hybrid, use offline data only for distant particles and accurate online calculations for close ones.|
From what I remember of SteveL's posts on particles, 'smoke' particles in the 'world particle system' have their positions stored so that e.g. smoke trails don't follow their emitters around, but particles spawned by func_emitters don't have individual state (though the emitter does get a bounds check on map load).
I'm not sure where particles emitted from patches come into this (http://wiki.thedarkmod.com/index.php?title=World_Particle_System indicates they're another subsystem again), though visportalling has a known effect: http://forums.thedarkmod.com/topic/11314-keeping-your-house-dry/
|12.01.2019 09:39||stgatilov||New Issue|
|12.01.2019 09:42||stgatilov||Note Added: 0011325|
|12.01.2019 14:52||STiFU||Note Added: 0011327|
|12.01.2019 15:25||stgatilov||Note Added: 0011328|
|12.01.2019 16:26||STiFU||Note Added: 0011331|
|12.01.2019 20:52||VanishedOne||Note Added: 0011339|