Spot Light Shadow Forward Rendering

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

Normal Point Lights and Directional Lights still properly cast shadows.

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?

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.

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

also seeing this

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)

Make it a great day

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);

Confirming that this fix works. Thanks.

This really saved us, thank you so much! :smiley: