SterlingRunion

Particle system issue

Recommended Posts

Hi everyone new poster here. I have a scene that has several particle systems rotating around a sphere. When the scene starts the particle systems leave a smattering of material that I did not intend. My question is how to I fix this? I want the particle systems to behave without this "smatter". The picture show the issue.

Here is the url: http://www.sterlingrunion.com/Planet/Index

 

The javascript is  /Scripts/planet.js

part-system-issue.png

Share this post


Link to post
Share on other sites

Hi SR, welcome to the forum!  Sorry for the slow replies on this.

    window.onload = function () {
        event.preventDefault();
        let wdlg = document.getElementById('loader-display');

I am getting error:  event is not defined... on that middle line 137.  FF 52 ESR.

"Smatter".. hehe.  I like that term.  We HAVE seen residual particles happen upon re-runs... at times.

Allow me to ask... are the "smatters" less-likely to happen... on INITIAL loads/unconditional reloads?

It is more-likely to happen on subsequent runs AFTER the initial run?   Thoughts?  (thx)

I don't know what causes it... but smarter people... might. :)

Residual particles after re-runs... yep... we've seen it.  Same weird stuff happens when you un-focus (Alt-Tab) away-from a particle-spraying scene, and then return.  Sort of a PUFF thing happens.  Pent-up particle energy or something.  :D

Share this post


Link to post
Share on other sites

Hi Wingnut thanks for the reply. What browser are you using that throws the event is not defined? The residual particles happen on initial run. It starts twice but the code only starts it once. It "puffs" then starts again.

Share this post


Link to post
Share on other sites
9 hours ago, Wingnut said:

FF 52 ESR.

That's Firefox 52 ESR... sort of a Pale Moon half-breed.  hahaha.  Ahem. 

Inside joke... Pale Moon is a serious branch-off from normal Firefox.  Firefox 52 ESR is "extended support release"... which is a limp branch-off from Firefox normal releases.  I think Firefox ESR is pretty popular... especially among those who are rejecting "Quantum".

Thanks for the added details about your issue... well done.  I still have no answers, but others are nearby... stay tuned.

Can you do scene.executeWhenReady(function() { startMyParticleSystems() })  ?  Any improvements?  (thx for checking.  just an idea, probably a bad one.)

Share this post


Link to post
Share on other sites

I will have to do some testing on Firefox it seems. I call scene.executeWhenReady(), then create the particle systems and then in scene.registerBeforeRender() the systems call start() by checking a bool flag on an object that holds the info that I need for display.

 

particleMachine.forEach(function (item) {
                item.ps.emitter = new BABYLON.Vector3(item.distance * Math.sin(item.alpha), theSun.position.y, item.distance * Math.cos(item.alpha));
                item.pe.position = new BABYLON.Vector3(item.distance * Math.sin(item.alpha), theSun.position.y, item.distance * Math.cos(item.alpha));
                item.alpha += .005;
                if (item.started == false) {
                    item.started = true;
                    item.ps.start();
                }
            });

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.