I’m getting an issue (reproduced by 2 other devs on 2 other projects) where if I have a project with the SteamVR plugin in, I get the error “GL.End requires material.SetPass before!” spammed to the console and the scene’s image is quite blurry.
I disabled the SteamVR cam, dropped in a basic Unity camera to use native Unity VR support and the the error and blurry image went away.
Any ideas what might be causing this / potential fixes?
I ran into the same issue. It seems to be an issue with the camera’s CameraClearFlags, setting it to
CameraClearFlags.Nothing produces the error. Whenever certain steamvr components are used a [SteamVR] gameobject will be instantiated with a poseUpdater sub object that contains a SteamVR_UpdatePoses component.
In the SteamVR_UpdatePoses Awake method it creates a new camera and sets it’s clear flags to CameraClearFlags.Nothing. So just comment it out of the SteamVR_UpdatePoses Awakes method e.g.:
Changing the clear flags of the camera fixes the crash, but I also noticed that the camera wasn’t using MSAA. removing the camera that gets instantiated in SteamVR_UpdatePoses Awake method stops Unity from rendering with this camera. Everything else seems to work fine without it and i couldn’t find any references to it so it should be safe to remove.
Yes I experienced the same thing. I had upgraded to 5.6 so I could (hopefully) work again. With my 5.5f3 project Unity has decided to hang every 3 minutes or so. It’s not crashing…just hanging. I’m not sure how to troubleshoot this.
sgsrules, your suggestion gets ride of the error message, but at least for me, the image is still very blurry and low-resolution. Everything is very blocky looking as if it’s only rendering things at 1/8th of the normal resolution. It seems that 5.6 has a few different issues with SteamVR.
That’s because it’s rendering using the new camera it generated. I managed to get everything working using my regular camera with all it’s scripts by doing the following:
in SteamVR_Render.cs Update Method remove or comment out the following (lines 319-324) :
if (poseUpdater == null)
{
var go = new GameObject("poseUpdater");
go.transform.parent = transform;
poseUpdater = go.AddComponent<SteamVR_UpdatePoses>();
}
in SteamVR_UpdatePoses.cs remove the Awake method:
Add a SteamVR_UpdatePoses component to your main camera.
Steps 1 and 2 will prevent SteamVR from creating the extra dummy camera that it defaults to for some reason. Step 3 adds a necessary component so that the controllers and HMD are properly tracked.
I’m not sure if i should fill out a bug report for this issue since it affects SteamVR.
@sgsrules : In the most recent version of SteamVR on the asset store, version 1.1.1 from July 28, 2016, the part you say is in SteamVR_Settings.cs is actually in SteamVR_Render.cs. Are you on a different version, or did you actually mean SteamVR_Render.cs?
@sgsrules Thanks! This solution worked perfectly. It’s important to note that step 3’s main camera is the “Camera (eye)” in my case because I’m using the example VRTK + Steam VR set up. Not sure if anyone is using their own set up. But thought I’d share just in case.
I got around to trying this again, and it did clear up the low-resolution error. But:
The camera is now not rendering things closer than 1.5 from the camera (I understand this is configurable, but an upgrade shouldn’t cause the camera to behave differently)
I just tried these changes with a new Unity project, imported the SteamVR package, opened the example scene. It didn’t work until I made the changes above.
However, I’m not seeing the Oculus Touch. They appear, and I can see all the buttons, and even see a few moving that I can see directly, but the controllers don’t move or rotate in tracked space. Any ideas?
I tried sgsrules’ solution for 5.6 and it kind of worked, but in the throw-object-example-scene one controller is weirdly displaced…
EDIT:Nevermind, the same bug is in 5.5 without me changing anything in SteamVR
I gather from this thread that support is coming, but the github repo also mentioned there didn’t work for me.