Jump to content

Instance.dispose() - Should be removed from ShadowGenerator?


KevinBLT
 Share

Recommended Posts

Hello,

is it the correct behaviour that instances that are being disposed doesn't get removed from ShadowGenerator.getShadowMap().renderList ?

I have the refreshrate set to 0 and only render with shadow on demand.

  if (_renderShadow && this._manuallyShadowRender) {
    this._shadowGenerator.getShadowMap().refreshRate = 1;
    this._scene.render();
    this._shadowGenerator.getShadowMap().refreshRate = 0;
  } else {
    this._scene.render();
  }

Is this a problem i this case?

I just want to know (maybe it's a bug). Shouldn't ShadowGenerator check the Mesh.isDisposed attribute?

 

Have a nice day

 

Kevin

Link to comment
Share on other sites

Hi again Kevin, good to see you.

I built a little test playground.  http://playground.babylonjs.com/#IYJFJ#1

At 4 seconds, I dispose the torus (full mesh, not instance or clone).

At 8 secs, I report the renderLists from the 2 shadowGens... to console.

Yep, there they are... ghost mesh... hiding the shadows.  I poked them with a stick to see if they were real... but I couldn't tell for sure.  :)

Have you done a thorough forum search on this topic?  Just curious because... it seems I barely remember another thread about this.

But perhaps the zombie mesh are fogging my brain.  :)  The shadows DO disappear at the 4-second dispose moment, but... ghosts don't cast shadows. :o

hmm.  Thx for the report.  I will do some forum searches myself... but, I agree.  Scene sg's should have their renderLists periodically checked for zombies and other un-dead.  hmm.

Link to comment
Share on other sites

  • 1 month later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...