haestflod Posted September 1, 2016 Share Posted September 1, 2016 Hi, I'm outlining the silhouette of a mesh when mouseovering by using this technique:http://www.babylonjs-playground.com/#24758V#1 I was originally only using 1 camera but I ran into antialiasing issues. The antialiasing was turned off when the postprocess was enabled on mouseover and then on when leaving creating a flicker on nearby meshes. So I am currently using 2 cameras like in that example. However after checking performance I noticed that adding the second camera doubles the draw calls going from (~70 -> ~140) Is there a way to tell second camera to only render the mouseovered meshes? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted September 1, 2016 Share Posted September 1, 2016 http://doc.babylonjs.com/tutorials/Layermasks_and_Multi-cam_Textures Quote Link to comment Share on other sites More sharing options...
haestflod Posted September 2, 2016 Author Share Posted September 2, 2016 Thanks that worked. For those wondering what I did: // Main camera has default layerMask (0x0FFFFFFF) // Outline camera has layermask 0x20000000; // When adding mesh to outline mesh.layerMask = 0x2FFFFFFF; // When clearing the outline renderTarget (disabling outline) for (let i = 0; i < renderList.length; ++i){ renderList[i].layerMask = 0x0FFFFFFF; } GameMonetize 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.