Volumetric clouds in UE 4.26 do not render in VR

Hi there, the Github Links results a 404 error for me

Sorry, I will elaborate on what exactly you have to do.
You can not open the link because you are not logged into Github and do not have access to the Epic Games repositories one of which is the Unreal Engine. But this is easy to fix.

I followed this guide on how to get access and build the Unreal Engine, but you can also read Epics readmes on Git which are pretty good.
I did change a few things. I downloaded the current “4.27.2 release” branch. I copied the changes from the previously linked git commit for UE5 (Fixed sky and cloud not working in split screen (again, I guess somet…) into my downloaded source code. The changes in the commit are:

File 1: Engine/Shaders/Private/SkyAtmosphere.usf

  • Find this line:
    float4 SVPos = float4(UV*View.ViewSizeAndInvSize.xy, 0.0f, 1.0f);// SV_POS as if resolution was the one from the scene view.
  • Change it to:
    float4 SVPos = float4(View.ViewRectMin.xy + UV * View.ViewSizeAndInvSize.xy, 0.0f, 1.0f);// SV_POS as if resolution was the one from the scene view.

File 2: Engine/Source/Runtime/Renderer/Private/VolumetricCloudRendering.cpp

  • Find this line:
    CloudRC.TracingCoordToZbufferCoordScaleBias.Z += ViewInfo.CachedViewUniformShaderParameters->ViewRectMin.X;
  • Change it to:
    CloudRC.TracingCoordToZbufferCoordScaleBias.Z += ViewInfo.CachedViewUniformShaderParameters->ViewRectMin.X / ((VRT.GetMode() == 0 || VRT.GetMode() == 3) ? 2 : 1);

Then I followed the guide video again. I build the Engine (took like an hour), changed my project to use my custom build Engine Version. Upon launching the volumetric clouds work perfectly.

4 Likes

Many thanks, I’ll try and build it then

I did this and verified that it works in UE4.27! Thank you!