Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question I'm having an issue with 3D objects disappearing in WebGL builds.

Discussion in 'Web' started by gtk2k, Oct 30, 2022.

  1. gtk2k

    gtk2k

    Joined:
    Aug 13, 2014
    Posts:
    291
    I'm creating an app that moves on a 3D map.
    Moving objects are placed on the map.
    There is a problem that it disappears when the distance from this placed object reaches a certain range.
    I thought the problem was related to occlusion culling, so I tried various settings related to occlusion, but it didn't work.
    How can I fix the disappearing issue?

    Unity 2022.1.7f1
    Test Browser Chrome 106.0.5249.120

    Movies

     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,507
    Does it happen in the Editor playmode too? If not, then I wouldn't expect it to be occlusion culling because that should behave the same in the editor.
     
  3. gtk2k

    gtk2k

    Joined:
    Aug 13, 2014
    Posts:
    291
    It does not disappear in Editor. It disappears when running in a WebGL build.
     
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,507
    Can't really help with that except try to tinker with mesh import and build settings, such as mesh optimizations and the like. Could be LOD perhaps? But it's weird that it would pop away when the camera gets closer too.

    Are the mesh bounds correct?
     
  5. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,503
    test with exact same window resolution/aspect ratio too, just in case.
    could also test running unity editor with force opengl (if you are on windows).
    could test desktop build, does it have same issue?
    and any warnings/errors in console? (F12 in most browsers)
     
  6. gtk2k

    gtk2k

    Joined:
    Aug 13, 2014
    Posts:
    291
    No errors on browser (F12 devTools console)
    I've tried force opengl mode on windows, again no issues on windows platform (editor as well)
     
  7. unityruba

    unityruba

    Unity Technologies

    Joined:
    Nov 6, 2020
    Posts:
    278
    @gtk2k can I convince you to open a bug report with an attached project so we can take a look? I'll even accept an attached repro project in a DM :)