jerome Posted May 20, 2016 Share Posted May 20, 2016 Hi people, Well this is something far less glorious than the last @Nockawa's announcements, but anyway here is a new SPS feature : the per particle visibility (PG coming) Simple : particle.isVisible = false; // default : true or back to true, as you need/want Note that the visibility doesn't prevent the other property values (position, rotation, etc) to be updated, so you can move an invisible particle for instance. Moreover, the method updateParticle(), used to set each particle behavior, is still called for every particle, visible or not. So if, for performance reasons, you don't want to handle the invisible particles, just add a little condition : updateParticle = function(particle) { if (!particle.isVisible) { return; } // else do the right stuff }; NasimiAsl, Samuel Girardin, iiceman and 2 others 5 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 20, 2016 Share Posted May 20, 2016 This is COOL Quote Link to comment Share on other sites More sharing options...
jerome Posted May 20, 2016 Author Share Posted May 20, 2016 a few, my nephew ! (translate this, google) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 20, 2016 Share Posted May 20, 2016 Works pretty well Quote Link to comment Share on other sites More sharing options...
jerome Posted May 21, 2016 Author Share Posted May 21, 2016 here's a first simple playground about SPS particle visibility / invisibility : http://www.babylonjs-playground.com/#HDHQN#1 each click on the torus makes the picked particle invisible and each particle is built with all the triangles of a torus tubular segment, so clicking slices the torus of course, if you don't specify this particle size, the default is an elementary triangular facet : http://www.babylonjs-playground.com/#HDHQN#2 another one : clicking sets the picked particle invisble again http://www.babylonjs-playground.com/#2FPT1A#72 Sebavan 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted May 21, 2016 Author Share Posted May 21, 2016 other example with cycling visibility : http://www.babylonjs-playground.com/#HDHQN#3 changing the particle size to 1 : http://www.babylonjs-playground.com/#HDHQN#4 Wingnut and iiceman 2 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted May 21, 2016 Share Posted May 21, 2016 Nice nice nice, J-doggydog! Hey, remember that... thing... that... city of red blocks? http://www.babylonjs-playground.com/#2KSQ1R#57 That might be a little more like what @chicagobob123 was looking-for. But there, Jerome, you use the addCubes()... and I suspect that "cubes" don't have the .isVisible property, and can't. Or can they? If you feel like updating "red box town" and showing us how to disappear/reappear particles in THAT situation, that would be cool, thx! Quote Link to comment Share on other sites More sharing options...
jerome Posted May 21, 2016 Author Share Posted May 21, 2016 actually, the version that you used, Wingy, is the one with the SPS prototype when it was under active design all the addCubes, addTetrahedrons, addThis, addThat functions have been replaced by a generic addShape(model) function, where "model" is any mesh you want the demo with the buildings is in the BJS doc in this part : http://doc.babylonjs.com/overviews/Solid_Particle_System#create-an-immutable-sps http://www.babylonjs-playground.com/#2FPT1A#36 (80K buildings here) far more optimized than the old one from the SPS prototype Wingnut, Samuel Girardin and iiceman 3 Quote Link to comment Share on other sites More sharing options...
chicagobob123 Posted May 21, 2016 Share Posted May 21, 2016 The cool thing is the 80k version work at over 30fps on my note5. 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.