- Home /
HDRP + VR not working in 2019.1.0f2?
Hi,
I've been working on a Non-VR + VR game for the past year. It worked great in 2018.3, using the Post-Processing Volume. I decided to update to 2019.1 to make use of the HDRP features, but whenever I try to run the game in VR, I get this error:
IndexOutOfRangeException: Index was outside the bounds of the array.
UnityEngine.Experimental.Rendering.HDPipeline.LightLoop.BuildGPULightListsCommon (UnityEngine.Experimental.Rendering.HDPipeline.HDCamera hdCamera, UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Rendering.RenderTargetIdentifier cameraDepthBufferRT, UnityEngine.Rendering.RenderTargetIdentifier stencilTextureRT, System.Boolean skyEnabled) (at Library/PackageCache/com.unity.render-pipelines.high-definition@5.13.0-preview/Runtime/Lighting/LightLoop/LightLoop.cs:2361)
Which is referencing this code in LightLoop.cs:
for (int eyeIndex = 0; eyeIndex < 2; eyeIndex++)
{
**m_LightListProjMatrices[eyeIndex] = CameraProjectionStereoLHS(hdCamera.camera, (Camera.StereoscopicEye)eyeIndex);**
m_LightListProjscrMatrices[eyeIndex] = temp * m_LightListProjMatrices[eyeIndex];
m_LightListInvProjscrMatrices[eyeIndex] = m_LightListProjscrMatrices[eyeIndex].inverse;
}
(** = the exact line where the error is thrown)
After this, I tried creating a new project and added OpenVR, HDRP and some Post-Processing effects just to test it out, and the same error was being thrown. I removed all the Post-Processing effects and the error still persisted.
Mind you, my Vive is still being tracked as I can see the camera moving around in the Editor Window when I move the Vive, but the Game window is completely black, and the error is thrown at almost (or all?) frames.
Is VR just not compatible with HDRP right now? Can I even go back to using Post-Processing Volumes in 2019.1? (I tried adding one but it was not doing anything, but that might just be because I still had HDRP on). If it's not compatible right now I guess I can just go back to that until things change. Both Non-VR and VR versions of the game run on the same build, so making another build without HDRP is not the solution I am looking for.
Anyone found a fix for this yet if there is one?
Thank you in advance!
Answer by grahamwell · Apr 28, 2019 at 02:15 PM
I had the same problem with the demo project. I've just upgraded it to 2019.2.a013 and updated the HDRP from the package manager. The process itself produced unpleasant bugs, but after a restart, all seems to be working. The black screen and LightLoop messages are gone.
Hi grahamwell, Sorry for the late reply, I've been packing and moving the last few days. That is good to hear! I will try updating to 2019.2.a013 and see how it goes. I'd rather not use unstable versions of Unity, but seeing as we are talking about a preview version of a package, there's not much difference lol, so if it does work out for me, I will keep working on 2019.2.a013 until a new official release is out. I will only be able to test this out in 4 or 5 days, so I will update then. Thank you for your input!
Yep! That did it! Anti-aliasing doesn't seem to be working (it's not mentioned on their list of unsupported features at GitHub though) but other than that, it's working as expected. Thanks!
Answer by JDelekto · Apr 27, 2019 at 04:57 PM
According to the notes for the Scriptable Rendering Pipeline on Github, you can only use Single-Pass Stereo rendering for Unity 2019.1 and 2019.2 with HDRP. Is this perhaps why you are having an issue?
Hi, thanks for the reply. Sorry should have been clear on that, I did check that and Single Pass is active. Plus, it also says it defaults to Single Pass automatically when in VR.
O$$anonymous$$, thank you for clearing that up, wasn't sure if you had anything custom going on not default. I would raise an issue on the Github with a simple example to duplicate in case there is an outstanding bug. You're more likely to get a faster fix.
Thank you for the advice, yeah, I think I will do that!
Your answer
![](https://koobas.hobune.stream/wayback/20220612200321im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
APK Can't be open in Android system microphone 0 Answers
Assertion failed error when using Oculus headset 0 Answers
Unfortunately, "GameName" has stopped. 0 Answers
Cardboard VR's view is not centered 1 Answer