- Home /
How can I draw persistent trails with particles?
I'm trying to make a particle effect, where I can use the particles as normal, but where they don't clear when travelling, effectively leaving a trail. (in a 2D game)
Right now I'm using a camera with a RenderTexture, rendering to a quad shown by the main camera. The first camera only clears depth. The effect is that the rendertexture records the particle trail. The problem with this is that it is pretty unreliable (the full trail of the particles often won't be recorded, only specific positions during the trail). It also feels like there must be a more efficient way of doing this.
Any pointers?
(The end goal is making a dynamic 2D paint splash - the particles all burst from one point, and by leaving a trail, they "paint". If you have any ideas as to how to do that with something else than particles, please let me know!)
Edit: What I've achieved with RenderTexture: The red one is pretty much how I want it (still needs tweaking on the paths and colors to hopefully look less like fireworks and more like paint), but if the framerate is low, it turns out frayed like the blue one instead. I'm targeting low-end machines and using WebGL, so the framerate will drop at times.
Did you consider a trail renderer?
You could have a camera that only catches the TrainRenderer and dumps the data it gets into some draw buffer in an additive fashion or whatever you're ai$$anonymous$$g for?
I did check out the TrailRenderer, but it's not really customizable enough for the effect I want. Plus, making it persistent seems to be kind of the same process I'm trying to go through for the particles.
I don't really know how I'd use a draw buffer! What would you use for that? A shader? I only know about RenderTexture for doing this kind of stuff.
Answer by Benjames · Sep 06, 2016 at 05:41 AM
Try changing from local space to world simulated space.
Then the particles won't fallow the object around or rotate with the object.
/EDIT/ Oops I believe I misinterpreted the question.
Just to clear things up maybe post a picture. You're asking how to leave a trail for each particle right? The same way it would look if you didn't clear the camera depth?
Posted a picture now. You got it right the second time :)
Your answer
Follow this Question
Related Questions
Smoke Trails in lines 1 Answer
Engine Trail Advice 1 Answer
Is there a way to draw particles on a raycast? 2 Answers
When and how to take a screenshot of a particle system from the editor? 0 Answers
trails and particles 2 Answers