Last active
June 27, 2017 10:27
-
-
Save ChALkeR/bb8937e8ffaf31e496a31e988f93e628 to your computer and use it in GitHub Desktop.
QtQuick.Particles GPU usage issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.0 | |
import QtQuick.Particles 2.0 | |
Item { | |
width: 1500 | |
height: 800 | |
Rectangle { | |
color: 'black' | |
anchors.fill: parent | |
} | |
ParticleSystem { | |
id: system | |
anchors.fill: parent | |
Emitter { | |
id: emitter | |
enabled: false | |
emitRate: 1 | |
lifeSpan: 2000 | |
size: 24 | |
sizeVariation: 16 | |
velocity: AngleDirection {angleVariation: 180; magnitude: 150; magnitudeVariation: 260} | |
acceleration: AngleDirection {angleVariation: 180; magnitude: 0; magnitudeVariation: 60} | |
} | |
function boom(count) { | |
visible = true; | |
emitter.enabled = true; | |
emitter.burst(count); | |
emitter.enabled = false; | |
} | |
// GPU is being eaten like crazy even if this line is commented out | |
Component.onCompleted: boom(100) | |
ItemParticle { | |
delegate: Rectangle { | |
color: 'red' | |
width: 4 | |
height: 4 | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment