Sprite / Particle generator design pattern

Hi @Elias

In my case I’m using the same Factory Pattern and my entity is a bit more complex,

I’m using a custom ShaderFx material in order to render some ripples on several non overlapping planes.

If I understand right your question, I think it’s not possible, the material is unique for each slice.

Maybe I need to rethink how the module works?

Any Ideas are welcome

Example

Tried to sketch something using pooling but still seeing resource leaks. Would need to profile Stride again but at this point I wonder if it would be better to checkout Stride and start investigating the issue at the core.

How many instance getting created/destroyed per second/minute are we talking about here?

I’m drawing simultaneusly 200 elements maximum, around 2 or 3 per second.

It depends also on the LifeTime of each one.

yes I think in my example the manager is already doing too much.

For the animation you’re making, I don’t see the point of using the pattern we were discussing. Since you could approach this with a spread of LFO or Stopwatch that would just be trigger to run when needed. No need to create/delete anything at runtime for an animation like this, to me it’s overkill.

Thank you @lecloneur , I was thinking the same.

In any case, I’ve learned some bits during the process.

or thinking about it, the spray help patch is actually close to what you need to do. Worth trying

@lecloneur totally, and actually this method is what I’m using in the original project, but then the RefCnt issue became more prominent and I decided to explore other ways, thinking that it would solve it.

Now I see that it’s a stride limitation.