# Making mesh invisible for the camera but still available for ReflectionProbe

**URL:** <https://forum.babylonjs.com/t/making-mesh-invisible-for-the-camera-but-still-available-for-reflectionprobe/34480>\
**Category:** Questions\
**Tags:** lighting, material, camera\
**Created:** [October 4, 2022, 2:47pm UTC](https://forum.babylonjs.com/t/making-mesh-invisible-for-the-camera-but-still-available-for-reflectionprobe/34480 "2022-10-04T14:47:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![djamesg](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/djamesg/32/25266_2.png) [@djamesg](https://forum.babylonjs.com/u/djamesg)\
**Post date:** [October 4, 2022, 2:47pm UTC](https://forum.babylonjs.com/t/making-mesh-invisible-for-the-camera-but-still-available-for-reflectionprobe/34480/1 "2022-10-04T14:47:17Z")

</div>

Hello,  
I’ve been using ReflectionProbe feature for my project, and I use plane meshes with emissive  
textures and making my primal mesh reflect those planes, however I do not want these plane meshes to appear in my scene, so my question is:  
Is there any way for me to reflect meshes with ReflectionProbe and make reflected meshes not  
render in the scene?

Please use following link for the ReflectionProbe reference:

> **[Babylon.js Playground](https://playground.babylonjs.com/#KA93U%23875)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

Thank you in advance BabylonJS community!

---

<div class="post-metadata">

**Author:** ![djamesg](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/djamesg/32/25266_2.png) [@djamesg](https://forum.babylonjs.com/u/djamesg)\
**Post date:** [October 4, 2022, 3:29pm UTC](https://forum.babylonjs.com/t/making-mesh-invisible-for-the-camera-but-still-available-for-reflectionprobe/34480/2 "2022-10-04T15:29:24Z")

</div>

For example in Blender & C4D there are functions using which you can hide meshes from camera, but reflections by other meshes still stay in the scene, that’s what I’m trying to achieve. (If my question was not clear, thought this would help clarify);

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [October 4, 2022, 3:35pm UTC](https://forum.babylonjs.com/t/making-mesh-invisible-for-the-camera-but-still-available-for-reflectionprobe/34480/3 "2022-10-04T15:35:36Z")

</div>

You can change the `layerMask` of the camera before rendering into the reflection texture (and reset it after). Something like this:

> **[Babylon.js Playground](https://playground.babylonjs.com/#KA93U%23876)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

In this PG, I have set a specific `layerMask` for the blue/red/yellow spheres so that they are rendered only by the reflection probe (lines 33/37/41 and 88-94).

---

<div class="post-metadata">

**Author:** ![djamesg](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/djamesg/32/25266_2.png) [@djamesg](https://forum.babylonjs.com/u/djamesg)\
**Post date:** [October 4, 2022, 4:08pm UTC](https://forum.babylonjs.com/t/making-mesh-invisible-for-the-camera-but-still-available-for-reflectionprobe/34480/4 "2022-10-04T16:08:07Z")

</div>

Thank you very much for making my life easier,  
btw do you have any idea on how to blur those probe reflections?

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [October 4, 2022, 10:01pm UTC](https://forum.babylonjs.com/t/making-mesh-invisible-for-the-camera-but-still-available-for-reflectionprobe/34480/5 "2022-10-04T22:01:40Z")

</div>

The PGs in this thread are doing the blur with a post process (but it’s not a cube texture):

> [@PBR Refraction roughness (blurriness)](https://forum.babylonjs.com/t/pbr-refraction-roughness-blurriness/23334/10):
>
> Since 5.0, postProcessManager.directRender() is taking a RenderTargetWrapper instead of an InternalTexture as the output object (change in line 153): I don’t really remember how we ended with this PG, but if you found an easier way to achieve what you want all the better!

In the same thread, using a cube texture (probe):

> [@PBR Refraction roughness (blurriness)](https://forum.babylonjs.com/t/pbr-refraction-roughness-blurriness/23334/4):
>
> You need to enable generation of mipmaps for the probes, as well as adding a reflection texture (env map - see line 4), else the realtime filtering feature is not enabled: [https://playground.babylonjs.com/#22KZUW#274](https://playground.babylonjs.com/#22KZUW#274) I have also enabled the [local cube map](https://doc.babylonjs.com/divingDeeper/materials/using/reflectionTexture#local-cubemaps) feature on the refraction textures (by setting the boundingBoxPosition and boundingBoxSize properties), as it is a little better.

---

<div class="post-metadata">

**Author:** ![djamesg](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/djamesg/32/25266_2.png) [@djamesg](https://forum.babylonjs.com/u/djamesg)\
**Post date:** [October 5, 2022, 7:33am UTC](https://forum.babylonjs.com/t/making-mesh-invisible-for-the-camera-but-still-available-for-reflectionprobe/34480/6 "2022-10-05T07:33:23Z")

</div>

I was aware of that but thank you for taking time, I really appreciate it.
