Search Unity

Occlusion culling: visibility experiment

Discussion in 'iOS and tvOS' started by BananaRaffle, Jun 25, 2009.

  1. BananaRaffle

    BananaRaffle

    Joined:
    Feb 24, 2009
    Posts:
    85
    I'm not sure what I'm doing wrong here.

    This makes sense, given where the camera is:


    This doesn't:


    How can the areas on the bottom/right not be occluded in this situation?
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Something strange is definitely going on but I'm not sure if it is a unity side problem or one caused by the setup of the scene so:

    Hard to see from the image so: Are there any static occluder blocking the view?
    Is the Area around that wall setup correctly?
     
  3. BananaRaffle

    BananaRaffle

    Joined:
    Feb 24, 2009
    Posts:
    85
    Hi dreamora, thanks for responding. I believe it's all set up correctly. The mesh was built as one piece (using extrusion) and then split into individual objects. I built it in Blender and then exported to fbx from within blender (because Unity won't load .blend files from the latest version of blender.) Each "section" is a separate object. There's a ceiling, so everything is as close as closed I can get it without merging verts and there aren't any holes that I can see. I'm attaching the scene for you if you feel like looking. The vis areas are sized and placed exactly to fit the geometry (I manually typed in the position and scale so it would be exact). I've tried making the areas smaller and larger than the mesh, but it doesn't seem to change anything.
     

    Attached Files:

  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    In case no one else has a comment on the why I will check it out this evening or tomorrow morning. I'm not near my mac right now
     
  5. BananaRaffle

    BananaRaffle

    Joined:
    Feb 24, 2009
    Posts:
    85
    Ok, I've got it working. The view areas have to be completely contained inside the mesh. ON the mesh doesn't work, they have to be IN the mesh. But they must also overlap eachother so that there's no gap that the camera can get into.

    So, in other words, VisAreas must not intersect the mesh, and they must intersect their neighboring VisAreas.
     
  6. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Wasn't aware of the mesh requirement yet, but the vis area intersection must be. If the cam ever gets outside of the area, the whole occlusion is beeing disabled.

    I guess internally, portals are beeing formed at vis area intersections.
     
  7. BananaRaffle

    BananaRaffle

    Joined:
    Feb 24, 2009
    Posts:
    85
    It would be nice if we could model these vis areas in a real 3d package and import them somehow instead of using scale/position inside Unity. Actually, I suppose a script could be written that would convert a mesh object into some ViewAreas...
     
  8. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Not possible.
    The vis area require fixed "subsections" beeing present to calculate the occlusion data and require an as simple setup as possible as you don't want to defeat their benefit by using a math heavy boundary that require coordinate transformations to receive a usefull shape again for "in volume" checks