Search Unity

Strange occlusion culling issues

Discussion in 'Editor & General Support' started by ElmarKleijn, Dec 1, 2011.

  1. ElmarKleijn

    ElmarKleijn

    Joined:
    May 11, 2009
    Posts:
    87
    Hi,

    I have serious issues with the occlusion culling system. I have tried many, many variations of setting up my scene. From multiple occlusion areas to one single last one (as in the case of the screenshots below). sometimes it works "for a bit", but there are always places in my terrain (which are placed perfectly inside the area) which just disappear and never show up. Screenshots below are a great example. The terrain is not marked as static. Most of the other objects are. View and target area are turned on for the occlusion area.

    In the Unity Manual and tutorials it looks so easy, but am I overlooking something? I have tried small and large values for the cell sizes as well.

    Hope somebody here has some suggestions. The culling below was quickly setup for the sake of having some screenshots for the topic, that's why some objects are not completely inside the view area.

















    As you can see, everything looks well, except for the final result :). It culls too well! :confused:;)
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    never mark the terrain as static if you place trees and bushes on it. Instead get a mesh below that you mark static (look at the terrain to object script on unifywiki for example)

    Transparency is ignored for OC generation so they will occlude as i they were opaque which totally mess it up afterwards at runtime.

    Also ensure that your camera can't enter 'massive objects' (objects marked as static), cause if the camera can get into such a static object, the whole rendering will stop as you are considered to be within a view blocking mass
     
  3. ElmarKleijn

    ElmarKleijn

    Joined:
    May 11, 2009
    Posts:
    87
    Okay, I'm going to bump this thread with what got it fixed for me.

    I have:

    View cell size: 1
    Near clip plane: 0.3
    Far clip plane: 2300
    BQ: Production

    Now, what really fixed it, I think was:

    Far clip plane from 8000 (actual camera) to 2300 (calculated this to be the max excluding skydome). Don't know why, as I never got memory errors or anything.

    Second: I disable every static object which has some kind of transparency. Trees, houses (windows), sea water.
    Third: The terrain is disabled, and I use a mesh that has been created by the script dreamora also mentioned.

    Hope this might help somebody someday. :)