# How to assign the texture of mirrortexture to shader ？

**URL:** <https://forum.babylonjs.com/t/how-to-assign-the-texture-of-mirrortexture-to-shader/33372>\
**Category:** Questions\
**Tags:** shader\
**Created:** [August 25, 2022, 12:15pm UTC](https://forum.babylonjs.com/t/how-to-assign-the-texture-of-mirrortexture-to-shader/33372 "2022-08-25T12:15:47Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![ecojust](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/ecojust/32/12884_2.png) [@ecojust](https://forum.babylonjs.com/u/ecojust)\
**Post date:** [August 27, 2022, 11:05am UTC](https://forum.babylonjs.com/t/how-to-assign-the-texture-of-mirrortexture-to-shader/33372/4 "2022-08-27T11:05:14Z")

</div>

> [@Custom transparent ground that receives shadows, show mirror and use diffuseTexture](https://forum.babylonjs.com/t/custom-transparent-ground-that-receives-shadows-show-mirror-and-use-diffusetexture/15066/7):
>
> I think what you want is to keep the shadow and the mirror and have everything else transparent? Maybe this will work for you: [https://playground.babylonjs.com/#9KLUBA#4](https://playground.babylonjs.com/#9KLUBA#4) If the shadow variable is strictly less than 1 it means the pixel is at least partly in shadow. And the if (color.r != 0.2 || color.g != 0.2 || color.b != 0.3) check is to test against the clear color.

Maybe CustomMaterial is a good solution for it .

---

_[View the full topic](https://forum.babylonjs.com/t/how-to-assign-the-texture-of-mirrortexture-to-shader/33372)._
