Hololens + Unity: GameObjects are invisible - unity3d

After I build my Unity project and send it to the Hololens, I have the following problem:
The splash screen appear followed by a debugging window on the bottom. In the background is a white net. However, you can't see any game objects. I've tested a lot but haven't found a solution for that. Visual Studio does not display any error messages. What I've looked at roughly:
These are my modules. Im using the 2019.4.22f1 version of Unity and the MRTK Foundation Toolkit 2.7.2.
My build settings
My project settings
I tried to place the objects in the middle of the camera and changed the colors.
MRTK settings I haven't changed anything most of the time
Main camera settings
My scene
When i start the scene i get this error in the console. I dont know if this has anything to do with my problem

i have two possible solutions (no guarantee)##
you could spawn the objects on input directly in front of the
camera, add a debug.log("object in front of you"); so you can find
the issue.
If this doesnt work i would try to test differnet types of materials
like you do with HDRP.
if this does not work either i probably cant help you out now.

It seems like your GameObject is too far to be hidden behind by the mesh. Please make the spatial mesh invisible by setting the Display Option property of Spatial Mesh Observer Setting to None, this item can be found under the Spatial Awareness profile of the MRTK profile.

Related

Meta Avatars have white textures in Unity Build

I really searched a long time for a solution of this problem, but I couldn't find it. Maybe one of you know, how I can fix this problem.
I created a Unity VR project for the Oculus Quest 2 and downloaded the Meta Avatar Plugin. I followed this tutorial on YouTube.
Everything is working fine during the Game Mode in Unity. But when I am building it, the Avatars has completely white textures, like in this screenshot.
I am using Unity Version 2021.3.5f1.
I think it has something to to with the building process/ Shader setup from Computer to Android, but I am not sure where or what I can change to make it run.
Does anyone has an idea?
After one day it worked suddenly. I think it was the answer from Philipp, with the Graphics settings:
Try this: Click on your relevant surface in Play mode and check what Shader the Material is using. Then stop, and go to to Edit -> Project Settings -> Graphics. Scroll down to the Always Included Shaders list and add the Shader you noted before to that list. Now compile again and see if the issue persists. (If it does, you may want to look into e.g. the Player -> Color Space setting, which can be Gamma or Linear.) –
Philipp Lenssen

MRTK 2.7.3 - Outline Shader is not visible on HoloLens

I saw the scene OutlineExamples in the MRTK examples package and recreated it in my own project.
The outlining works if I stay in unity in play mode. But if I deploy it on the HoloLens the object does not get a outline effect.
The OutlineExamples scene from the MRTKHub-project works as excpected on the HoloLens!
So I guess I missed something in my own project, but I cant find it. I compared the setup multiple times, but cant find a difference. And I also used the simplest object (the cube) from the example scene.
Setup for the cube
(the screenshot shows on the left side my project and on the right side the mrtkhub-project):
Mesh Filter (standard)
Mesh Renderer (standard)
Box Collider (standard)
MeshOutline with the Material "OutlineOrange" or "OutlineGreen" (added)
Object Manipulator (added)
Constraint Manager (added)
The only thing that I had to setup after adding the as "added" marked compenents, was the material for the MeshOutline component.
Is there something else someone has to setup to see the outline shader on the HoloLens?
My Setup:
Unity 2020.3.30
MRTK 2.7.3
Visual Studio 2019
What else did I check?
The XR Plug-in Management is set up the same way
--EDIT
I noticed something strange and I guess this will help someone who knows more about shader!
I launched my application on the HoloLens, grabbed the cube and put it in front of a window in my room. While placing the cube in front of the window, I saw the outline! But as soon as I move it outside the window area, the outline disappears! Another aspect is that I'm using the spatial mapping from MRTK. That means that the window does not get meshed, only the walls. And I guess the walls have their own shader on it, right?
So the spatial mesh shader and the outline shader "dont like each other". Is this possible?
The user derHugo gave me a hint that led to the solution! I went to the material, that I use on the cube and changed the property Render Queue Override under Advanced Options to a higher value than the material MRTK_Occlusion, which is used for the spatial mapping, has.

Unable to add interactions to oculus handtracking in Unity

I'm using the oculus integration package to implement hand tracking and have added the OVRCameraRig. Under the LeftHandAnchor I have added OVRCustomHandPrefab_L and similarly done the right hand. I have also enabled physics so the hands work and I can push items off the table in game.
However, I want to implement grabbing mechanism so I added the HandsManager prefab to the scene and put the above mentioned hand prefabs for the left and right hand fields. FInally, I added in the InteractableToolsSDKDriver but none of the interactable tools are working, the little blue dots aren't visible at all.
I'm not getting any error either. Please help, how should I fix this to get the Interactable tools to work?
Well probably because you haven't add component "xr grab interactable" to the item that you wanna grab.

no hand joints over holographic remoting

I use Holographic Remoting Player to project the unity uwp program to HoloLens. I can get the unity picture on HoloLens, move around to move the field of view, have the hand laser and air tap working well, but the hand joint visualization doesn't show up.
The player setting is ok. And I have followed the troubleshooting steps in this link, everything is ok, but the hand joint still doesn't work.
https://microsoft.github.io/MixedRealityToolkit-Unity/Documentation/Tools/HolographicRemoting.html#msbuildforunity-package-import-via-writing-into-the-packagemanifest
I have tried in Unity 2019.2.4 and 2019.4.1, both the same result. Is there anything misconfigured I need to check?
According to this document, the hand tracking profile has been updated to allow for setting the hand joint visualization to: Nothing, Everything, Editor or Player. It meaning it is possible to turn on/off hand joint visualizations while in the editor or in the device or both. So it might be a good idea to double check this field in your MRTK profile and the following way is worth trying:
Click the MixedRealityToolkit object in the Hierarchy window, and then navigate to Input->Hand Tracking in Inspector window, find HandJointVisualizationModes field and set to Everything.

My Unity scene opens as a white checkerboard image of the terrain

I am able to open my unity project and base scene on any computer other than my laptop. When I open the main scene on my laptop I am greeted with all of the terrain being a white checkerboard. All of the gameObjects show on the side bar but are invisible in the scene and game views. Any help or ideas would be greatly appreciated as I have looked for the answer everywhere.
Your image which you uploaded points that you are viewing your game in Scene mode rather than game mode. In your scene mode the rendering has been switched to Baked Lightmap or one of the other modes in Baked Global Illumination. By default Unity Scene modes are kept in Shaded in Shading mode. ie the one where we see our scene same as Game scene. To get back to shaded mode Find the Dropdown button below Scene Tab and select shaded mode.
I finally found the workaround for this same problem on mine: Hopefully your is similar.
After I upgraded my Unity version to the latest and it updated the project, it created a _TerrainAutoUpgrade folder in "Assets". I followed my normal source control rules, which was to check in most of this folder but to ignore the .meta files (allowing the computer that cloned my repository to generate its own).
Turns out, that didn't work. The meta files generated on the second computer, the "mainObjectFileID" in the meta file was set to 0.
I fixed it by manually copying over the _TerrainAutoUpgrade folder from the working machine to the non-working one. Clearly this is a bug in Unity, but at least this got me around it.
I came across a similar problem where my terrain was looking like a checkerboard. I found out that I was missing the terrain layers when I went to the paint tab. I was able to solve it by replacing the layers with terrain layers I already had and replacing the textures.