I recently found an interesting particle engine called spark.
I saw it can be integrated with irrlicht but many examples were only for opengl. I really liked the rain example and I found that here http://spark.forum0.net/t30-spark-and-c, someone was trying to port it in irrlicht and had some issues, but never shared the final code. so I completed it and made a nice example to share with all of you
(use WASD to move and space to jump)
http://www.mediafire.com/?xie0j3yra0tx7xq
rain in irrlicht + spark (time to give something back :) )
-
- Posts: 89
- Joined: Tue Nov 06, 2007 4:49 pm
-
- Competition winner
- Posts: 688
- Joined: Mon Sep 10, 2012 8:51 am
Re: rain in irrlicht + spark (time to give something back :)
cool. Is it possible to thicken the raindrops / make the drops wider?
-
- Posts: 89
- Joined: Tue Nov 06, 2007 4:49 pm
Re: rain in irrlicht + spark (time to give something back :)
you have 3 kind of renders in spark:
IRRpointRender to draw points
IRRlineRender to drow 2d lines particle (like the rain here)
IRRQuadRender to draw "billboards" particle (like the drops here) with textures, alpha and so on.
As stated here http://spark.developpez.com/doc/class_s ... derer.html you could use setWidth to do so...
the example is kinda cheating on the drop collision and splash generation because it only check the Y attribute of the drop (here is because rainRenderer->setLength(-0.1f); (it's negative)) and if <= 0 it generate the splash and kill the particle but nothing keep you away from use triangle collision and use it to create a hill plane mesh with rain
IRRpointRender to draw points
IRRlineRender to drow 2d lines particle (like the rain here)
IRRQuadRender to draw "billboards" particle (like the drops here) with textures, alpha and so on.
As stated here http://spark.developpez.com/doc/class_s ... derer.html you could use setWidth to do so...
the example is kinda cheating on the drop collision and splash generation because it only check the Y attribute of the drop (here is because rainRenderer->setLength(-0.1f); (it's negative)) and if <= 0 it generate the splash and kill the particle but nothing keep you away from use triangle collision and use it to create a hill plane mesh with rain
Re: rain in irrlicht + spark (time to give something back :)
Nice! A little clearer than the one in the demos (and for Irrlicht).
I think we can add it to the Irrlicht demos for SPARK 2.0 when it will be finished (soon, I hope).
I think we can add it to the Irrlicht demos for SPARK 2.0 when it will be finished (soon, I hope).
-
- Posts: 89
- Joined: Tue Nov 06, 2007 4:49 pm
Re: rain in irrlicht + spark (time to give something back :)
would be nice! it should be cleaned up a bit (I left some commented out code and I could not get a better fog XD) but I really like the idea. irrlicht + spark it's a winning setup!
I'd like to take this opportunity to to express my appreciation for your work darktib
I'd like to take this opportunity to to express my appreciation for your work darktib
Re: rain in irrlicht + spark (time to give something back :)
im not sure it needed porting it comes default with examples but it looks close to the horde demo now we just need some models randomly walking around on bump mapped rock texture
Live long and phosphor!
-- https://github.com/netpipe/Luna Game Engine Status 95%
-- https://github.com/netpipe/Luna Game Engine Status 95%
-
- Posts: 89
- Joined: Tue Nov 06, 2007 4:49 pm
Re: rain in irrlicht + spark (time to give something back :)
every piece of code out there need a porting in irrlicht... windows 9 would be the greatest SO ever if it will be based on unix and irrlicht XD
anyway I got a couple of problem regarding the kill callback because directly calling KillRain() like in the OGL example cause irrlicht to crash here:
I think because as stated here: http://spark.developpez.com/doc/class_s ... bbfcbe57f9
p.s. wich "horde demo" are you referring to?
anyway I got a couple of problem regarding the kill callback because directly calling KillRain() like in the OGL example cause irrlicht to crash here:
Code: Select all
splashGroup->addParticles(1,particle.position(),Vector3D());
so this is why I thought it would be a useful shareParticles will be added to the Group at the next call to update(unsigned int) or flushAddedParticles().
This is why any Emitter and Zone used to generate particles must be valid at the next call of either update(unsigned int) or flushAddedParticles().
p.s. wich "horde demo" are you referring to?
Re: rain in irrlicht + spark (time to give something back :)
Live long and phosphor!
-- https://github.com/netpipe/Luna Game Engine Status 95%
-- https://github.com/netpipe/Luna Game Engine Status 95%