GameMonetize Posted July 8, 2015 Share Posted July 8, 2015 Insanely good! Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted July 8, 2015 Share Posted July 8, 2015 That's just totally crazy stuff jerome!!! Quote Link to comment Share on other sites More sharing options...
jerome Posted July 8, 2015 Author Share Posted July 8, 2015 Thank you guys I guess it needs a bit documentation now and moreover many samples to show what is really doable with this stuff Quote Link to comment Share on other sites More sharing options...
jerome Posted July 8, 2015 Author Share Posted July 8, 2015 works will billboard mode also : http://www.babylonjs-playground.com/#2KSQ1R#46 Quote Link to comment Share on other sites More sharing options...
jerome Posted July 9, 2015 Author Share Posted July 9, 2015 funny : http://www.babylonjs-playground.com/#2KSQ1R#48 Spheres are morphed only on their top third and only them move also in the SPS whereas the cube slowly rotates Quote Link to comment Share on other sites More sharing options...
jerome Posted July 10, 2015 Author Share Posted July 10, 2015 Remember this Jahow's post : http://www.html5gamedevs.com/topic/15154-mesh-based-particle-system/?p=87260 Well, this titillated me ...So I decided to meet the challenge with the help of LOD features (thanks again to Raanan for the explanations). iiihhhaaaaa : http://www.babylonjs-playground.com/#2KSQ1R#50 Just wait for few seconds until the skull is decimated (I love this word), then click ok120 skulls emitted at 60 fps in Chrome here line 36 : skull number BTW, before using the decimation (what a word), with the full original skull, it worked at 60 fps with up to 6 skulls only. jahow, Vousk-prod. and iiceman 3 Quote Link to comment Share on other sites More sharing options...
jerome Posted July 10, 2015 Author Share Posted July 10, 2015 the same in tutty frutty mode : http://www.babylonjs-playground.com/#2KSQ1R#51a bit slower as I enabled particle colors Quote Link to comment Share on other sites More sharing options...
jahow Posted July 10, 2015 Share Posted July 10, 2015 They're so... cute!! Quote Link to comment Share on other sites More sharing options...
iiceman Posted July 10, 2015 Share Posted July 10, 2015 Niice, a skull fountain! Now make one with kittens! Vousk-prod. 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted July 10, 2015 Share Posted July 10, 2015 hehe. Excellent demo, as always. Decimation rocks, eh? What an algorithm! Hey Jerome... J-Harvey... Rome-u-lator... J-man... J-willikers... umm... ...they have a "thing" in 3D Max... called a 'particle deflector'. http://webpages.charter.net/wingthing/img/dflctrfun01.jpg http://webpages.charter.net/wingthing/img/dflctrfun02.jpg I know you Babylonified the cannonball shot/bounce parabola thing... and that was great! Now, do you think you can make it so that ANY mesh... can also be a particle deflector? Same energy after the deflection, no mesh-rotation consideration needed... just treat each particle like a cannonball ground-bounce (with any-angle ground, though, erf). Ya think? We got particles... we got Jerome tubes used as deflectors (particle pipes)... we got fluid dynamics 101. YAY! We would want to make sure that heightMaps can be particle deflectors, too... so we can spray particles into the mountains, and watch them avalanche and bury our town in lava, ash, gravel, snow, or UPS boxes. (How haphazardly I use the term "we", eh?) Wow, three posts at :38. HOT topic! Quote Link to comment Share on other sites More sharing options...
jerome Posted July 10, 2015 Author Share Posted July 10, 2015 Well... if you use the SPS, it is physics agnostic AND customizable.So yes, this is feasable as we've got access to each particle position in the updateParticle(particle) method The hard thing then is to implement the right physics by your own unless you use an all ready physics engine to manage collisions to the other shapes in the scene and set, say, an box impostor par particle. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted July 10, 2015 Share Posted July 10, 2015 Nah... ya just use your orthogonals like ya did with cannonball bounce. You treat each particle, no matter it's shape... like a sphere. If it intersects with a mesh that has its .isDeflector = true; ... you can find the point of intersect, grab a normal from the deflector, hypotenuse it with the current particle direction, and rhombus that puppy * -1. Easy! No physics... just cannonball bounce... but with a ground bounce point that could be angled somehow. Wow! You can do it, J. I know ya can. Its just cannonball bounce... sort of. Maybe. None of your particles have .ellipsoids, do they? brt brt brt, danger, Will Robinson! We don't have easy intersection checking, then. hmm. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted July 10, 2015 Share Posted July 10, 2015 Oh, I know. When a mesh.isDeflector... it engages a "watch for particles hitting me" system... and IT throws the particle away from itself at a um... proper rebound angle... same energy. YEAH!! The mesh deflector does the work! It opens up a panel on the particle, and turns a screw, which re-targets the particle! WOW!!! COOOOOL! Quote Link to comment Share on other sites More sharing options...
jerome Posted July 10, 2015 Author Share Posted July 10, 2015 I'll think about it... It should be feasable. Actually, if you want to implement only one kind of physics (say, a collision and/or gravity) to a given situation only, it's quite simple. The tough thing is to implement a model what works for any king of forces, acceleration and environment.When I did the tube cannon and the bouncing ball, I knew the ball would bounce on an horizontal ground only and would fall from the sky with an initial speed in the gravity field with no other force.So I just hard coded this : a ballistic trajectory with a collision on an horizontal plane. This means an equation on y coordinate only. If we know the deflector, what force apply to particles, we can hard code this quite easily. This won't adjust then to any other case. Quote Link to comment Share on other sites More sharing options...
jerome Posted July 10, 2015 Author Share Posted July 10, 2015 BTW, to have the skull emitter running, I had to fix some little bugs in the SPS (because the skull lacks some data I was expecting like uvs or so, need to check).So this means that I need to test the SPS addShape() method with many other meshes than BJS built-in ones, like imported .babylon format meshes or blender format meshes.As I don't know anything about blender, could someone please give a mesh (or an URL to a CORS enabled mesh resource) exported from Blender ?Something not too big in term of vertices/indices please (hundreds max would be nice) else I will have to ... DECIMATE (oh god) it Quote Link to comment Share on other sites More sharing options...
Wingnut Posted July 11, 2015 Share Posted July 11, 2015 http://playground.babylonjs.com/#1NSCXV#4 Will the rabbit work? Or maybe dude man? Somebody base-64'd a model into a playground, I think. That was something! Can't rem who. Oh, and exporting from blender to html scene... that'll get some base64 models, maybe. Sorry, I'm off topic. Hop on! Quote Link to comment Share on other sites More sharing options...
iiceman Posted July 11, 2015 Share Posted July 11, 2015 Coloes enough to the kitten cannon I imagined: http://www.babylonjs-playground.com/#2KSQ1R#53 But I kind of lost the eyes of the bunny somehow. And I didn't figure out how to adjust the life time of a particle bunny. I don't want them to disappear so fast. (But didn't read any documentation yet, just playing around ) jerome and Wingnut 2 Quote Link to comment Share on other sites More sharing options...
jerome Posted July 11, 2015 Author Share Posted July 11, 2015 Actually, the particle are recycled when they touch the ground (y < 0 line 54) and then re-emitted.If you want the particle to go higher, change the initial max velocity var v value line 35. This behavior and these properties are not proper to the SPS object.SPS doesn't know anything about particle emission, life, or recycling. It is agnostic.It just handles the creation of the mesh containing the particles and give access then to them with SPS.updateParticle(particle) what is called on each particle by SPS.setParticles() Quite simple, isn't it ? I guess the eyes are another different mesh in the imported file. Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted July 11, 2015 Share Posted July 11, 2015 Rabbits everywhere! The rabbits have a baked lightMap or something, huh? Their dark-side and specular glows... rotate WITH them. They are not reacting to the scene's lighting. Quote Link to comment Share on other sites More sharing options...
jerome Posted July 11, 2015 Author Share Posted July 11, 2015 just comment the mesh.freezeNormals() and the normals will be recomputed each frame line 72 but 32K vertices and 136K indices... beware of your CPU capacity !or lower the number of rabbitsor ... DECIMATE them ! (niiiiarrrrk niiiiaaaarrrkkk) Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 14, 2015 Share Posted September 14, 2015 But there is no way to click (pick) any of the particles, or is there? Quote Link to comment Share on other sites More sharing options...
jerome Posted September 14, 2015 Author Share Posted September 14, 2015 no, not for nowbut the whole system is just a global mesh... so as a mesh, it's pickable ! It's just a BJSX extension, it is to say an experimentI plan to port it into the BJS core in the next months Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 14, 2015 Share Posted September 14, 2015 Would be great - it's a nice way to show lots of items in the same time - just playing around with it now.How do I add / dispose some particles in the render loop? Quote Link to comment Share on other sites More sharing options...
jerome Posted September 14, 2015 Author Share Posted September 14, 2015 you can't The SPS is a single mesh, so it's built once for all with a unique (complex) process. You first declare what shapes and how many you want in it, then you build it... like you would bake a cake Thus, it has the number of vertices, indices, uvs computed from all what you just added before its baking. However you can ever add more particles (or shapes) than you need when starting and just then"disable" -not to show, or shrink or make invisble or outside the fustrum, etc- them by id, shapes, whatever, in the updateParticle(), call until you need them back Quote Link to comment Share on other sites More sharing options...
jerome Posted October 14, 2015 Author Share Posted October 14, 2015 SPS port from BJSX into BJS core started, my friends Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.