SFML community forums

General => SFML projects => Topic started by: Frifron on December 21, 2008, 03:14:03 am

Title: SPARK opensource particle engine with an SFML module
Post by: Frifron on December 21, 2008, 03:14:03 am
Hello,

let me introduce to you my particle engine library. This is not really an SFML project but more a libray dependent free project written in C++. However I have just implemented a module for SFML (there is also a module for openGL and one for direct3D is coming) :

DESCRIPTION

SPARK is an opensource particle engine on CPU side written in C++. It was designed to be portable, configurable, evolving, and simple to use. Domains of applications of the library are mainly the rendering of 2D and 3D effect based on particles but it can also be used for slight simulation of numerous physical entities.

FEATURES

[/list]

This version contains a set of emitters, modifiers, zones and renderers that will increase in the future :

[/list][/list]

DOC AND TUTOS

SPARK documentation is available online here (http://spark.developpez.com/doc). You can also dowload it.

There is no real tutorials but a bunch of examples applications well commentated. There is a demo dedicated to SFML.

RESOURCE 1.01.01

THE SFML MODULE

I will speak a bit more of the SFML module as this is the SFML forum. It allows to easily implement particle systems with the SFML 2D engine. A class SFMLSystem extends sf::Drawable and a lot of SFML renderers exist to render particles in different ways.

(http://spark.developpez.com/img/SPK_SFML.jpg)

An implementation example is furnished (SFML Demo). It illustrates how to implement a particle system in SFML with SPARK. It is some fires on a tile map. The user can add/remove fires on tile and move/zoom on the map.

commands are : The licence of SPARK is the lgpl so it is very permissive.
For more info (in french unfortunately) and screenshots see here (http://www.developpez.net/forums/d635089/technologies-divers/developpement-2d-3d-jeux/projets/spark-moteur-particules-open-source/).

Any comments, suggestions, questions are welcome
Title: SPARK opensource particle engine with an SFML module
Post by: Imbue on December 21, 2008, 04:06:16 am
Very nice. :D

I think I'll be using this in my game. Thanks.
Title: SPARK opensource particle engine with an SFML module
Post by: bullno1 on December 21, 2008, 04:48:08 am
This is cool.
I just realized that the particles are actually 3D. This can help to add a fake "depth" feeling to my 2D game.

How to change the rendering mode in you demos? Immediate mode is performing poorly for a large number of particle

Edit: You have a particle pool, nice. Some SFML particle examples I found just new and delete everywhere. They fragment memory like crazy
Title: SPARK opensource particle engine with an SFML module
Post by: Frifron on December 22, 2008, 07:33:58 pm
Hello,

Quote from: "bullno1"

I just realized that the particles are actually 3D. This can help to add a fake "depth" feeling to my 2D game.


yes particles are 3D in the engine (but can also be 2D by letting the z coordinate to 0). The way they are converted into 2D for a 2D display is :
from position3D(x,y,z) we get position2D(x,y - zFactor * z)
The zFactor can be set in the SFMLRenderer. This gives an altitude to a particle which influence its y coordinate function of the factor. The z position is also useful for sorting (see setCameraPosition)

Quote from: "bullno1"

How to change the rendering mode in you demos? Immediate mode is performing poorly for a large number of particle


The rendering mode can be changed in the openGL demos by pressing F3. For SFML only immediate mode is available at the moment. However immediate mode operates quite well with particles as there is no need for some additionnal buffers to organize data (store the quad vertex function of the orientation, the texture coordinates function of the angle...). So the gain in performance may vary whether the bottleneck is the processor or the transfer to GPU.
Title: SPARK opensource particle engine with an SFML module
Post by: Frifron on January 05, 2009, 11:57:39 pm
Hi, a website for the library is opened in both english and french :
http://spark.developpez.com/
Title: SPARK opensource particle engine with an SFML module
Post by: Frifron on January 21, 2009, 08:04:14 pm
Hello, a new release :

CHANGE LOG 1.02.00



DEMOS

Regarding the demos :


A new demo is available, it shows the behaviour of SPARK with a large amount of particles. It represents some golden flakes in a sphere. The user can rotate the sphere, the gravity will always point towards the bottom of the screen. Space allows to eject particles in random direction.  + and - change the number of particles (50000 by default and up to 500000 (you'd better have a good proc))

More info and dowload here (http://spark.developpez.com/)

Any comment, suggestion is welcome.
Title: SPARK opensource particle engine with an SFML module
Post by: Frifron on January 23, 2009, 10:36:19 pm
the SFML module is now updated to SFML 1.4. The main modifications are that internal pointers to const RenderWindow are changed into RenderTarget.

The version 1.02.01 also fixes some bugs and optimizes some stuff.
Title: SPARK opensource particle engine with an SFML module
Post by: Astrof on January 30, 2009, 05:05:06 am
I'm having trouble linking the SPARK libs to visual studio (I'm probably just stupid).  

When I compile I get:
Code: [Select]

Error 2 error LNK2001: unresolved external symbol "public: __thiscall SPK::Point::Point(class SPK::Vector3D const &)" (??0Point@SPK@@QAE@ABVVector3D@1@@Z) main.obj SFML Game
Error 3 error LNK2001: unresolved external symbol "public: __thiscall SPK::Vector3D::Vector3D(float,float,float)" (??0Vector3D@SPK@@QAE@MMM@Z) main.obj SFML Game
Error 4 error LNK2001: unresolved external symbol "public: __thiscall SPK::Model::~Model(void)" (??1Model@SPK@@QAE@XZ) main.obj SFML Game
Error 5 error LNK2001: unresolved external symbol "public: __thiscall SPK::Model::Model(int,int,int)" (??0Model@SPK@@QAE@HHH@Z) main.obj SFML Game

I thought I could remedy this by including the SPARK.lib and SPARK_SFML.lib in additional dependencies, but that also broke it.  

btw I'm trying to use the static libs.  

Also I'm sorry if I shouldn't have posted in this particular thread, but I didnt know where else to ask for SPARK help.

EDIT: worked with new release of libs, idk why it didnt work before, but ah well.
Title: SPARK opensource particle engine with an SFML module
Post by: Frifron on January 30, 2009, 08:53:31 am
hi, you have added SPARK.lib and SPARK_SFML.lib (the static versions) to the additionnal dependencies of the project but where did you put the libraries ?

Have you either added the path to the VC++ library files or to the additional libraries directories of your project ?

By the way the libraries are compiled with visual 2008 so if your using another version of visual there might be compatibility issues (not sure about that).

Anyway if so, you can either recompile the libs for visual 2005 or wait 1 or 2 days for the next release that will add compiled libraries for visual 2005.
Title: SPARK opensource particle engine with an SFML module
Post by: Astrof on January 30, 2009, 08:46:56 pm
I'm using visual studio 2008 and have included the SPARK include/lib directories in the VC++ Directory place.
Title: SPARK opensource particle engine with an SFML module
Post by: Frifron on January 31, 2009, 12:47:48 am
Another minor release (1.02.02) that fixes some bugs (for a compil mingw and for linux. Thx to Baton) and includes now the solutions and librairies for vc2005, vc2008 and codeblocks.
Title: SPARK opensource particle engine with an SFML module
Post by: Frifron on June 17, 2009, 05:29:42 pm
Hi, after a while without update (I lack some time and i was on other stuff) , here is an update with some new things :

Release 1.03.00



I also put online a tutorial to get started on the site.

Now i m gonna concentrate on the shaders integration (vertex ans geometry) to put a bit of the load on the GPU. The use of shaders will be optionnal to keep the compatibility with old configurations. I will also look at a way to load particle systems from an XML definition file.


The website : spark.developpez.com (http://spark.developpez.com)
Title: SPARK opensource particle engine with an SFML module
Post by: dunce on June 18, 2009, 08:22:06 am
There are much faster (up to 50 times) and less memory consuming xml parsers PugiXml and RapidXml. I used tynyxml++ but eventually moved to pugixml. As for RapidXml, it does not even need building, being just a few headers.
Title: SPARK opensource particle engine with an SFML module
Post by: Frifron on June 18, 2009, 04:10:59 pm
Thanks guys.

I used tinyXML before. It is very simple to implement and use but not really optimized. So it's better for small config XML rather than big definition XML.

I still dont know which parser im gonna use but i want it to be quite easy to implement, quite fast and lightweight for the program (not too much memory use) and also for the user to install.

I will have to investigate about the best lib to use, I will check your suggestions. I am also thinking about a propriary format to make the data uneditable and really optimize the loading times ans consumption. XML and propriary format could be both utilized. One for edition and tuning and the other for fast access.
Title: SPARK opensource particle engine with an SFML module
Post by: ptrxyz on June 22, 2009, 08:54:24 pm
Quite nice! Will you offer .NET bindings for SPARK+SFML, too?
Title: SPARK opensource particle engine with an SFML module
Post by: Frifron on June 25, 2009, 09:15:28 pm
No i m sorry, no port is planned for SFML .Net. First because i dont know C# very well. Second because its too much work. Third because it will be less optimized with C# than with C++ (unless it is coded entirely on GPU).

Now i m working to upgrade the SFML module (1.5 support, new features and debug). I m also preparing a tutorial to learn to use SPARK with SFML.
Title: SPARK opensource particle engine with an SFML module
Post by: Frifron on July 08, 2009, 05:56:18 am
Hi,

I uploaded a new minor release (1.03.01) centered around the SFML module :


Check the change log for a detailled list of the modifications

http://spark.developpez.com (http://spark.developpez.com)

(http://spark.developpez.com/images/SPK_Tuto2_s.jpg)
Title: SPARK opensource particle engine with an SFML module
Post by: venomj on July 09, 2009, 10:28:14 am
great, i'll try it.
Title: SPARK opensource particle engine with an SFML module
Post by: Frifron on July 23, 2009, 04:06:43 pm
Hello,

just to tell you a new minor release is out.
I also opened a forum. It will be easier than the mail for questions.
Title: SPARK opensource particle engine with an SFML module
Post by: Frifron on August 06, 2009, 06:17:17 am
Hi, a new version is out :
Title: SPARK opensource particle engine with an SFML module
Post by: Auron on August 06, 2009, 09:17:11 pm
Some nice stuff, really neat features.
Title: SPARK opensource particle engine with an SFML module
Post by: Kwang1imsa on July 04, 2011, 04:17:55 am
any chance that this will get ported to SFML dotNet?
Title: SPARK opensource particle engine with an SFML module
Post by: Richy19 on September 19, 2011, 03:39:59 am
Hi, has this been updated at all to work with SFML 2?
Title: SPARK opensource particle engine with an SFML module
Post by: Mars_999 on October 16, 2011, 05:02:52 am
Quote from: "Richy19"
Hi, has this been updated at all to work with SFML 2?


Ditto!
Title: SPARK opensource particle engine with an SFML module
Post by: Roose Bolton of the Dreadfort on March 20, 2012, 06:06:17 pm
This needs to be updated for SFML 2.0.. dont let your work go to waste!