Mixedrealitytoolkit-unity: Clipping Primitives cause "Fade" mode materials to render more transparent than they should be

Created on 7 Mar 2020  路  4Comments  路  Source: microsoft/MixedRealityToolkit-Unity

Describe the bug

Adding a Renderer to a Clipping Primitive will cause any materials using the MRTK Standard Shader with Fade mode on to appear more transparent than they actually should.

To reproduce

Steps to reproduce the behavior:

  1. Create a new scene
  2. Add a primitive cube and name it "Content"
  3. Create a material with the MRTK Standard Shader and set to "Fade" mode
  4. Drag and drop the material onto "Content"
  5. Add another primitive cube and name it "Clipper"
  6. Add a Clipping Primitive component to "Clipper"
  7. Drag "Content" into the "Renderers" field of the Clipping Primitive component of the "Clipper"
  8. Toggle the enabled state of the Clipping Primitive to observe the difference in the colour of the "Content" object

Expected behavior

Adding a Renderer to a Clipping Primitive with a material with MRTK Standard Shader on Fade mode should not change how the material is rendered aside from the clipped portions.

Screenshots

With Clipping Box enabled:
enabled

With Clipping Box disabled:
disabled

Your setup

  • Unity 2019.3.2f1
  • MRTK v2.3.0

Target platform

  • HoloLens
  • HoloLens 2
  • AR Foundation (ARKit, ARCore)
Bug Shader Clipping Shaders / Materials Stale

Most helpful comment

Thank you for reporting this. @AlexisAG is correct. The default "Blended Clipping Width" is 1 meter (which is probably a little large for most holograms).

I'll document this better for future developers.

All 4 comments

Hi, I had a problem with Clipping Primitive where my texture became completely transparent, it's not the same issue but maybe my solution can work for you.

When you set the renderingMode to Fade do you change "Blended Clipping Width" ? When I set it to '0' that fixes the problem. Have you tried that ?

@AlexisAG wow that actually fixed it. Thanks for the workaround.

Thank you for reporting this. @AlexisAG is correct. The default "Blended Clipping Width" is 1 meter (which is probably a little large for most holograms).

I'll document this better for future developers.

This issue has been marked as stale by an automated process because it has not had any recent activity. It will be automatically closed in 30 days if no further activity occurs. If this is still an issue please add a new comment with more recent details and repro steps.

Was this page helpful?
0 / 5 - 0 ratings