# Visual Bug using envMap reflection (r84)

**URL:** <https://discourse.threejs.org/t/visual-bug-using-envmap-reflection-r84/62>\
**Category:** Questions\
**Tags:** environment-map\
**Created:** [March 15, 2017, 9:08pm UTC](https://discourse.threejs.org/t/visual-bug-using-envmap-reflection-r84/62 "2017-03-15T21:08:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![fedeMarino](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fedemarino/32/51061_2.png) [@fedeMarino](https://discourse.threejs.org/u/fedeMarino)\
**Post date:** [March 15, 2017, 9:08pm UTC](https://discourse.threejs.org/t/visual-bug-using-envmap-reflection-r84/62/1 "2017-03-15T21:08:38Z")

</div>

Hi, it’s seems there may be a bug on the envMap implementation of MeshPhongMaterial.  
I built a simple scene with a Sphere and a MeshPhongMaterial with an envMap texture, (top half is white and bottom half is black).

As you can see, a vertical 1px line appears in the reflection, that should not be there.

![](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/threejs/original/1X/5aeae8f48d112f4f754abfef9a769e55994b1d6d.PNG)

Did anyone has this problem? Is there any workaround?

I tried setting the repeat parameter to 0.99. The texture has power of 2 dimensions

Here is my code:

var mat1= new THREE.MeshPhongMaterial({  
color:0x999999,  
specular:0xFFFFFF,  
reflectivity:1,

```
});

var loader = new THREE.TextureLoader();
loader.load('test1.png',function ( texture ) {

   texture.wrapS = THREE.RepeatWrapping;
   texture.wrapT = THREE.RepeatWrapping;
   texture.mapping = THREE.EquirectangularReflectionMapping;
   texture.repeat.set( 1 , 1 ); 

   mat1.envMap=texture;
   mat1.needsUpdate=true;
});

var mesh = new THREE.Mesh(new THREE.SphereGeometry( 35, 32, 32 ), 
                          mat1 );      
scene.add(mesh);
```

---

<div class="post-metadata">

**Author:** ![fraguada](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fraguada/32/2_2.png) [@fraguada](https://discourse.threejs.org/u/fraguada)\
**Post date:** [March 15, 2017, 9:11pm UTC](https://discourse.threejs.org/t/visual-bug-using-envmap-reflection-r84/62/2 "2017-03-15T21:11:06Z")

</div>

Could you upload that image as well?

---

<div class="post-metadata">

**Author:** ![TheCodeCrafter](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/thecodecrafter/32/50_2.png) [@TheCodeCrafter](https://discourse.threejs.org/u/TheCodeCrafter)\
**Post date:** [March 15, 2017, 10:04pm UTC](https://discourse.threejs.org/t/visual-bug-using-envmap-reflection-r84/62/3 "2017-03-15T22:04:44Z")

</div>

Could you possibly link the editor, or a jsfiddle?

---

<div class="post-metadata">

**Author:** ![mrdoob](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mrdoob/32/22417_2.png) [@mrdoob](https://discourse.threejs.org/u/mrdoob)\
**Post date:** [March 15, 2017, 11:10pm UTC](https://discourse.threejs.org/t/visual-bug-using-envmap-reflection-r84/62/4 "2017-03-15T23:10:10Z")

</div>

That’s a limitation of `EquirectangularReflectionMapping`.

You can use `CubeCamera` to convert a equirectangular texture into a `CubeTexture`. Take a look at this example:

[https://threejs.org/examples/#webgl\_materials\_cubemap\_dynamic2](https://threejs.org/examples/#webgl_materials_cubemap_dynamic2)

---

<div class="post-metadata">

**Author:** ![fedeMarino](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fedemarino/32/51061_2.png) [@fedeMarino](https://discourse.threejs.org/u/fedeMarino)\
**Post date:** [March 16, 2017, 1:49pm UTC](https://discourse.threejs.org/t/visual-bug-using-envmap-reflection-r84/62/5 "2017-03-16T13:49:34Z")

</div>

Thanks, I’ll try that alternative

---

<div class="post-metadata">

**Author:** ![fedeMarino](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fedemarino/32/51061_2.png) [@fedeMarino](https://discourse.threejs.org/u/fedeMarino)\
**Post date:** [March 16, 2017, 1:50pm UTC](https://discourse.threejs.org/t/visual-bug-using-envmap-reflection-r84/62/6 "2017-03-16T13:50:21Z")

</div>

Sorry, only one image was allowed in the post

---

<div class="post-metadata">

**Author:** ![TheCodeCrafter](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/thecodecrafter/32/50_2.png) [@TheCodeCrafter](https://discourse.threejs.org/u/TheCodeCrafter)\
**Post date:** [March 16, 2017, 1:53pm UTC](https://discourse.threejs.org/t/visual-bug-using-envmap-reflection-r84/62/7 "2017-03-16T13:53:17Z")

</div>

You can link multiple images and a small snapshot will be showed. That is allowed (and preferred)! 🙂 😉
