I am in the process of putting together an app using the Google Cardboard SDK. The user will be able to use the app with or without cardboard. So, there is a switch button inside the app, that activates and deactivates stereo rendering.
The app also uses the Vuforia SDK to track image targets. If a specific target is recognized, some 3D objects above the target and a particle system starts to emit particles.
Everything works fine in non-stereo mode. Particles are emitted and falling correctly as intended. They should simulate snow. Also if the user turns the image target to an angle, the 3D objects above fall down.
When switching to stereo mode, the physics are messed up completely. The snow particles are not falling anymore, they seem to "teleport" around the screen. Also the 3D objects do fall upwards, with a really heavy negative gravity. Timescale seems multiplied several times, but is not - I double checked that. Gravity also does not change when switching between non-stereo and stereo rendering.
Everything works fine in Unity Editor in moth modes. It only appears on the device, which is an iPhone 5.
Cardboard SDK is version 0.52, which is the newest.
Unity is version 5.3.1.
Vuforia is 5.0.6, which is not the newest, but release notes do not indicate a fix concerning physics. Will update it anyway as a next step.
Vuforia is 5.0.10, which is the latest version.
I double checked gravity and timescale, which are not changing when switching between modes. I have a hard time figuring out what might cause the physics to mess up.
EDIT:
I did some further investigations. I made me a little gizmo sitting always in front of the camera but getting the rotation of the Unity world space axes, so I know the 3D-world is oriented in relation to the camera. And it turns out, that when in VR mode with the Google cardboard camera system, the world does spin around the camera heavily. I managed to hold the test device in a way, so it is slowing down and almost freezing, but I have no explanation for the effect yet.
I managed to get my setup right again. Unfortunately I did not find the source of the weird behavior. But By deleting the Vuforia Prefab and the Cardboard Prefab and adding them again to the scene, the problem was solved.
Related
I have recently begun to develop an XR experience within Unity. Everything looked fine in the scene viewer, but when I ran it on the headset there was horrendous z-fighting. I learned that a fix for this is to raise the camera's minimum clipping plane to .3-.7 and dropping the max to about 1000. However, this has the issue of clipping into objects that are only within about half a meter of the camera. I noticed the scene camera has no z-fighting at all and I wonder if that has to do with its dynamic clipping ability or not and how I can re-create this effect within my project.
I'm using Vuforia with Unity and I try to track an ImageTarget( that with stones from Vuforia site). The problem is that sometimes (in 20-30% of cases) it takes like 10-20 seconds to recognize the ImageTarget even if I put it very clearly in front of the camera. Other problem is when the ImageTarget disappears from the scene and reappears sometimes works perfectly sometimes not. Any suggestion why this is happening? (I'm new in Vuforia)
If its default project without your scripts - then may be quality of your camera is not enough to track correctly image targets all the time. Also vuforia sometimes has bug with loading resources with image targets but if you do not reload app and image been tracked it is only quality of your camera.
I've been trying for quite some time now to use both marker tracking and ground plane tracking together in one Unity app, but I cannot get it to work properly. Vuforia seems to be limited to either "ground plane mode" or "conventional marker tracking mode". Marker tracking only works fine as long as the plane finder game object in Unity or the Vuforia device tracker is inactive.
If however I activate the plane finder, the marker tracking is broken and the content that is supposed to be rendered on the marker floats around instead.
I know I can programmatically switch the plane finder on or off at any time, but doing so will cause the screen to go black for a couple of seconds.
To be clear, I am not trying to use marker tracking and plane tracking at the same time, just in the same application and Unity scene. The user should be able to do both track a card-sized marker and spawn a ground plane later on. In my opinion though it breaks the immersion if the app and camera freeze while Vuforia switches to "ground plane mode".
Surely there must be a way to get a seamless transition between marker tracking and ground plane in Vuforia?
"Marker tracking only works fine as long as the plane finder game
object in Unity or the Vuforia device tracker is inactive"
I believe this is not correct. You can use both at the same time. Also, since you use ground plane positional device tracking is automatically activated. Then you can switch between fusion modes Optimize for Image Targets and Vumarks and Optimize for Model Targets and Ground Plane based on your scenario you explained in your question.
The problem about this is your image targets will still be tracked even though they are not visible in the frame due to positional device tracking but you can also come up with a work around for that by scripting.
I'm using This github project to create order independent transparency in my projects. It's working fine with a normal camera [no OIT] [OIT], but when I try to use it with a VR setup, it just doesn't render any object on the "transparent" layer that is using the above project. [VR no OIT] [VR no working with OIT].
On top of just not rendering anything marked as transparent, the left and right cameras become offset in a way that they shouldn't, so you get a disorienting effect as if you're eyes are in the wrong place.
I'm using the Oculus SDK, but I don't think it's that. The same thing happens if I just use a camera that feeds to the Oculus headset.
Here is the Unity project, if you want to see for yourself.
Thank you
EDIT: I was also occassionally getting a weird effect where the spheres would render all black and remain centered on my left eye, and the rest of the scene was rendered upside down. The right eye would render everything not marked as transparent correctly. I believe I was using the single camera setting in the OVR camera rig when this happened, but I couldn't get it to produce the same error when I went back to record these errors.
Additionally I am using Unity 2018.2.0f2 and the Oculus SDK v1.30.1
I'm developing a VR app in Unity for the Samsung Gear VR and I'm trying to implement a pointer so the user can interact with the objects in the scene. When you look at distant objects it looks fine, but when you focus on close objects (which is highly needed for the app mechanics) the pointer appears to be duplicated, so you need to center the desired object in the middle of the points :P
What I've tried
-Using the GvrReticlePointer that comes with the GoogleVR package for cardboard
-Creating my own pointer by adding a canvas to the main camera with an image in the center
-Changing some of the Camera settings like field of view, stereo separation, etc.
-Configure my phone via a QR code http://imgur.com/fVrNrQk
Steps to reproduce (With canvas added to camera)
1.- Create a simple scene with a few objects to look at in Unity
2.- Set build settings for android
3.- Configure player settings to enable "Virtiual Reality Supported"
4.- Add Oculus as Virtual Reality SDK
5.- Set package name and minimum API level
6.- Add a canvas to the camera
7.- Add an image to the canvas, a cross will do the job
Observations
I'm using Unity 5.6.0b10 since google cardboard's site recommends using this version for the GoogleVR package. And I'm using the Samsung Gear VR with a Samsung Galaxy S6 edge + phone.
Solved
Apparently this is a well documented issue called voluntary Diplopia, and it's a human bug not a software one (read here, Unity's documentation, section The Reticle Interaction in VR).
The problem is trying to put the reticle at a fixed point in the user interface, like traditional 3D games. When looking at closer objects in VR this is going to cause this seeing double problem.
The solution is to position the reticle at the point in the 3D space the user is looking at. If he's looking closer, the reticle is drawn closer. Of course now you also have to scale the reticle accordingly, so the users can see it the same size no matter where they're looking at.
Unity also provides some example scripts about this, you can find them in the assets store, is called VR Samples.
Now I have performance issues (I'm working on mobile platforms): sometimes, when you turn your head fast you can see the reticle where it was drawn before. But looks way better than the double reticle version.