# Mirror material - reflection texture

**URL:** https://forum.babylonjs.com/t/mirror-material-reflection-texture/38822
**Category:** Questions
**Created:** [March 7, 2023, 1:25pm UTC](https://forum.babylonjs.com/t/mirror-material-reflection-texture/38822 "2023-03-07T13:25:41Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jayakannan](https://avatars.discourse-cdn.com/v4/letter/j/ee59a6/32.png) [@jayakannan](https://forum.babylonjs.com/u/jayakannan)
#### Post date: [March 7, 2023, 1:25pm UTC](https://forum.babylonjs.com/t/mirror-material-reflection-texture/38822/1 "2023-03-07T13:25:41Z")

</div>

Hi,  
I tried to create a mirror material as shown in the example given below…

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

I got the live reflection but it is inverted and partial. I tried to do this like a mirror in the bathroom. In that mesh, 30% shows inverted reflection, 30% shows black color and remaining 40% shows bright white color.  
I am using the code given below.

```auto
 var meshgloss = scene.getMeshByName("Props_primitive4");
meshgloss.computeWorldMatrix(true);
var glass_worldMatrix = meshgloss.getWorldMatrix();
var glass_vertexData = meshgloss.getVerticesData("normal");
 var glassNormal = new BABYLON.Vector3(glass_vertexData[0], glass_vertexData[1], glass_vertexData[2]);	
glassNormal = BABYLON.Vector3.TransformNormal(glassNormal, glass_worldMatrix)
var reflector = BABYLON.Plane.FromPositionAndNormal(meshgloss.position, glassNormal.scale(-1));
var mirrorMaterial = new BABYLON.StandardMaterial("mirror", scene);
mirrorMaterial.reflectionTexture = new BABYLON.MirrorTexture("mirror", 2048, scene, true);
(<BABYLON.MirrorTexture>mirrorMaterial.reflectionTexture).mirrorPlane = reflector;
mirrorMaterial.reflectionTexture.level =1;
(<BABYLON.MirrorTexture>mirrorMaterial.reflectionTexture).renderList = renderlistMesh;
meshgloss.material = mirrorMaterial;

```

I changed the glassNormal.scale(-1) into glassNormal.scale(1) and so many other values, at that time I couldn’t even achieve that 30% inverted reflection also. Kindly help me to understand this functionality. I don’t know how this function is working and what is the purpose of all the parameters given here. Thanks.

---

<div class="post-metadata">

### Author: ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)
#### Post date: [March 7, 2023, 8:45pm UTC](https://forum.babylonjs.com/t/mirror-material-reflection-texture/38822/2 "2023-03-07T20:45:03Z")

</div>

> [@jayakannan](#):
>
> I got the live reflection but it is inverted and partial

I am not sure to understand why you think it is inverted ? try with a model instead of a sphere
