# Why does the weird overlapping lines appear when the camera is far? when the camera is near, it is all ok

**URL:** <https://discourse.threejs.org/t/why-does-the-weird-overlapping-lines-appear-when-the-camera-is-far-when-the-camera-is-near-it-is-all-ok/60986>\
**Category:** Questions\
**Tags:** shaders\
**Created:** [February 2, 2024, 4:02am UTC](https://discourse.threejs.org/t/why-does-the-weird-overlapping-lines-appear-when-the-camera-is-far-when-the-camera-is-near-it-is-all-ok/60986 "2024-02-02T04:02:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kong2dog](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/kong2dog/32/25339_2.png) [@kong2dog](https://discourse.threejs.org/u/kong2dog)\
**Post date:** [February 2, 2024, 4:02am UTC](https://discourse.threejs.org/t/why-does-the-weird-overlapping-lines-appear-when-the-camera-is-far-when-the-camera-is-near-it-is-all-ok/60986/1 "2024-02-02T04:02:57Z")

</div>

![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/e/f/ef08f19914b1a48f1045f438f907cbf7fd9fdf89.png)  
when camera is far

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/5/d/5da88f786b3c94a9d4cda97208b7cdd8966e7fb1.png)  
when camera is near

---

<div class="post-metadata">

**Author:** ![mjurczyk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mjurczyk/32/10995_2.png) [@mjurczyk](https://discourse.threejs.org/u/mjurczyk)\
**Post date:** [February 2, 2024, 4:49am UTC](https://discourse.threejs.org/t/why-does-the-weird-overlapping-lines-appear-when-the-camera-is-far-when-the-camera-is-near-it-is-all-ok/60986/2 "2024-02-02T04:49:38Z")

</div>

Could be [z-fighting](https://en.wikipedia.org/wiki/Z-fighting) or [shadow acne](https://digitalrune.github.io/DigitalRune-Documentation/html/3f4d959e-9c98-4a97-8d85-7a73c26145d7.htm) - try disabling shadows in the scene first and see if it helps.

---

<div class="post-metadata">

**Author:** ![kong2dog](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/kong2dog/32/25339_2.png) [@kong2dog](https://discourse.threejs.org/u/kong2dog)\
**Post date:** [February 2, 2024, 5:48am UTC](https://discourse.threejs.org/t/why-does-the-weird-overlapping-lines-appear-when-the-camera-is-far-when-the-camera-is-near-it-is-all-ok/60986/3 "2024-02-02T05:48:12Z")

</div>

I disabled shadowMap on renderer, but the problem still exists

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/9/5/958946bac85cc12711ba2ca1c3f546002d70535b.jpeg)

---

<div class="post-metadata">

**Author:** ![mjurczyk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mjurczyk/32/10995_2.png) [@mjurczyk](https://discourse.threejs.org/u/mjurczyk)\
**Post date:** [February 2, 2024, 6:22am UTC](https://discourse.threejs.org/t/why-does-the-weird-overlapping-lines-appear-when-the-camera-is-far-when-the-camera-is-near-it-is-all-ok/60986/4 "2024-02-02T06:22:14Z")

</div>

Are there multiple models in the scene? If yes, is there a chance they are relatively close by one another? If yes, try increasing / decreasing camera near and far values.

---

<div class="post-metadata">

**Author:** ![kong2dog](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/kong2dog/32/25339_2.png) [@kong2dog](https://discourse.threejs.org/u/kong2dog)\
**Post date:** [February 2, 2024, 6:23am UTC](https://discourse.threejs.org/t/why-does-the-weird-overlapping-lines-appear-when-the-camera-is-far-when-the-camera-is-near-it-is-all-ok/60986/5 "2024-02-02T06:23:07Z")

</div>

Thank you, I will try to figure it out.

---

<div class="post-metadata">

**Author:** ![kong2dog](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/kong2dog/32/25339_2.png) [@kong2dog](https://discourse.threejs.org/u/kong2dog)\
**Post date:** [February 2, 2024, 6:45am UTC](https://discourse.threejs.org/t/why-does-the-weird-overlapping-lines-appear-when-the-camera-is-far-when-the-camera-is-near-it-is-all-ok/60986/6 "2024-02-02T06:45:55Z")

</div>

![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/7/8/781b0b963ed3bbb12dd2ccd19fa8398f89930c18.jpeg)  
after I adjust the camera far from 100000 to 5000, it is ok now

---

<div class="post-metadata">

**Author:** ![mjurczyk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mjurczyk/32/10995_2.png) [@mjurczyk](https://discourse.threejs.org/u/mjurczyk)\
**Post date:** [February 2, 2024, 7:47am UTC](https://discourse.threejs.org/t/why-does-the-weird-overlapping-lines-appear-when-the-camera-is-far-when-the-camera-is-near-it-is-all-ok/60986/7 "2024-02-02T07:47:31Z")

</div>

Depth precision is large, but still limited. So when you increase the difference between near and far plane too much, objects and faces will start fighting with one another for the rendering order (since only one thing can be rendered at a specific depth, increasing far parameter increases the range of depth but lowers the amount of discrete depth steps within that range.)

If you need to render super large distances - you can also consider switching to [logarithmic depth](https://threejs.org/examples/?q=log#webgl_camera_logarithmicdepthbuffer) - that way you can render a wide range of objects at different scales and distances, without worrying about z-fighting.
