Xna particle system not updating position

The bonus section will combine the particle systems with the terrain rendering, but until then, we have no need of any of the previous code.

If you start with a new project, please add a camera component, and create two folders, The technique will use two render targets, of the same size.

When the particle’s life passes a certain value, it dies, and can be reborn again.

The updating of the position and velocity textures is done by using some pixel shaders, similar to how morphing was done in the previous chapter.

Creation of particles is still done by CPU-calls such as: //### As you can see, not a lot of action here.

### Particle Vertex []tmp Vertices = Particle Quad. Time Alive); particle Vertices[i] = tmp Vertices[0]; particle Vertices[i 1] = tmp Vertices[1]; particle Vertices[i 2] = tmp Vertices[2]; particle Vertices[i 3] = tmp Vertices[3]; particle Vertices[i 4] = tmp Vertices[4]; particle Vertices[i 5] = tmp Vertices[5]; particle Vertex Buffer.

Set Data(particle Vertices); My thoughts are that maybe I shouldn't create particles that often, maybe there is a way to let the GPU create everything, or maybe I just don't know how you do these stuff.

;) Edit: If I weren't to create particles that often, what is the workaround for still making it look good?

xna particle system not updating position-9xna particle system not updating position-5xna particle system not updating position-52

The particles are rendered on in the world where the emitter is initialized.

So I am posting here in hope that you know how a good particle-engine should be designed and if maybe I took the wrong route somewhere.

There is no way to have the GPU create everything (short of using Geometry Shaders which requires SM4.0).

My GPU easily handles 10k particles without breaking a sweat and I wouldn't be surprised if I could add a bunch more.

My problem: Whenever I have a lot of particles created at the same time, my frame rate hates me. A lot of CPU-usage, even though I have minimized it to contain almost only memory operations.

687

Leave a Reply

  1. psychology of dating down 16-Mar-2020 21:15

    even though I only know that the game is going to be sorely disappointing on that front. Now, I think its pretty obvious that Gym Leaders should be on that list.