# UE5.4 (and 5.4.1) shadows are broken in VR (VR Template, default settings)

**URL:** <https://forums.unrealengine.com/t/ue5-4-and-5-4-1-shadows-are-broken-in-vr-vr-template-default-settings/1841528>\
**Category:** Issues and Bug Reporting\
**Tags:** unreal-engine, bug-report\
**Created:** [May 5, 2024, 4:54pm UTC](https://forums.unrealengine.com/t/ue5-4-and-5-4-1-shadows-are-broken-in-vr-vr-template-default-settings/1841528 "2024-05-05T16:54:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![oshevoshev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@oshevoshev](https://forums.unrealengine.com/u/oshevoshev)\
**Post date:** [May 5, 2024, 4:54pm UTC](https://forums.unrealengine.com/t/ue5-4-and-5-4-1-shadows-are-broken-in-vr-vr-template-default-settings/1841528/1 "2024-05-05T16:54:55Z")

</div>

### Please select what you are reporting on:

Creative

### What Type of Bug are you experiencing?

Other

### Summary

I noticed this problem first in my project after I migrated to UE5.4. The shadows from objects were all broken. They are semi-transparent, distorted and jump all over the place when I turn my head. I then tried to create a project with VR Template from scratch and got the same result. We are talking about default rendering settings: Forward Shader, Virtual Shadow Maps, Lumen, Nanite. On top of that Niagara particles experience the same issue (e.g., rain or snow from Ultra Dynamic Sky).

### Steps to Reproduce

Create a VR Template and run it in VR Preview on PC (Meta Quest Link, Quest 3 if it makes any difference).

### Expected Result

Hands and objects cast correct clearly visible shadows.

### Observed Result

Shadows from hands and objects jump around, semi-transparent, and distorted.

### Platform(s)

Windows 11

### Additional Notes

I’m on NVIDIA GeForce RTX 3080. I re-tested, I don’t experience these shadow issues on UE 5.3.2, neither in my project, nor in VR Template.

---

<div class="post-metadata">

**Author:** ![HH\_Hidden\_HH](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hh_hidden_hh/32/935904_2.png) [@HH\_Hidden\_HH](https://forums.unrealengine.com/u/HH_Hidden_HH)\
**Post date:** [May 8, 2024, 3:41pm UTC](https://forums.unrealengine.com/t/ue5-4-and-5-4-1-shadows-are-broken-in-vr-vr-template-default-settings/1841528/2 "2024-05-08T15:41:13Z")

</div>

Bro, u are not alone!!!  
I have the same issue. Looks like the dynamic light is totally broken ☹

---

<div class="post-metadata">

**Author:** ![Kavan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kavan/32/1194623_2.png) [@Kavan](https://forums.unrealengine.com/u/Kavan)\
**Post date:** [May 8, 2024, 10:53pm UTC](https://forums.unrealengine.com/t/ue5-4-and-5-4-1-shadows-are-broken-in-vr-vr-template-default-settings/1841528/3 "2024-05-08T22:53:13Z")

</div>

Same, glad it’s not just me having this issue.

Unreal 5.4 (launcher build), default VRTemplate. I’m getting some odd shadow artifacting when running VRPreview (Quest3). Image attached.

 ![Screenshot_2024-04-23_22.08.26](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/9/2/39286333c4ad7559c26c6903875ebb4728229a8d.png)

---

<div class="post-metadata">

**Author:** ![HH\_Hidden\_HH](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hh_hidden_hh/32/935904_2.png) [@HH\_Hidden\_HH](https://forums.unrealengine.com/u/HH_Hidden_HH)\
**Post date:** [May 11, 2024, 8:04am UTC](https://forums.unrealengine.com/t/ue5-4-and-5-4-1-shadows-are-broken-in-vr-vr-template-default-settings/1841528/4 "2024-05-11T08:04:41Z")

</div>

I have found a fix on the UE github repository([commit](https://github.com/EpicGames/UnrealEngine/commit/38b1ce227a5011796b9e0ad8daa3556991bc95e8)). You can temporary update the lines in the file until devs release the update.

**Old**  
**File:** _Engine/Shaders/Private/ShadowProjectionPixelShader.usf_

```auto
float4 ShadowPosition = float4(0, 0, 0, 0);

#if MOBILE_MULTI_VIEW || INSTANCED_STEREO
	ShadowPosition = mul(ScreenPosition, ResolvedView.MobileMultiviewShadowTransform);
	ShadowPosition = mul(ShadowPosition, ScreenToShadowMatrix);
#else

```

**New**  
**File:** _Engine/Shaders/Private/ShadowProjectionPixelShader.usf_

```auto
float4 ShadowPosition = float4(0, 0, 0, 0);

#if ((MOBILE_MULTI_VIEW || INSTANCED_STEREO) && SHADING_PATH_MOBILE)
	ShadowPosition = mul(ScreenPosition, ResolvedView.MobileMultiviewShadowTransform);
	ShadowPosition = mul(ShadowPosition, ScreenToShadowMatrix);
#else

```

Commit also include changes in the _Engine/Source/Runtime/Renderer/Private/SceneVisibility.cpp_ but for the temporal fix you can skip them(unlees you want to recompile the engine).

**File:** _Engine/Source/Runtime/Renderer/Private/SceneVisibility.cpp_  
**Function:** _void FDeferredShadingSceneRenderer::BeginInitViews_

```auto
// Create GPU-side representation of the view for instance culling.
	InstanceCullingManager.AllocateViews(Views.Num());
	for (int32 ViewIndex = 0; ViewIndex < Views.Num(); ++ViewIndex)
	{
		Views[ViewIndex].GPUSceneViewId = InstanceCullingManager.RegisterView(Views[ViewIndex]);

		uint32 InstanceFactor = Views[ViewIndex].GetStereoPassInstanceFactor();
		Views[ViewIndex].InstanceFactor = InstanceFactor > 0 ? InstanceFactor : 1;
	}

```

---

<div class="post-metadata">

**Author:** ![oshevoshev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@oshevoshev](https://forums.unrealengine.com/u/oshevoshev)\
**Post date:** [May 16, 2024, 1:59pm UTC](https://forums.unrealengine.com/t/ue5-4-and-5-4-1-shadows-are-broken-in-vr-vr-template-default-settings/1841528/5 "2024-05-16T13:59:36Z")

</div>

Thank you so much! It’s good to know that I’m not alone and the bug can be fixed. I’m a bit cautious to go back to 5.4, though. 😃 I also saw some reports that the performance is compromised, although I didn’t notice it. I wonder if it is, when you fix the shadows.

---

<div class="post-metadata">

**Author:** ![hobysm](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hobysm](https://forums.unrealengine.com/u/hobysm)\
**Post date:** [May 29, 2024, 1:02pm UTC](https://forums.unrealengine.com/t/ue5-4-and-5-4-1-shadows-are-broken-in-vr-vr-template-default-settings/1841528/6 "2024-05-29T13:02:12Z")

</div>

If this is a fix then how long before it appears in the actual release?

---

<div class="post-metadata">

**Author:** ![Xzesstool](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xzesstool](https://forums.unrealengine.com/u/Xzesstool)\
**Post date:** [June 6, 2024, 12:09am UTC](https://forums.unrealengine.com/t/ue5-4-and-5-4-1-shadows-are-broken-in-vr-vr-template-default-settings/1841528/7 "2024-06-06T00:09:23Z")

</div>

Thanks, you saved me some millions of neurons I was spending trying to find a solution to the weird lighting. 2 weeks searching.  
This bug also affects every type of light! static stationary shadow map and virtual shadow map, not with lumen.  
It should be advised.  
Thanks!

---

<div class="post-metadata">

**Author:** ![Kavan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/kavan/32/1194623_2.png) [@Kavan](https://forums.unrealengine.com/u/Kavan)\
**Post date:** [June 7, 2024, 2:12am UTC](https://forums.unrealengine.com/t/ue5-4-and-5-4-1-shadows-are-broken-in-vr-vr-template-default-settings/1841528/8 "2024-06-07T02:12:14Z")

</div>

5.4.2 hotfix doesn’t fix it.

Quest 3 VR preview:  
I don’t see the shadow artifacts in the right eye but it does appear in the left eye. I no longer have 5.4.1 to test if it was just a one eye issue there as well.

---

<div class="post-metadata">

**Author:** ![Mr\_TeeF](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mr\_TeeF](https://forums.unrealengine.com/u/Mr_TeeF)\
**Post date:** [June 7, 2024, 1:04pm UTC](https://forums.unrealengine.com/t/ue5-4-and-5-4-1-shadows-are-broken-in-vr-vr-template-default-settings/1841528/9 "2024-06-07T13:04:41Z")

</div>

> [@HH\_Hidden\_HH](#):
>
> **New**  
> **File:** _Engine/Shaders/Private/ShadowProjectionPixelShader.usf_
> 
> ```auto
> float4 ShadowPosition = float4(0, 0, 0, 0);
> 
> #if ((MOBILE_MULTI_VIEW || INSTANCED_STEREO) && SHADING_PATH_MOBILE)
> ShadowPosition = mul(ScreenPosition, ResolvedView.MobileMultiviewShadowTransform);
> ShadowPosition = mul(ShadowPosition, ScreenToShadowMatrix);
> #else
> 
> ```

They have implemented this change in 5.4.2 but my left eye shadows is still gliching.

---

<div class="post-metadata">

**Author:** ![EngyBenjie](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EngyBenjie](https://forums.unrealengine.com/u/EngyBenjie)\
**Post date:** [June 18, 2024, 8:54pm UTC](https://forums.unrealengine.com/t/ue5-4-and-5-4-1-shadows-are-broken-in-vr-vr-template-default-settings/1841528/10 "2024-06-18T20:54:06Z")

</div>

I can also confirm that 5.4.2 still has this issue. I am experiencing broken shadows in the left eye and performance issues. This is with a Quest 3 and 4080.

---

<div class="post-metadata">

**Author:** ![AxSoler](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/axsoler/32/250446_2.png) [@AxSoler](https://forums.unrealengine.com/u/AxSoler)\
**Post date:** [June 19, 2024, 2:39pm UTC](https://forums.unrealengine.com/t/ue5-4-and-5-4-1-shadows-are-broken-in-vr-vr-template-default-settings/1841528/11 "2024-06-19T14:39:44Z")

</div>

Same Here. Left eye artifacts with VR Template. 5.4.2, Quest 3, 4090 (laptop), works fine with VRTemplate in 5.3.2 😢

---

<div class="post-metadata">

**Author:** ![Ysgrathe](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ysgrathe/32/740512_2.png) [@Ysgrathe](https://forums.unrealengine.com/u/Ysgrathe)\
**Post date:** [June 19, 2024, 5:28pm UTC](https://forums.unrealengine.com/t/ue5-4-and-5-4-1-shadows-are-broken-in-vr-vr-template-default-settings/1841528/12 "2024-06-19T17:28:15Z")

</div>

As far as I can tell this is a 100% lumen/shadows issue.  
If you have light sources which produce shadows, you will probably get vastly different shadow rendering per eye; either shadows in one and not in the other, soft shadows in one and hard shadows in the other, or any flickering nausea inducing combination of these things.

Disable ‘casts shadows’ for the lights, and the problem goes away (along with all your shadows of course!)

---

<div class="post-metadata">

**Author:** ![Tahun](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tahun](https://forums.unrealengine.com/u/Tahun)\
**Post date:** [June 21, 2024, 8:29pm UTC](https://forums.unrealengine.com/t/ue5-4-and-5-4-1-shadows-are-broken-in-vr-vr-template-default-settings/1841528/13 "2024-06-21T20:29:05Z")

</div>

5.4.2 , dynamic shadows are still broken on the left eye !

---

<div class="post-metadata">

**Author:** ![Uno1982](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/uno1982/32/982436_2.png) [@Uno1982](https://forums.unrealengine.com/u/Uno1982)\
**Post date:** [June 22, 2024, 12:38pm UTC](https://forums.unrealengine.com/t/ue5-4-and-5-4-1-shadows-are-broken-in-vr-vr-template-default-settings/1841528/14 "2024-06-22T12:38:51Z")

</div>

Hey guys … looks like there were a few other changes that snuck into UE5.4.2 hotifix after I posted the UE5.4.1 fix. The below shader fix only fixed UE5.4.1.

[UE5.4 & UE5.4.1 - Dynamic Shadow Bug Fix (Forward, Mobile, Deferred CSM) (youtube.com)](https://www.youtube.com/watch?v=6H3fQThlon0)

If you’ve updated to UE5.4.2 you’ll need the below fix which is multiple shader file replacements.  
UE5.4.2 Launcher fix. (Replace the shader folder in Epic Games/UE\_5.4/Engine/  
[Shaders.zip](https://forums.unrealengine.com/uploads/short-url/uCoRP7QxtVhS0Gfy7v0Dlfybcq3.zip) (2.7 MB)

☝ This should handle mutli-view for mobile as well but I’ve yet to be able to test quest standalone just yet. I also see this should be making it into another hotfix (UE.5.4.3) you can work around this issue by disabling instanced stereo until 5.4.3 releases if you rather not manually patch your shaders

---

<div class="post-metadata">

**Author:** ![Larathedev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Larathedev](https://forums.unrealengine.com/u/Larathedev)\
**Post date:** [June 22, 2024, 7:15pm UTC](https://forums.unrealengine.com/t/ue5-4-and-5-4-1-shadows-are-broken-in-vr-vr-template-default-settings/1841528/15 "2024-06-22T19:15:56Z")

</div>

Tried this fix, but now the engine is crashing with a shader compilation error ☹

---

<div class="post-metadata">

**Author:** ![Uno1982](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/uno1982/32/982436_2.png) [@Uno1982](https://forums.unrealengine.com/u/Uno1982)\
**Post date:** [June 23, 2024, 5:51am UTC](https://forums.unrealengine.com/t/ue5-4-and-5-4-1-shadows-are-broken-in-vr-vr-template-default-settings/1841528/16 "2024-06-23T05:51:58Z")

</div>

This can only be applied to ue5.4.2 …. If it still isn’t working properly you can delete the shaders folder and validate the install from launcher to return the default shaders. I’m currently using without issues. Are you on windows and are you validating that the shaders are extracted into the proper directory? "yourinstall directory/Epic Games/UE\_5.4/Engine/Shaders should actually contain the extracted files so be sure its not Shaders/Shaders/Files by mistake.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/c/1/2c112045e6c0ca160681509a107d516414ddb813.png)

The shader changes are actually part of the upcoming ue5.4.3 and I’ve only manually zipped the changes from this PR. To help others quickly patch without manually changing each or needing git

[https://github.com/EpicGames/UnrealEngine/commit/2e67c280d893e48489a9ff06c5f59333a6e558a1#diff-047e1b4c14823015a18a29e9b59b177902abf73f7554d0006eb1a0dccb1a8519](https://github.com/EpicGames/UnrealEngine/commit/2e67c280d893e48489a9ff06c5f59333a6e558a1#diff-047e1b4c14823015a18a29e9b59b177902abf73f7554d0006eb1a0dccb1a8519)

I’m sorry you having issues but they are working for me. I’ll clear my shader directory download from my upload and see if I can repo your outcome. (did this step this morning to validate)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/4/3/b435322a0a5b5408842781f4980d0263db61b75e.jpeg)

---

<div class="post-metadata">

**Author:** ![Ysgrathe](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ysgrathe/32/740512_2.png) [@Ysgrathe](https://forums.unrealengine.com/u/Ysgrathe)\
**Post date:** [June 23, 2024, 2:51pm UTC](https://forums.unrealengine.com/t/ue5-4-and-5-4-1-shadows-are-broken-in-vr-vr-template-default-settings/1841528/17 "2024-06-23T14:51:10Z")

</div>

The simplest way is to rename the original ‘Shaders’ directory in-place as something like ‘Shaders\_OLD’, and just copy the new one into the Engines/UE\_5.4/Engine folder.

Doing that, I personally have no crashing or compilation errors.  
After doing so, I rebuilt my entire project… just ‘because’  
I went into a level that had known shadowing issues, and reenabled ‘cast shadows’ on the lighting.

NO CHANGES! 😒

Still the same glitching, solid hard shadows with one eyes, soft edged shadows with the other, and general flicking all over the place.

So… certainly not a fix for me. And if this is the fix from the upcoming 5.4.3, then it looks like its still gonna be bugged for some time to come 😭

---

<div class="post-metadata">

**Author:** ![EngyBenjie](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EngyBenjie](https://forums.unrealengine.com/u/EngyBenjie)\
**Post date:** [June 24, 2024, 12:00pm UTC](https://forums.unrealengine.com/t/ue5-4-and-5-4-1-shadows-are-broken-in-vr-vr-template-default-settings/1841528/18 "2024-06-24T12:00:40Z")

</div>

I’ve just tested with the shaders posted above and it appears to have fixed the issue for me. I’m not seeing any glitched shadows in the VR Template. I still need to test it with my main project.

---

<div class="post-metadata">

**Author:** ![VitLiskutin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@VitLiskutin](https://forums.unrealengine.com/u/VitLiskutin)\
**Post date:** [June 26, 2024, 4:59pm UTC](https://forums.unrealengine.com/t/ue5-4-and-5-4-1-shadows-are-broken-in-vr-vr-template-default-settings/1841528/19 "2024-06-26T16:59:21Z")

</div>

Applied the Shader replacing approach and still not rid of the problem. Me left eye shadows flicker like crazy on and off in VR. Right eye is just fine.

---

<div class="post-metadata">

**Author:** ![BreakMaker](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/breakmaker/32/971651_2.png) [@BreakMaker](https://forums.unrealengine.com/u/BreakMaker)\
**Post date:** [June 26, 2024, 7:30pm UTC](https://forums.unrealengine.com/t/ue5-4-and-5-4-1-shadows-are-broken-in-vr-vr-template-default-settings/1841528/20 "2024-06-26T19:30:55Z")

</div>

I second that shadow casting is broken in 5.4.2 For me it feels like it only affects one eye. Waiting for 5.4.3

[Next page](https://forums.unrealengine.com/t/ue5-4-and-5-4-1-shadows-are-broken-in-vr-vr-template-default-settings/1841528.md?page=2)
