Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 Support (Qt 5) › framerate drop when using particles

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #11295

    Bas

    hi,

     

    i noticed that when using particles i got a framedrop of 20 from 60 to 40

    what could cause this?

     

        ParticleSystem {
            id: sys
        }
    
        ImageParticle {
            system: sys
            source: "../../assets/pong/particles/bubble.png"
            color: "white"
            colorVariation: 0.3
            alpha: 0.1
            entryEffect: ImageParticle.None
            z:100
        }
        Emitter {
            id: emitter
            system: sys
            sizeVariation:0.5
            velocity: PointDirection {xVariation:20;  y: -40; yVariation: -24}
            lifeSpan: emitAmount
            emitRate: 20
            enabled: false
            size: 32
            endSize:0
            x:bal.x
            y:bal.y
            z:100
        }
    
        Timer {
            id:tid
            running:true
            repeat:true
            onTriggered: {
                emitAmount+=10
            }
            interval:1030
        }
    

     

    #11323

    Günther
    Felgo Team

    Hi Bas!

    Particle effects are performance intensive in general. How big the impact actually is mostly depends on the device hardware and the complexity of the particles.
    You can have a look at which properties affect the performance the most in the ParticleVPlay documentation. This component should also allow you to reduce the amount of code, as you only need this one component instead of the System, Emitter and ImageParticle.

    We also noticed that performance can get better once a particle effect is loaded or used several times. I guess this is due to some internal performance improvements of the Qt particle system at runtime. Maybe gradually changing a particle property, like the lifeSpan in your example, can also limit the capabilities of these improvements.

    I suggest you play around with the particle complexity until you reach a good balance between performance and looks.

    Best,
    Günther

    #11324

    Bas

    hi Günther,

    The app is running on a desktop machine i7 (old one) and gfx card AMD Radeon R9 200 / HD 7900 Series windows 8.1

    so the hardware is not the issue, i guess 🙂

    I will play with the parameters and come back if i found something.

    #11337

    Bas

    i forget to tell that i use the particles in a desktop app 1920×1080 dims.

    #11362

    Bas

    i get good

    
        Item {
            id: fakeEmitter
            function burst(number) {
                while (number > 0) {
                    var item = fakeParticle.createObject(pScene);
                    item.duration = 500 + Math.random() * 1000;
                    item.lifeSpan = 100 + Math.random() * 1000;
                    item.x = ball.x + Math.random() * 40 - 80;
                    item.y = ball.y + Math.random() * 40 - 80;
                    item.z = Math.round( Math.random() * 200 );
                    item.width = item.height = 8 + Math.round(Math.random()*24)
                    item.yAnim.start();
                    number--;
                }
            }
        }
    
        Component {
            id: fakeParticle
            Image {
                id: container
                property int duration:20
                property int lifeSpan: 10000
                property alias yAnim:yAnim
                width: 32
                height: 32
                source: Qt.resolvedUrl("../../assets/pong/bubble.png")
                PropertyAnimation {id:yAnim; target:container; property:"y"; from:container.y; to: -64; duration: container.duration; running: false;
                    easing.type: Easing.InCirc;
                    onStopped: container.destroy();
                }
                SequentialAnimation on opacity {
                    running: yAnim.running
                    NumberAnimation { from:0; to: 1; duration: 200}
                    PauseAnimation { duration: Math.round(container.duration*0.6) }
                    NumberAnimation { from:1; to: 0; duration: 500}
                    ScriptAction { script: container.destroy(); }
                }
            }
        }
    

     

    results with 1920 x 1080 when using a fake particle emitter

     

    #11563

    Günther
    Felgo Team

    Hi Bas,
    I guess the high resolution of 1920×1080 could also be a factor that affects particle performance.
    If the complexity of the effect created by your own fake emitter is good enough and the performance is indeed better, this seems to be a good workaround.

    Thanks for sharing that solution!

    Best,
    Günther

Viewing 6 posts - 1 through 6 (of 6 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded