three.jsocclusion-culling

Is Occlusion culling enabled in threejs by default


Is occlusion culling enabled in threejs by default or there is any setting in threejs where I can enable it ?


Solution

  • A form of occlusion culling is enabled by default in three.js.

    WebGLRenderer has a property renderer.sortObjects, which defaults to true.

    When true, opaque objects (those having material.transparent equal to false) are sorted based on distance from the camera, and the opaque objects closest to the camera are rendered first.

    If renderer.sortObjects is set to false, then opaque objects are rendered in the order they appear in the scene graph.

    In addition, Object3D.renderOrder can also be used to control the rendering order.

    three.js r.75