Search Unity

Resolved Occlusion Culling Cannot Be Disabled

Discussion in 'General Graphics' started by matthewgreen, Dec 23, 2021.

  1. matthewgreen

    matthewgreen

    Joined:
    Dec 10, 2017
    Posts:
    8
    Hi everyone,

    I am making a demo for a Minecraft style game for fun and I cannot get the Camera to correctly render a chunk. It will only render the chunk if the origin of the mesh is within the bounds of the Camera. I looked into it and everyone is saying that it is Occlusion Culling. Well I got to turn it off on the Camera Component and it does not have any effect. It still stops rendering the mesh if I stop looking at the origin of the mesh.

    Some extra information to understand the context of how I implemented the chunk. The chunk is a 16x16x256 volume of 1x1x1 voxels. The chunk mesh is the all the voxels combined. Each voxel is NOT an individual mesh. I have not yet done any optimizations other than in the initialization of each voxel.

    upload_2021-12-22_18-44-24.png

    Very slightly moving the angle of the camera away from the origin of the mesh and the chunk no longer renders on the camera, even with Occlusion Culling turned off.

    upload_2021-12-22_18-44-58.png
     
  2. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,073
    Do you recalculate bounds of mesh ?
     
    matthewgreen likes this.
  3. matthewgreen

    matthewgreen

    Joined:
    Dec 10, 2017
    Posts:
    8
    100% correct my guy, thanks a bunch! I completely forgot about the bounds.

    Without setting the bounds manually or calling mesh.RecalculateBounds()
    upload_2021-12-29_16-4-54.png

    Now with calling mesh.RecalculateBounds()
    upload_2021-12-29_16-6-44.png

    upload_2021-12-29_16-7-8.png