This project is read-only.

Particle snapping?

Jul 9, 2010 at 11:01 AM
Edited Jul 9, 2010 at 11:02 AM
I've been working with adding particles to my game and they work fine for most things, but the trail starts "snapping" after a while. If you compare the following pictures:
Good trail:
Bad trail:
You will notice on the second picture that the particles tend to snap, that there is a gap between the positions in the x-axis, that snapping isnt there in the first screenshot. I assumed that it was due to the precision being lowered, but after discussing this with a collegue we came to the conclusion that that shouldnt be the reason.
Does anyone have any idea what could be causing this snapping?
Thanks in advance for the help!
Jul 10, 2010 at 2:34 AM

This will be due to reduced precision. When running on the Xbox, and SM3 capable PCs, particle systems default to processing on the GPU.

The disadvantage is that (for various reasons) the particle storage must be FP16. So there is a lot of precision lost. As you get far from the origin, you will notice very obvious snapping.

If you don't care about the Xbox, you can force the systems to run on the CPU (The particle system class has a static flag to force this). This will fix up the precision issues.

If this isn't a workable solution:

If the particles are moving, then this will be especially obvious.
There is a built in method to improve accuracy for moving particles (gpu position buffering, which is shown in the advanced particle tut) but I don't imagine that'll be very useful in your case.

What I'd suggest, is keep the particle system centrered in the middle of the screen - and pass in a position delta each frame (using global values) and offset each particle using these values.
This will keep the precision around the centre of the screen - but I understand it's not an ideal solution.

I have an idea how I can improve matters, but it'll quite some fairly big changes behind the scenes so I'm afraid it likely won't make your deadline.

:-/ sorry

Jul 10, 2010 at 12:51 PM

Right now, I don't care about getting the game working on the Xbox, I'll try forcing the system to use the CPU, thanks for the help!

Jul 12, 2010 at 9:11 PM
Edited Jul 12, 2010 at 9:11 PM
Just mention: The next alpha of 2.0 will have quite significantly improved GPU position buffering option (which helps to hide FP16 issues). Not especially easy to port back, unfortunately.