Suspiciously high particle count in DX11.Particles Layer Emitter

When opening the Emitter (DX11.Particles.Emitter Layer) help patch the particle count with the default 200 x 200 resolution is at 347200.

Shouldn’t it be 200 * 200 = 40,000 instead?

I was also wondering if only filled parts of the layer contribute to the particle number or the particles that are calculated. Does a larger empty/unfilled area result in less active particles thus better performance compared to a completely filled layer?

@tmp what do you think?

Thanks a lot!

might be that its per frame ?

cannot confirm. see screenshot

It seems to happen if there is another layer emitter node opened anywhere in vvvv. It doesn’t need to be connected to the same ParticleSystem node for that to happen.

I also had problems with particles systems while renaming the instances, Have you tried to fix the names, then reopen the project? (without touching the names afterwards).

It appears, any emitter will add to the default particle system no matter if connected to this particle system with a wire or not. They can be separated by adding a different particle system node and change its “ParticleSystem Name” pin as well as the “ParticleSystem” pin of the emitter to a different name.

The particle amounts are correct now.

@io sounds kind of similar to what you were saying, now that I’m reading your post again.

Well, that’s the way it works, the particle system name is the name space where particles and behaviours are attached to (so to say, no need to create a vvvv connection, the name space is the connection in memory). As things are now, when changing names and reorganizing your systems, just remember to close everything and reopen.

Thanks for the clarification @io. I will do that.

I would like to get back to the second question of my initial post:

I now know all particles will be in the buffer no matter if visible or not. But i was wondering if it was possible to filter the buffer for the visible particles only? What selector would I have to choose for example?

Particles work as an append buffer, thay are filtered under the hood, however buffer count = element count even tho slices are discarded.
You can get real count with a copycounter node, hower to do that you must read back from gpu wich is slow expensive call

Thanks @antokhio. I want to read back to CPU and work with all non-discarded particles only.

I tried to use copycounter but don’t understand how to use it. Anyway it sounds like that would give the the only the count whereas I would like actually like to filter the particles.

Do you have another idea?

Thank you!

What do you want to do?

There is a buffer called AliveIndexBuffer that holds all ids to particles that are alive in the current frame. In addition the first value in AliveCounterBuffer gives you the number of alive particles. You need this value to adress the AliveIndexBuffer: AliveIndexBuffer[0] to AliveIndexBuffer[n] where n = AliveCounterBuffer[0] gives you all pointers to living particles in the particlebuffer.

There is no need to do expensive readbacks. You can access these buffers everywhere with computeshaders. Have a look at existing nodes. There is a difference between the adressing before and after rendering the buffers in the particlesystem node. have a look at modifiers (=before) or AsAttributeBuffer (=after).

Thanks, @tmp. That’s really helpful!

I’m still working on this:

Since I don’t know how to do the sorting on the GPU, I like to give it a try on the CPU.

I’ve tried in this patch with a C# plugin which is called “SortParticles”: layer emitter (46.4 KB)

Unfortunately, it seems like I’m not accessing the alive particles in the right way.

I’m kind of getting what I’m after when simply using all particles (commented out in the code):

Can you provide picture of exactly what you are after? I think you can get it with much easier effort…

If I understood you correctly, you wanted to do something like this: (14.3 KB)

@tmp Yes, that’s it. That’s awesome. Thank you sooo much! It looks like a nice playground for further visual experimentation.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.