Home > Software engineering >  MRTK 2.7.3 - Outline Shader is not visible on HoloLens
MRTK 2.7.3 - Outline Shader is not visible on HoloLens

Time:04-08

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

Screenshot

(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

Screenshot

--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?

CodePudding user response:

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.

  • Related