Open ccll opened 8 years ago
Hi @ccll, Does this happen on other HMDs, or just the one you are manufacturing? It looks like a far clipping plane issue in Unity. I would narrow in on the differences between the preview camera and the eye cameras. You can set the clipping planes for the eye cameras: https://github.com/OSVR/OSVR-Unity/blob/master/OSVR-Unity/Assets/OSVRUnity/src/DisplayController.cs#L205
Given this information, I don't think there's an issue with the rendering plugin or config files. It's probably something in Unity.
@DuFF14 I've found out how to reproduce this.
I've tested with our own HMD, an Oculus Rift DK2, and a third party Rift DK2 compatible HMD, all 3 HMDs behave the same if center_proj_x
is the same.
0.5/0.5 == NO artifacts values other than 0.5/0.5 (for example 0.51/0.49) == ARTIFACTS!!
Our own HMD has a center_proj_x
approximately at 0.6/0.4, while DK2 is 0.5/0.5, so in previous test the artifacts only show up in our own HMD, until I messed with DK2 settings.
I don't know the internals of COP handling, but I suppose it affects projection matrix, and I recall some articles mentioned that custom projection matrix can break shadows in Unity3D. Is that relevant here?
Aha, thanks for the info. I hadn't heard about that custom projection matrix problem, but it sounds like it could be related. I will look into it..
See https://github.com/OSVR/OSVR-Docs/blob/master/Configuring/projectionAndViewMatrices.md for a description of the OSVR RenderManager transformations. Details of the meanings for center of projection, fields of view, overlap percentage and so forth are in https://github.com/OSVR/OSVR-Docs/blob/master/Configuring/distortion.md and to see how to programmatically set them from a new HMD along with distortion correction, see https://github.com/OSVR/distortionizer/blob/master/angles_to_config/doc/anglesToConfig.md
Just discovered that the shadow artifacts only show up in dynamic lighting, when we bake all lights into static lightmaps there are no artifacts.
@ccll Are you using forward or deferred rendering? Can you test if the other option gives you the same artifacts?
@DuFF14 Confirmed that both forward and deferred rendering produces the artifacts.
We're a VR HMD manufacturer and we've been connected our own headset to the OSVR with a custom plugin. When we use the OSVR-Unity package to develop a demo content, we inspected some shadow artifacts only showing up in the headset.
This image is the preview window in Unity, and there are no artifacts.
The same scene shot through the headset's lens, there are shadows on the cloud.
And even stranger, when the headset pitches up gradually, the shadows disappear one-by-one, as below.
Our server config:
Our display config:
Spec:
i7-4790k NVIDIA GTX970 Windows 7 64bit Unity3D 5.3.1f1 OSVR-Unity-v0.6.8-with-core-v0.6-1186-gacfbf41-build369