Forum Discussion
Dr_Evanzan
8 years agoHonored Guest
IsMatrixValid Assertion Failed with Per Eye Cameras enabled on certain Unity/OVRPlugin combinations
With 'Use Per Eye Cameras' enabled on the OVRCameraRig, I am receiving multiple errors in Unity of the form:
Assertion failed: Assertion failed on expression: 'IsMatrixValid(matrix)'
It's unclear how detrimental this is - it has no obvious negative effect in game - so I have been mostly ignoring it but, when manifesting, it can result in hundreds of error messages appearing in the log over a couple of minutes.
The issue seems to be tied to certain Unity/OVRPlugin combinations but is not being resolved with the latest versions - so may be a recurring bug?
Originally the problem was with my project in Unity v5.6.1f1 with Oculus Utilities v1.15.0 and OVRPlugin v1.14.1 enabled.
Upgrading to Unity v5.6.3f1 (but still with Oculus Utilities v1.15.0 and OVRPlugin v1.14.1 enabled) the issue no longer appears.
However, upgrading to the latest 2017 versions of Unity and the more recent Oculus Utilities sees the issue reappear.
After various testing, it seems that the issue does not appear for the latest Unity versions of each branch when running with OVRPlugin v1.14.0 or v1.14.1 but does appear for newer versions of the OVRPlugin.
It is not just a case of OVRPlugin version in isolation of Unity version - OVRPlugin v1.14.1 did not work correctly with my earlier Unity v5.6.1f1 (where I originally noticed the problem).
It is also not a case of the issue appearing when using the latest DLL from Oculus Utilities to override the default DLL included in Unity - the issue does not appear with the latest Unity versions which incorporate OVRPlugin v1.14.0 as default when you override such versions to v1.14.1 and yet using the default OVRPlugin version with Unity v5.6.1f1 did not resolve the issue.
The issue appears in my prototype project where I have been using the Per Eye Cameras option but is easy to replicate in a clean project:
1) Create a new project in Unity and import any given version of Oculus Utilities
2) Create a new scene and replace the Main Camera with the OVRCameraRig, then enable 'Use Per Eye Cameras' setting on the OVRCameraRig script.
3) Create a Cube (or similar geometry, I also tested with Quads) in the scene
4) Run the scene, on the versions specified below as manifesting the issue you should see the error in the console whenever you look at the Cube in VR (it does not appear if you never actually see the Cube or if 'Use Per Eye Cameras' is disabled).
The issue DOES NOT appear in the following Unity/OVRPlugin combinations:
Unity v5.6.3f1, Oculus Utilities v1.15.0, OVRPlugin v1.14.0 (builtin), SDK v1.18.0.
Unity v5.6.3f1, Oculus Utilities v1.15.0, OVRPlugin v1.14.1, SDK v1.18.0.
Unity v2017.1.1f1, Oculus Utilities v1.15.0, OVRPlugin v1.14.1, SDK v1.18.0.
Unity v2017.1.1f1, Oculus Utilities v1.18.1, OVRPlugin v1.14.0 (builtin), SDK v1.18.0.
Unity v2017.2.0f1, Oculus Utilities v1.15.0, OVRPlugin v1.14.1, SDK v1.18.0.
Unity v2017.2.0f1, Oculus Utilities v1.18.1, OVRPlugin v1.14.1 (builtin), SDK v1.18.0.
The issue DOES appear in the following Unity/OVRPlugin combinations:
Unity v5.6.1f1, Oculus Utilities v1.15.0, OVRPlugin v1.14.0 (I think this was the builtin version?), SDK v1.18.0.
Unity v5.6.1f1, Oculus Utilities v1.15.0, OVRPlugin v1.14.1, SDK v1.18.0.
Unity v2017.1.1f1, Oculus Utilities v1.16.0, OVRPlugin v1.16.0, SDK v1.18.0.
Unity v2017.1.1f1, Oculus Utilities v1.18.0, OVRPlugin v1.18.0, SDK v1.18.0.
Unity v2017.1.1f1, Oculus Utilities v1.18.1, OVRPlugin v1.18.1, SDK v1.18.0.
Unity v2017.2.0f1, Oculus Utilities v1.18.1, OVRPlugin v1.18.1, SDK v1.18.0.
As a minor aside, which may or may not be important, in my own prototype project I have a setup where I manipulate the camera rig (using Per Eye Cameras) between first and third person perspective.
In versions above marked as the issue appearing, I get many errors on an immediate and ongoing basis in either perspective.
In Unity v5.6.3f1 with OVRPlugin version marked as issue not appearing, I did not receive ANY assertion errors at any point.
However, in Unity v2017.1.1f1 and Unity v2017.2.0f1 with OVRPlugin marked as issue not appearing, I receive a single assertion error the first time I switch from first person perspective to third person perspective but do not receive any further such errors, even when switching back and forth between perspectives.
So Unity 2017 versions function slightly differently to Unity v5.6.3.
Assertion failed: Assertion failed on expression: 'IsMatrixValid(matrix)'
It's unclear how detrimental this is - it has no obvious negative effect in game - so I have been mostly ignoring it but, when manifesting, it can result in hundreds of error messages appearing in the log over a couple of minutes.
The issue seems to be tied to certain Unity/OVRPlugin combinations but is not being resolved with the latest versions - so may be a recurring bug?
Originally the problem was with my project in Unity v5.6.1f1 with Oculus Utilities v1.15.0 and OVRPlugin v1.14.1 enabled.
Upgrading to Unity v5.6.3f1 (but still with Oculus Utilities v1.15.0 and OVRPlugin v1.14.1 enabled) the issue no longer appears.
However, upgrading to the latest 2017 versions of Unity and the more recent Oculus Utilities sees the issue reappear.
After various testing, it seems that the issue does not appear for the latest Unity versions of each branch when running with OVRPlugin v1.14.0 or v1.14.1 but does appear for newer versions of the OVRPlugin.
It is not just a case of OVRPlugin version in isolation of Unity version - OVRPlugin v1.14.1 did not work correctly with my earlier Unity v5.6.1f1 (where I originally noticed the problem).
It is also not a case of the issue appearing when using the latest DLL from Oculus Utilities to override the default DLL included in Unity - the issue does not appear with the latest Unity versions which incorporate OVRPlugin v1.14.0 as default when you override such versions to v1.14.1 and yet using the default OVRPlugin version with Unity v5.6.1f1 did not resolve the issue.
The issue appears in my prototype project where I have been using the Per Eye Cameras option but is easy to replicate in a clean project:
1) Create a new project in Unity and import any given version of Oculus Utilities
2) Create a new scene and replace the Main Camera with the OVRCameraRig, then enable 'Use Per Eye Cameras' setting on the OVRCameraRig script.
3) Create a Cube (or similar geometry, I also tested with Quads) in the scene
4) Run the scene, on the versions specified below as manifesting the issue you should see the error in the console whenever you look at the Cube in VR (it does not appear if you never actually see the Cube or if 'Use Per Eye Cameras' is disabled).
The issue DOES NOT appear in the following Unity/OVRPlugin combinations:
Unity v5.6.3f1, Oculus Utilities v1.15.0, OVRPlugin v1.14.0 (builtin), SDK v1.18.0.
Unity v5.6.3f1, Oculus Utilities v1.15.0, OVRPlugin v1.14.1, SDK v1.18.0.
Unity v2017.1.1f1, Oculus Utilities v1.15.0, OVRPlugin v1.14.1, SDK v1.18.0.
Unity v2017.1.1f1, Oculus Utilities v1.18.1, OVRPlugin v1.14.0 (builtin), SDK v1.18.0.
Unity v2017.2.0f1, Oculus Utilities v1.15.0, OVRPlugin v1.14.1, SDK v1.18.0.
Unity v2017.2.0f1, Oculus Utilities v1.18.1, OVRPlugin v1.14.1 (builtin), SDK v1.18.0.
The issue DOES appear in the following Unity/OVRPlugin combinations:
Unity v5.6.1f1, Oculus Utilities v1.15.0, OVRPlugin v1.14.0 (I think this was the builtin version?), SDK v1.18.0.
Unity v5.6.1f1, Oculus Utilities v1.15.0, OVRPlugin v1.14.1, SDK v1.18.0.
Unity v2017.1.1f1, Oculus Utilities v1.16.0, OVRPlugin v1.16.0, SDK v1.18.0.
Unity v2017.1.1f1, Oculus Utilities v1.18.0, OVRPlugin v1.18.0, SDK v1.18.0.
Unity v2017.1.1f1, Oculus Utilities v1.18.1, OVRPlugin v1.18.1, SDK v1.18.0.
Unity v2017.2.0f1, Oculus Utilities v1.18.1, OVRPlugin v1.18.1, SDK v1.18.0.
As a minor aside, which may or may not be important, in my own prototype project I have a setup where I manipulate the camera rig (using Per Eye Cameras) between first and third person perspective.
In versions above marked as the issue appearing, I get many errors on an immediate and ongoing basis in either perspective.
In Unity v5.6.3f1 with OVRPlugin version marked as issue not appearing, I did not receive ANY assertion errors at any point.
However, in Unity v2017.1.1f1 and Unity v2017.2.0f1 with OVRPlugin marked as issue not appearing, I receive a single assertion error the first time I switch from first person perspective to third person perspective but do not receive any further such errors, even when switching back and forth between perspectives.
So Unity 2017 versions function slightly differently to Unity v5.6.3.
2 Replies
Replies have been turned off for this discussion
- Dr_EvanzanHonored GuestThanks for your reply.
You can recreate the problem/minimal project by just importing Oculus Utilities into a new project and setting up a scene as described in the original post.
Further to my initial post, I just noticed today that the problem seems to have something to do with the material assigned to objects - hence the basic Oculus Framework Project 'Per Eye' scenes don't give the error as their objects have materials with a Mobile shader while creating a basic Unity Cube adds one with the Default Material with the standard shader which will cause the assert failure. - Dr_EvanzanHonored GuestUnity 2017.2.0f2 has just gone live and seems to resolve this issue, at least for OVRPlugin 1.18.1.
The release notes refer to this item in their issue tracker:
https://issuetracker.unity3d.com/issues/vr-two-cameras-in-vr-mode-spam-console-w-slash-assertion-failed-on-expression-ismatrixvalid-matrix
This issue notes that it happens "as long as there is an shadow-casting in view. disabling shadows or shadow casting from objects solves this issue". Which is probably what I was noticing about materials.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 6 months ago