Oculus Unity VR - Separate UI Camera Not Working - unity3d

I have a VR project for which I am trying to render a canvas to be "always on top" of everything using a separate UI camera as noted here.
I made my UICamera object a child of the main camera - which is the centerEyeAnchor object in the OVRCameraRig.
And I set the culling mask for my UICamera to only show its layer and removed that layer from the main camera (CenterEyeAnchor).
But in fact the perspective is weird and it seems like the UICamera is offset a little bit but its transform is zero'd out in the inspector, so I don't why it's displaying so weird.
If I set the culling mask to "Everything" for both cameras it's still offset a little.

In general you don't need the UI camera to be a child of CenterEyeAnchor. Move it out to to the top level and zero out the coordinates. The Oculus rig might be doing some magic with IPD or something else and it screws up the pixel-perfectness of UI.

Related

Unity XR Interaction Toolkit multiple cameras shows mirrored pixelated mess

New to unity so hoping this is a dumb / quick fix.
I'm using XR Interaction Toolkit's XR Origin camera (device-based if it matters) and want to add a second camera to overlay my UI elements so the canvases appear on top of walls / elements instead of intersecting and being hidden by them.
I've duplicated my main camera and removed all scripts except the main camera one, set it as a child to the previous main camera, and adjusted the culling masks to be UI-only and Everything-but-UI. I've also set the depth of the ui camera to be higher than the main camera, and set Clear Flags to Depth only. My UI elements are in the correct layer and the camera of the canvas is the child UI camera.
The result is a disaster. When I click the button to bring up my UI overlay, me view becomes a 360 pixelated block of tiny mirrored rectangles.
Any help would be appreciated, or workarounds not using 2 cameras.
Thanks all

How can we track face in AR foundation (ARKit3) but not show front camera to the device screen?

Basically, there is a problem with ARFoundation package in Unity3D.
At first, I generate avatar model from the AvatarSDK. Not really important at this problem. but anyway. It returns skinned mesh renderer with blendshapes.
What I want to do next is to control those blendshapes with my own face through front camera. For this, on my scene I loaded ARSession/ARInputManager, ARSessionOrigin/ARFaceManager.
Then, when by model is generated, I enable ARFaceManager component to track face.
What I see next is front camera image with my virtual model on it.
The problem is I need to track face by front camera, but I do not want to see front camera image on screen.
Can it be solved?
In order to do this, you need to create a new skybox cubemap material first.
After you've done so, navigate to AR Session Origin > Main Camera in your hierarchy and find the AR Camera Background component.
Click the Use Custom Material checkbox and load your newly created skybox material as the custom material.
This will override the default camera material setting.
Good luck!

Does setting camera's culling mask to Nothing when UI covers the screen is good?

I have a pretty large and full scene and therefore gets a lot of draw calls.
Sometimes I display a video in the game, which covers the entire screen.
When I tested my game with Unity's profiler tool I noticed that the camera still renders everything (although occlusion culling is enabled and calculated), and it causes the video to lag.
My question is how can I disable the camera?
When I disable the Camera component or the camera's GameObject I get a warning ⚠ in the game view that says No camera is rendering to this display. Which, I guess, is not good (correct me if I'm wrong).
So I was wondering if cancelling the culling mask on the camera (by setting it to Nothing) would force unity to stop render the scene.
Or does it still do some work in the background?
(Like with UI elements that still being rendered even though they are fully transparent).
Thanks in advance
I have a pretty large and full scene and therefore gets a lot of draw
calls.
I recommend activating "Instancing" on your materials, it can greatly reduce draw calls.
When the UI Pops open, it can help removing the "Default" layer (or whatever layer the majority of your renderers are) from the active cameras. You can do this easily with layer masks. Or you can just set Camera.main.farClippingPlane to 1 or any low number.

Display a 3D Worldmap in the UI

My goal is to show the worldmap, a group of 3D Models, with lighting, shading and a Post-Processing Effect inside the UI whenever the player wants to warp to a location.
The setup I came up with was that the worldmap is located in a different scene, this scene is loaded when the game is started, but the scene's main camera renders to a RenderTexture, which will then be displayed with a RawImage on the UI of the main scene.
The problem with this is that the worldmap scene then also uses the lighting of the main scene. Additionally, the RawImage seems a bit distorted, even though the resolution is set to 1920x1080, which is the same as the game window.
Is there a way to achieve my goal in another, easier way? It seems a bit 'hacky' the way I am currently doing it.

Show silhouette or outline of player through other gameobjects

I am using an orthographic camera view where the camera follows the player, but does not rotate. When the player goes behind other objects I need a way to still see it. I played with hiding the objects but the prefabs I am using from the asset store do not seem to work well unless they are rendered opaque.
How can I have the player show through other objects, or have an outline or 'ghost' of the player visible?
I would suggest you to use another camera which will have same behaviour (same position/rotation, movement) as your main camera but will only render the player's layer. so when player goes behind other objects, this camera can still see it and make sure it renders on top of everything else using Depth property of camera.
Hope it helps