Blender Game Engine: Particles in the Mix

I think I can show you better than I can tell you

check out the code

This is the first major milestone in my journey! I’ve got a lot of work to do before this is in any usable condition for artists, but none the less it feels good to see my OpenCL Particle System and interact with it through the Blender Game Engine. Right now I’ve linked to my EnjaParticles library from Blender, I create a system using a custom modifier (called Enja for now) on an object and if the modifier is present I divert rendering of that object to a custom function.

My next step is to get a better understanding of all the OpenGL magic going on because my colors and alpha blending are not behaving as expected. At the same time I’m thinking I’ll rewrite the particle system code inside the BGE and start looking at how the existing particle system works. I’m going to start with a small subset of the existing functionality, so please let me know if you’re dying to have a certain particle effect in the game engine so I can prioritize better, otherwise I’ll just do what looks the most fun.

I want to spend some more time thinking about handling the OpenCL context, perhaps loading it, building the programs and preparing the kernels when the game engine starts. Right now an entirely new context is created for each system which seems quite wasteful. I also need to clean up the build process, which should be helped by moving the code internal to blender, but making OpenCL available to the whole of blender might encourage other developers to try their hand at accelerating other areas.

8 thoughts on “Blender Game Engine: Particles in the Mix

  1. Gordon

    Consider that your advisor’s wishes have maximum priority.

    I am not sure that a modifier is the way to go. You will want new particles to be created as time goes on and old ones die. Read some articles on particle generators.

  2. Mal

    Looks cool – when moving the emitter, the previous particles should stay in place ( if you fire a gun and rotate the gun, the bullet won’t rotate with the gun ).

    You should also contact Erwin at or – if you use the right license, it can be used as part of GameKit ( an external open source Blender GE player, but with a license the same as Bullet – ie it can be used in Blender, but also commercially ).

  3. Blenderificus

    Great work so far. The modifier idea is intriguing. The OpenCl is AWESOME!!! Looks solid in its early state.

    You mentioned requests, so I’ll throw some out:

    •I would enjoy the ability to have the individual particles interact with (other objects in)the bullet physics engine in blender.

    •The ability to animate particles with other modifiers that are AFTER the particle modifier in the modifier hierarchy, like an animated array modifier & simple deform, would be cool too, but not sure if its feasible

    •The ability to “crossfade” between 2(or more) particle systems within the modifier. Something abstract like this could be VERY useful

  4. Rhys

    What is your end goal?
    -For high res particle simulations in an interactive environment/game engine?
    -Game engine particle system for ingame fx (explosions,fire etc)?

  5. enj Post author

    @rhys: the official goal is to be able to do scientific visualizations in an interactive environment. Improved performance for other aspects (my project will hopefully make it easier to integrate opencl Bullet for example) and particle effects like fire/smoke are benefits that should come along the way.

    @gustav: thanks for the heads up! I’ll be sure to check out Lukas’ work and get in contact with him so that energy isn’t wasted!

  6. Anurag vohra

    That was really amazing.
    Keep going. Thats because of pepole like you (and ofcourse Ton and all who contribute to Blender community) belnder gonna be the most powerful animation package.
    Real Hat ups to you freind

  7. Dominic


    I’m relatively new to blender, but I’m very impressed with what you’re doing here. Personally, I think the physics simulations (smoke, fluids, cloth, etc.) would benefit immensely from OpenCL acceleration. That combined with a GPU accelerated render engine like others are working on with the LuxRays project would revolutionize the speed of my work flow. Anyway, just wanted to say keep up the good work.


Comments are closed.