Jump to content

renderOverlay with Instances

Jose Vicente

Recommended Posts


I have a scene with some instances, and I would like to renderOverlay only for some of them.

However it seems that setting renderOverlay on an InstancedMesh has no effect at all (seems that this value is always obtained from parent mesh).

In this sample  I set renderOverlay = true on an instancedMesh, and nothing happens.

In this sample I set renderOverlay = true on the parent mesh, and renderOverlay = false on an InstancedMesh, but overlay is rendered for all instances.

Am I'm doing something wrong?

Thanks in advance.

Best Regards.



Link to comment
Share on other sites

Hiya JV!  Umm...  this forum thread might be for you...


According to things said there, instances are rendered in a single draw-call.  Thus... something.  :)  .renderingGroupId is not used.  Maybe you will need to use clones, or do a project strategy re-think.  Unfortunately, clones are much more byte-heavy than instances, and parent material is not inherited. 

But... materials are clone-able, too.  This gives no speed increase for scene rendering, but it does speed-up scene-building a bit: 

clonemesh.material = parentmesh.material.clone()

Here is a playground that shows it.  (lines 32-33)   Hope this helps.  Be well.

Link to comment
Share on other sites

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.

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.


  • Recently Browsing   0 members

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