DrYSG Posted September 21, 2015 Share Posted September 21, 2015 I am looking to display as many LIDAR or Doppler data points in 3D scene as possible each frame. I do see that your particle generator: http://doc.babylonjs.com/tutorials/12._Particlescan do 1,000's each frame and update them. However, they are generated automatically, and come from a single (or small area). In our case, we will be getting a JSON feed over a WebSocket, with the data.Each will have a 3D coordinate, and maybe a magnitude value. I am a little leery of using a mesh for each one and updating at frame rate (every 250ms or 4FPS). But that would let me deal with materials such as color to show magnitude and maybe an error value. Any guidance? If I use instances, then I think it would be better, but I can only control size, rotation, and position. If I use sprites (is that the correct way to go?) then I might have a number of frames to show for each state of the particle, and also control size. And Finally, how is the current Particle System able to get such good performance? (Yea, I know you are telling me that Bablyon is for high end visualizaiton,and we should be using WebGL or OpenGL for such work) probably true, but I woiuld like to see how hard we can push Bablyon. If we could get 1,000 data points ever 250ms that would be wild! [it might turn out that the biggest drag on performance is the parsing of the WebSocket JSON and updating the points, but I don't want the GPU and image pipe to be the problem) and for that I need some help on the internals of Bablyon.js so I am turning to those in this group] Quote Link to comment Share on other sites More sharing options...
DrYSG Posted September 21, 2015 Author Share Posted September 21, 2015 FYI: I just found a site that does use WebGL to Lidar rendering, so it seems this is possible: http://lidarview.com/ But I would like to do this from inside babylon.js (and there is also http://potree.org/ which is based on three.js) Quote Link to comment Share on other sites More sharing options...
jerome Posted September 21, 2015 Share Posted September 21, 2015 The BJS particle system can handle hundreds of thousands particles per frame. Check in this forum about demos about this . Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 21, 2015 Share Posted September 21, 2015 hi dr and other forum folk! Warning: Particle festival follows! The BJS particleSystem does "effects" (shaders and stuff): http://www.babylonjs-playground.com/#1ASENS And the SPS version (Silly Particle Shapes) does fun stuff: http://www.babylonjs-playground.com/#2KSQ1R#28 SPS can build cities (almost like 3D Doppler view): http://www.babylonjs-playground.com/#2KSQ1R#57 And here's another one of those shader effect'd particle scenes: http://playground.babylonjs.com/#ZVNDN#3 Sometimes, they are sparkly particles ("sparticles"): http://playground.babylonjs.com/#1TMJMX Sometimes, intense sparkles: http://playground.babylonjs.com/#1QEP2H Sometimes we play with the very-accurate target-ability of the BJS particle emitter: http://playground.babylonjs.com/#1JEN5P And sometimes a test to see if lens flares show in mirrors... gets out-of-hand: http://playground.babylonjs.com/#QSFNK Tiz the season... for accurate emitting: http://playground.babylonjs.com/#U4QCE Some real fine light sabers: http://www.babylonjs-playground.com/#1WUQ1S#4 Sometimes the godrays get involved: http://playground.babylonjs.com/#1XOMH0 Using "sparticles" as godray emitters? omg: http://playground.babylonjs.com/#2L5DBX But yeah, soft-edged images with alpha around the outside (such as the flare and star particle textures).... will give you some "fill" between the "granules" (tiny particles) of your Doppler painting. Are you going to try for 3D Doppler viewing? Allow fly-arounds and other examinations? The closer the camera, the more chance that users will see the gaps between the particles, if you have some (to help performance). If you do allow 3D and cloud height, etc... then... hmm, you'll need to use SPS and some shape with height... and maybe some "glow" to fuzzy things-up a bit. But yeah, full coloring, texturing, scaling/sizing, shapes, all the power you could ever need (sometimes by having multiple particleSystems in a single scene.) BJS also has point cloud rendering... though I know little about it. I hope I didn't derail the thread. Party on! iiceman 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted September 21, 2015 Share Posted September 21, 2015 Wingy, you just found back all the links I was looking for ... Wingnut 1 Quote Link to comment Share on other sites More sharing options...
DrYSG Posted September 21, 2015 Author Share Posted September 21, 2015 I may not have been clear. I certainly saw the tutorials for the Particle system. But cannot use one that is a factory for automatically creating particles. The data about the location, size, color, etc. of the particles is coming from a websocket, as is the number of particles. So I need "objects" in the scene that are persistant and under my control, I will then tell them where to go, how big, and also the material properties. I.e. I cannot use an emitter, I need something where the location of each particle is set by my control, as whether it exists in the current frame, or not. The demo called SPS can build cities (almost like 3D Doppler view): http://www.babylonjs....com/#2KSQ1R#57 looked promsing, but it is not working for me on Chrome. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 21, 2015 Share Posted September 21, 2015 *nod* Yeah, sorry, I wandered off-subject a bit. I think SPS is your baby. https://github.com/BabylonJSX/SolidParticleSystem You'll need to hack it. Lots of remarks, lots of places for over-riding... Jerome (with helpers) is the SPS author. Take a look here: https://github.com/BabylonJSX/SolidParticleSystem/blob/master/solidparticlesystem.js#L626 That function... .initParticles... is your initial particle placing (and maybe coloring) point. Line 645... the updateParticle func... runs once per frame, I believe. This is where you add, remove, change colors, and move particles (fear). This could be trouble. Instead of moving particles, and/or adding particles on "the front" while removing particles from areas that are clearing... you might want to re-position all the particles with fresh colors and cloud shapes... maybe every 5 frames. This is FAR outside my knowledge base, but I believe some (video) compression schemes have found that it is wiser to ONLY have the server send "changes since last frame". On the BJS side... your particle plotter would honor that... and blaze thru that list of deltas (tweaks) in an efficient manner (in theory). There's WAY WAY smarter people than I nearby. Let's hope they respond. Be well. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 22, 2015 Share Posted September 22, 2015 Hey DrYSG, I think that Wingnut is true: you should use the work done with SPS to update your data. In a nutshell, particles and SPS work the same way: only one big updatable mesh that you update with your data on every frame. Babylon.js will then take care of doing the required optimization to make it fast and fluid This PG is the one that can help you the most: http://www.babylonjs-playground.com/#2KSQ1R#28 Just go to line 59 in updateParticle function and connect your particle with your back end DrYSG 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted September 22, 2015 Share Posted September 22, 2015 I intend to port the SPS in BJS for v2.3 nowI just need to implement some polyhedrons as basic BJS shapes first. DrYSG 1 Quote Link to comment Share on other sites More sharing options...
iiceman Posted September 22, 2015 Share Posted September 22, 2015 ah.. particles... good times... http://www.babylonjs-playground.com/#2KOEWJ#6 http://www.html5gamedevs.com/topic/11278-controlling-particles/ Quote Link to comment Share on other sites More sharing options...
jerome Posted September 22, 2015 Share Posted September 22, 2015 http://www.babylonjs-playground.com/#2KOEWJ#13 200K moving particles on a möbius ribbon ... 25 fps in my chrome Quote Link to comment Share on other sites More sharing options...
iiceman Posted September 22, 2015 Share Posted September 22, 2015 Right, that was the final version... that was pretty cool. But on my work PC the frame rate constantly drops... must be some kind of memory leak? Anyways... the point is, controlling particles is possible Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 22, 2015 Share Posted September 22, 2015 No memory-leak, but 360 particles per second more until 200k are reached? Quote Link to comment Share on other sites More sharing options...
DrYSG Posted September 24, 2015 Author Share Posted September 24, 2015 Thanks WOPR and DeltaKosh, It is working good for me right now in the 2.2 distribution. WOPR, what do you mean by?: "I intend to port the SPS in BJS for v2.3 now" Do I read this correct and that SPS is going to merge with the core BJS in version 2.3? 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.