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

Occlusion culling for semi static objects like foliage.

Discussion in 'General Graphics' started by koirat, Mar 14, 2022.

  1. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,095
    How do you do occlusion culling for small "semi-static" objects like foliage, by semi static I mean objects that are in one place but are changing it's shape to some degree, for example trees in the wind bending it's trunks.
     
  2. mabulous

    mabulous

    Joined:
    Jan 4, 2013
    Posts:
    198
    occlusion culling is performed simply based on bounding box. Make sure the mesh bounding box is set to something large enough so that it encompasses all possible vertex locations.
     
  3. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,892
    I think it's not possible to combine a lot of tree meshes and use the wind shaders for trunk or barks. So you have forced to skip OC for trees with a realistic wind animations
     
  4. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,095
    Occlusion culling (baked [static]) is no based on bounding box but on a mesh visible triangles.
    Frustum culling is based on bounding box.

    Trees are a problem, but a bigger problem is small foliage like patches of grass and bushes I cannot make it static since it is moving on a wind.
    I cannot skip Occlusion Culling since there will be a huge amount of this small objects in my level.

    The only solution I can think of right now is to generate some bigger mesh for occlusion culling, bake the occlusion culling and than swap meshes again.