Jose Vicente Posted June 9, 2016 Share Posted June 9, 2016 Hello. 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. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted June 9, 2016 Share Posted June 9, 2016 Hiya JV! Umm... this forum thread might be for you... http://www.html5gamedevs.com/topic/18847-renderinggroupid-is-ignored-after-creating-instance/ 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. Jose Vicente 1 Quote Link to comment Share on other sites More sharing options...
Jose Vicente Posted June 10, 2016 Author Share Posted June 10, 2016 Thank you very much. As you said, I will have to rethink my strategy. 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.