# Spot Light Shadow Forward Rendering

**URL:** <https://forums.unrealengine.com/t/spot-light-shadow-forward-rendering/402363>\
**Category:** Rendering\
**Tags:** Shadows, Forward-Rendering, unreal-engine, Lighting, question\
**Created:** [August 20, 2017, 7:25pm UTC](https://forums.unrealengine.com/t/spot-light-shadow-forward-rendering/402363 "2017-08-20T19:25:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![OpticalShadows](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@OpticalShadows](https://forums.unrealengine.com/u/OpticalShadows)\
**Post date:** [August 20, 2017, 7:25pm UTC](https://forums.unrealengine.com/t/spot-light-shadow-forward-rendering/402363/1 "2017-08-20T19:25:22Z")

</div>

I have run into a shadowing bug when using a Spot Light with the Forward Renderer. It seems like its casting the shadow however it will only appear when the camera is very close and won’t show the entire shadow. I’ve linked a video to better demonstrate the problem. I’ve also tried this on a brand new blank project and the issue persists.

[Video](https://www.youtube.com/watch?v=csn2-3jaKYU&feature=youtu.be)

Normal Point Lights and Directional Lights still properly cast shadows.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [August 23, 2017, 8:10pm UTC](https://forums.unrealengine.com/t/spot-light-shadow-forward-rendering/402363/2 "2017-08-23T20:10:56Z")

</div>

Hello ,

I noticed that you said you were able to get this issue to occur in a new blank project. Could you provide a detailed list of steps to reproduce this issue on our end?

---

<div class="post-metadata">

**Author:** ![VICOGameStudio](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@VICOGameStudio](https://forums.unrealengine.com/u/VICOGameStudio)\
**Post date:** [August 25, 2017, 2:46pm UTC](https://forums.unrealengine.com/t/spot-light-shadow-forward-rendering/402363/3 "2017-08-25T14:46:47Z")

</div>

Hi Rudy,

We are seeing the same issue in our project as well. And simply adding a Spotlight with Shadow casting to the scene is sufficient to see the bug. Obviously, make sure that Forward Rendering is enabled.

---

<div class="post-metadata">

**Author:** ![OpticalShadows](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@OpticalShadows](https://forums.unrealengine.com/u/OpticalShadows)\
**Post date:** [August 25, 2017, 3:31pm UTC](https://forums.unrealengine.com/t/spot-light-shadow-forward-rendering/402363/4 "2017-08-25T15:31:27Z")

</div>

VICO Is correct. All I did was add a spot light with shadows to a scene with Forward Shading enabled. I can confirm that this only happens with 4.17 and is not present in 4.16

---

<div class="post-metadata">

**Author:** ![broccula](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@broccula](https://forums.unrealengine.com/u/broccula)\
**Post date:** [September 6, 2017, 12:25am UTC](https://forums.unrealengine.com/t/spot-light-shadow-forward-rendering/402363/5 "2017-09-06T00:25:06Z")

</div>

also seeing this

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [September 6, 2017, 2:58pm UTC](https://forums.unrealengine.com/t/spot-light-shadow-forward-rendering/402363/6 "2017-09-06T14:58:29Z")

</div>

Hello ,

After doing some digging I was able to find that this is a known issue. I have provided a link to the public tracker. Please feel free to use the link provided for future updates.

Link: [Unreal Engine Issues and Bug Tracker (UE-48146)](https://issues.unrealengine.com/issue/UE-48146)

Make it a great day

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_a8ba19bb](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_a8ba19bb](https://forums.unrealengine.com/u/anonymous_user_a8ba19bb)\
**Post date:** [September 7, 2017, 7:06pm UTC](https://forums.unrealengine.com/t/spot-light-shadow-forward-rendering/402363/7 "2017-09-07T19:06:12Z")

</div>

Pretty sure this edit to ShadowProjectionPixelShader.usf (at line 232, as of the 4.17 release in UE4-QA) fixes it:

```
	float4 HomogeneousWorldPosition = mul(float4(ScreenPosition.xy * SceneW, SceneW, 1), View.ScreenToWorld);    

```

becomes

```
	float4 HomogeneousWorldPosition = mul(float4(ScreenPosition.xy, SceneW, 1), View.ScreenToWorld);

```

---

<div class="post-metadata">

**Author:** ![moookiexl](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@moookiexl](https://forums.unrealengine.com/u/moookiexl)\
**Post date:** [September 11, 2017, 1:38pm UTC](https://forums.unrealengine.com/t/spot-light-shadow-forward-rendering/402363/8 "2017-09-11T13:38:18Z")

</div>

Confirming that this fix works. Thanks.

---

<div class="post-metadata">

**Author:** ![miracle7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@miracle7](https://forums.unrealengine.com/u/miracle7)\
**Post date:** [September 12, 2017, 12:44pm UTC](https://forums.unrealengine.com/t/spot-light-shadow-forward-rendering/402363/9 "2017-09-12T12:44:47Z")

</div>

This really saved us, thank you so much! 😃
