Home Qt Quick Particles 2.0 – Qt Labs

Qt Quick Particles 2.0 – Qt Labs

Below is an Article that was interesting about Qt Particles by Qt Labs:
Some people may remember the old Qt.labs.particles module. It was left in labs because we thought we could create a better particle system later, and didn’t want to tie ourselves into that first attempt (but of course, we had to have a particle system somewhere; it’s a modern essential!). With the graphical power of scenegraph, the shader fairies are now creating that better system. As it’s in the unreleased and unstable Qt5 though, it’s still only labs quality – but that doesn’t stop me from sharing it on labs :) . Check out the image of Plasma Patrol below to get a feel for some of its capabilities (and checkout qt5.git to see it in action).

pp-MeeGo-MeeGoExperts
The basics of the new particle system is that we’ve split out a bunch of the components for increased flexibility. The previous particle system just had “Particles”, but the new one splits up the elements into Emitters (items that emit logical particles into the system from their current position), Painters (which visualize the logical particles in some way) and Affectors (which can screw with the logical particles to do anything else). This means that you can anchor an emitter to the end of each rocket ship and use a single painter to render all the exhausts, and a single affector to add a bit of breeze to them all (this would be before they get into space). You can also use this to render particles with your own custom shaders (instead of using our supplied ones) with the stock emitters, or have the particles switch visualization on-the-fly (perhaps the occasional one wants to use a full QML delegate instead of just an image). This is especially helpful considering all the stochastic parameter variation that the particle system can do, as many of the properties can have a defined variation in aggregate over the vast number of particles being emitted. There are some nice combinations in there too, like the stochastic sprite particles that allow you to not only specify that each particle is rendered as an animation, but they can also randomly (or on command) switch to other animations along predefined paths.
With all these functions, it should be easy to imagine how some cool effects can be done: a ship flying through an asteroid field and breaking those it hits, a flame setting all balls that pass through it aflame (which then light up other balls), fireworks that explode with different colors, an image that forms out of thousands of particles fading in with their own timeline, a candle swaying in the breeze… Perhaps it’s not so easy to imagine how you’d do all this with the new particle system, but for that case we have examples that show you how. All you need is to build Qt5 and try it out (building Qt5 is still a bit of a shifting target though, especially on windows, so please ask any questions about that on our IRC channel, not in the comments ).
I’ve been augmenting the QML games with it already. The samegame particles are now ten times better (and approximately more numerous). It also used in a new space invaders game, in qt-qml-demo-playground on gitorious, where the particles add a bit of flair to the projectiles swarming the screen.
si-MeeGo-MeeGoExperts
So there you have it, new particle system coming in QtQuick 2 (and since it’s heavily scenegraph based, it will not be backported to QtQuick 1). If you’re using Qt5 already, then you can start using it now to add some aesthetic punch to your applications. There’s a host of examples in examples/declarative/particles, plus the aforementioned games, to both get you started and show off what the system is capable of already. As it’s still in an early stage of development, I welcome feedback from any such brave souls who give it a try. Hopefully, QtQuick 2 can come with a great particle system available for all.
Source Qt Labs

About ReadWrite’s Editorial Process

The ReadWrite Editorial policy involves closely monitoring the tech industry for major developments, new product launches, AI breakthroughs, video game releases and other newsworthy events. Editors assign relevant stories to staff writers or freelance contributors with expertise in each particular topic area. Before publication, articles go through a rigorous round of editing for accuracy, clarity, and to ensure adherence to ReadWrite's style guidelines.

Get the biggest tech headlines of the day delivered to your inbox

    By signing up, you agree to our Terms and Privacy Policy. Unsubscribe anytime.

    Tech News

    Explore the latest in tech with our Tech News. We cut through the noise for concise, relevant updates, keeping you informed about the rapidly evolving tech landscape with curated content that separates signal from noise.

    In-Depth Tech Stories

    Explore tech impact in In-Depth Stories. Narrative data journalism offers comprehensive analyses, revealing stories behind data. Understand industry trends for a deeper perspective on tech's intricate relationships with society.

    Expert Reviews

    Empower decisions with Expert Reviews, merging industry expertise and insightful analysis. Delve into tech intricacies, get the best deals, and stay ahead with our trustworthy guide to navigating the ever-changing tech market.