Page 1 of 1

rain in irrlicht + spark (time to give something back :) )

Posted: Sun Jan 13, 2013 6:32 pm
by EvIl_DeViL
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

Image

Re: rain in irrlicht + spark (time to give something back :)

Posted: Mon Jan 14, 2013 1:42 am
by chronologicaldot
cool. Is it possible to thicken the raindrops / make the drops wider?

Re: rain in irrlicht + spark (time to give something back :)

Posted: Mon Jan 14, 2013 1:03 pm
by EvIl_DeViL
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 ;)

Re: rain in irrlicht + spark (time to give something back :)

Posted: Mon Jan 14, 2013 9:26 pm
by Darktib
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).

Re: rain in irrlicht + spark (time to give something back :)

Posted: Mon Jan 14, 2013 9:50 pm
by EvIl_DeViL
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 :D

Re: rain in irrlicht + spark (time to give something back :)

Posted: Mon Jan 14, 2013 11:05 pm
by netpipe
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

Re: rain in irrlicht + spark (time to give something back :)

Posted: Tue Jan 15, 2013 12:03 am
by EvIl_DeViL
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:

Code: Select all

splashGroup->addParticles(1,particle.position(),Vector3D());
I think because as stated here: http://spark.developpez.com/doc/class_s ... bbfcbe57f9
Particles 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().
so this is why I thought it would be a useful share :)

p.s. wich "horde demo" are you referring to?

Re: rain in irrlicht + spark (time to give something back :)

Posted: Wed Jan 16, 2013 9:58 am
by netpipe