Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Help with Z-Fighting with CAD models on Meta Quest

Discussion in 'General Graphics' started by peter_neil, Mar 22, 2023.

  1. peter_neil

    peter_neil

    Joined:
    Mar 16, 2017
    Posts:
    3
    We have developed a CAD visualization app which was the general workflow of customer submits the model to our cloud, we convert to assets bundle and then we view on device. However, a few models get submitted with overlapping geometry which then gives us z-fighting in certain places. We know the shader render offset can solve z-fighting but its difficult for us to come up with an algorithm (either at conversion or at runtime) that can efficiently determine where these overlaps are and apply the shader offset as the models can have lots of objects. Any suggestions for us to solve our z-fighting issue? Note we have had our application on HoloLens for some time with much less z-fighting but I assume this is because the graphics buffers are different to the Quest.
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,456
    It helps a lot to increase the near clipping plane, and increase far clip plane on quest 2.
    Not sure how to solve it fully tho, good luck!
     
    peter_neil likes this.
  3. peter_neil

    peter_neil

    Joined:
    Mar 16, 2017
    Posts:
    3
    Unfortunately changing the clipping plane doesn't help that much in our case.
     
    DevDunk likes this.
  4. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,022
    i think even professional cad optimizers fail on proper automatic overlapping surface removal, so its not easy..

    one thing to test,
    using some tool (or own math) to detect overlapping surfaces,
    get list of those meshes, assign z-offset fix shader there, if that would at least reduce them (even if some are missed) ?

    or not sure if oculus has some depth precision setting available?

    or planB,
    allow user to manually click meshes that flicker, then it assigns and saves it to use fix shader..
    (this could work, if there's few really annoying big planes/objects)
     
    peter_neil likes this.
  5. peter_neil

    peter_neil

    Joined:
    Mar 16, 2017
    Posts:
    3
    Yep that is what we are coding up right now, and we are persisting this so the user only has to do this once!!!

    The problem with the first option is some models have 100,000+ objects. And comparing each mesh for every other object for overlap is a lot of compute time!!!