# Example contact shadows is blinking + artifacts

**URL:** <https://discourse.threejs.org/t/example-contact-shadows-is-blinking-artifacts/21318>\
**Category:** Questions\
**Tags:** rendertarget, examples\
**Created:** [December 7, 2020, 11:18am UTC](https://discourse.threejs.org/t/example-contact-shadows-is-blinking-artifacts/21318 "2020-12-07T11:18:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fluqz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fluqz/32/6279_2.png) [@Fluqz](https://discourse.threejs.org/u/Fluqz)\
**Post date:** [December 7, 2020, 11:18am UTC](https://discourse.threejs.org/t/example-contact-shadows-is-blinking-artifacts/21318/1 "2020-12-07T11:18:48Z")

</div>

Hey, Im playing around with the [contact shadow example](https://threejs.org/examples/?q=contact#webgl_shadow_contact). I noticed that when looking at it from further away, the shadows will start dancing. They get striped and blink randomly. I made a [example to demonstrate it better.](https://jsfiddle.net/h0jmwvpd/2/)

I extended the example with a wall and a model.  
I also only render to the renderTargets once and not in animationFrame, I thought this might fix the issue, but its not.  
Disabling blur does not fix it as well.

Any ideas?

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [December 7, 2020, 11:57am UTC](https://discourse.threejs.org/t/example-contact-shadows-is-blinking-artifacts/21318/2 "2020-12-07T11:57:00Z")

</div>

Could be a precision related issue…

---

<div class="post-metadata">

**Author:** ![Fluqz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fluqz/32/6279_2.png) [@Fluqz](https://discourse.threejs.org/u/Fluqz)\
**Post date:** [December 7, 2020, 1:49pm UTC](https://discourse.threejs.org/t/example-contact-shadows-is-blinking-artifacts/21318/3 "2020-12-07T13:49:07Z")

</div>

Should I report it as bug?

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [December 7, 2020, 1:55pm UTC](https://discourse.threejs.org/t/example-contact-shadows-is-blinking-artifacts/21318/4 "2020-12-07T13:55:51Z")

</div>

I’m not sure this is fixable. Seems to be a limitation of the approach.

But yeah, the original contributor of the example could have a look at it.

---

<div class="post-metadata">

**Author:** ![Fluqz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fluqz/32/6279_2.png) [@Fluqz](https://discourse.threejs.org/u/Fluqz)\
**Post date:** [December 7, 2020, 2:13pm UTC](https://discourse.threejs.org/t/example-contact-shadows-is-blinking-artifacts/21318/5 "2020-12-07T14:13:08Z")

</div>

> <https://github.com/mrdoob/three.js/issues/20848>
>
> Describe the bug
> The contact shadow example from @marcofugaro, when viewed from further away or with increased plane size, starts to flimmer...

---

<div class="post-metadata">

**Author:** ![Fluqz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fluqz/32/6279_2.png) [@Fluqz](https://discourse.threejs.org/u/Fluqz)\
**Post date:** [December 7, 2020, 2:35pm UTC](https://discourse.threejs.org/t/example-contact-shadows-is-blinking-artifacts/21318/6 "2020-12-07T14:35:29Z")

</div>

What I dont understand is, that im rendering to a renderTarget and use it as texture. I only render the renderTarget once. When the texture is done and not touched anymore, how has it to do with MeshDepthMaterial?

Would it be possible to save the renderTarget as png?

---

<div class="post-metadata">

**Author:** ![Fluqz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/fluqz/32/6279_2.png) [@Fluqz](https://discourse.threejs.org/u/Fluqz)\
**Post date:** [December 7, 2020, 8:05pm UTC](https://discourse.threejs.org/t/example-contact-shadows-is-blinking-artifacts/21318/7 "2020-12-07T20:05:13Z")

</div>

> <https://github.com/mrdoob/three.js/pull/20849>
