newEmitter

Hi,

I’ve found something which I cannot explain.

With a blank main.lua file and this code, my high end PC, both in simulator and after building a desktop app, jumps from 0 to around 15% CPU use. It doen’t matter if the emitter is started or stopped. It is enough that one has been created for this to happen. 

If the same happens on mobile devices, I would be very concerned to use particle effects at all.

Anyone know what this is?

Thanks in advance!

Anaqim

local emitterParams = {

    startColorAlpha = 1,

    startParticleSizeVariance = 53.47,

    startColorGreen = 0.3031555,

    yCoordFlipped = -1,

    blendFuncSource = 770,

    rotatePerSecondVariance = 153.95,

    particleLifespan = 0.7237,

    tangentialAcceleration = -144.74,

    finishColorBlue = 0.3699196,

    finishColorGreen = 0.5443883,

    blendFuncDestination = 1,

    startParticleSize = 50.95,

    startColorRed = 0.8373094,

    textureFileName = “x.png”,

    startColorVarianceAlpha = 1,

    maxParticles = 256,

    finishParticleSize = 64,

    duration = -1,

    finishColorRed = 1,

    maxRadiusVariance = 72.63,

    finishParticleSizeVariance = 64,

    gravityy = -671.05,

    speedVariance = 90.79,

    tangentialAccelVariance = -92.11,

    angleVariance = -142.62,

    angle = -244.11

}

local emitter=display.newEmitter(emitterParams)

emitter.x=500

emitter.y=500

I am using dozen of particle emitters in my game.
No problem at all until you do not cross approx. 300 particles (not emitters) in current screen view (but it varies).

I am cleaning emitters regulary (before game end).

Hi Ivan,

Thanks for your input.

It is good to get some info about real world performance.

We’re still tuning our Radiance product and this was one thing we noticed which we couldn’t explain.

We are under the impression that as soon as an emitter is created, the particle engine boots up, and further emitters doesn’t add much to the load, only particle sprite sizes seem to matter, which perhaps translates to draw calls and graphics engine load.

Anaqim

I can’t reproduce this issue on Windows 10 using a recent Daily Build of CoronaSDK.

What version of Windows and which version of CoronaSDK are you using?

Hi Perry,

I’m running Windows 10 Home and Corona SDK 2017.3042, but you got me thinking so I had to check first and found the culprit.

I work a lot with my brother using teamviewer, and behold, when teamviewer is active (presentation mode), the CPU spike happens.

I do not fully get why it would behave this way when no emitter is running, even if teamviewer would use openGL, but at least it has nothing to do with the particle engine in Corona SDK, and that’s what matters.

Thanks mate!

Anaqim

As always, test and retest regularly on device as there can be a real differences in open GL speed - particularly on Android devices.

I’ve seen a couple of simple emitters drop 5 fps on older devices but a recent device can run hundreds no sweat.

I am using dozen of particle emitters in my game.
No problem at all until you do not cross approx. 300 particles (not emitters) in current screen view (but it varies).

I am cleaning emitters regulary (before game end).

Hi Ivan,

Thanks for your input.

It is good to get some info about real world performance.

We’re still tuning our Radiance product and this was one thing we noticed which we couldn’t explain.

We are under the impression that as soon as an emitter is created, the particle engine boots up, and further emitters doesn’t add much to the load, only particle sprite sizes seem to matter, which perhaps translates to draw calls and graphics engine load.

Anaqim

I can’t reproduce this issue on Windows 10 using a recent Daily Build of CoronaSDK.

What version of Windows and which version of CoronaSDK are you using?

Hi Perry,

I’m running Windows 10 Home and Corona SDK 2017.3042, but you got me thinking so I had to check first and found the culprit.

I work a lot with my brother using teamviewer, and behold, when teamviewer is active (presentation mode), the CPU spike happens.

I do not fully get why it would behave this way when no emitter is running, even if teamviewer would use openGL, but at least it has nothing to do with the particle engine in Corona SDK, and that’s what matters.

Thanks mate!

Anaqim

As always, test and retest regularly on device as there can be a real differences in open GL speed - particularly on Android devices.

I’ve seen a couple of simple emitters drop 5 fps on older devices but a recent device can run hundreds no sweat.