# Hide line from Shadow

**URL:** <https://discourse.threejs.org/t/hide-line-from-shadow/53656>\
**Category:** Questions\
**Tags:** shadows\
**Created:** [July 9, 2023, 12:31pm UTC](https://discourse.threejs.org/t/hide-line-from-shadow/53656 "2023-07-09T12:31:56Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![trusktr](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/trusktr/32/13726_2.png) [@trusktr](https://discourse.threejs.org/u/trusktr)\
**Post date:** [January 10, 2026, 11:11am UTC](https://discourse.threejs.org/t/hide-line-from-shadow/53656/12 "2026-01-10T11:11:38Z")

</div>

In that particular example, the bias solution worked ok because the balls are not touching the shadow surface. I you have a more complex shadow, and apply bias to remove the shadow map outline (which I think is [a bug](https://github.com/mrdoob/three.js/issues/32708)) it could push the object shadows too far back, like in this example:

> [@Shadow banding with WebGPURenderer VSMShadowMap](https://discourse.threejs.org/t/shadow-banding-with-webgpurenderer-vsmshadowmap/89017/3):
>
> However there’s still a “shadow” at the edge to the shadow map that I’m not sure how to get rid of: (other lines are light/camera helpers) How do we get rid of that edge-of-shadow-map artifact? Turning down the resolution from 1024 to 512 (and adjusting blur/samples to get a desired shadow), I can now see three edges of the shadow map: How do we get rid of those? EDIT: same problem here: [Hide line from Shadow - …](https://discourse.threejs.org/t/hide-line-from-shadow/53656/10)

With `WebGPURenderer`, here’s the patch I used to fix that example, removing any shadow around the edges of the shadow map area to avoid using bias tweaking as the solution:

```js
			const originalSetupShadowFilter = THREE.ShadowNode.prototype.setupShadowFilter;

			THREE.ShadowNode.prototype.setupShadowFilter = function ( builder, inputs ) {

				// portion of shadow map UV space along edges to fade
				const fadePortion = 0.05;

				const base = originalSetupShadowFilter.call( this, builder, inputs );
				const uv = inputs.shadowCoord.xy;

				// Distance to nearest edge of the shadow UV box
				const edgeDist = min( min( uv.x, uv.x.oneMinus() ), min( uv.y, uv.y.oneMinus() ) );

				// Fade: 1 at the very edge, 0 inside (only if in a shadow)
				const fade = sub( 1, smoothstep( 0, fadePortion, edgeDist ) );
				return mix( base, 1, fade );

			};

```

---

_[View the full topic](https://discourse.threejs.org/t/hide-line-from-shadow/53656)._
