Mesh overlayColor and Multiple Cameras

Hello community,

I have a multiple canvases setup, rendering one scene and each canvas is registered to a camera.

My goal is to apply a tint to a mesh (using renderOverlay ) and ensure that this color is visible only from a specific camera.

is that even possible ?

It is not possible because renderOverlay is a mesh property, you can’t have different values depending on the camera.

What you can do is use a different material to render your mesh, depending on the camera.

If you have camera1 and camera2 and created material1 and material2, you can instruct the renderer to render your mesh with material1 for camera1 and material2 for camera2 by doing:

mesh.setMaterialForRenderPass(camera1.renderPassId, material1);
mesh.setMaterialForRenderPass(camera2.renderPassId, material2);
1 Like

Thanks !
I’ll try that out.