Giter VIP home page Giter VIP logo

com.asurafanclub.frustumculling's Introduction

FrustumCulling

视锥体剔除和基于视口空间高度的 LOD 组件,可以为自定义的渲染器或者使用动效的物体配置相机可见性。样例场景在 Test\Scenes 文件夹下。

推荐的做法

  1. 在相机上挂载 CameraCullingGroup,为项目约定一组 LOD 层级(按倒序排列的视口空间高度)并为 CameraCullingGroup 写入固定值。
  2. 为需要检查可见性的物体上挂载 CullingGroupVolume,需要为 CullingGroupVolume 更新正确的本地包围盒。
  3. 播放时才会检查可见性,CullingGroupVolume 会回传事件,在业务代码里监听它们。

CullingGroupVolume 发出的事件

  • UnityEvent<Camera> onBecameVisible
    • 指示物体变为可见,传递参与剔除的相机
  • UnityEvent<Camera> onBecameInvisible
    • 指示物体变为不可见,传递参与剔除的相机
  • UnityEvent<Camera, IReadOnlyList<float>, int> lodChanged
    • 指示 LOD 发生变化,传递参与剔除的相机、对应的 LOD 列表和 LOD 层级
  • UnityEvent onVolumeDisabled
    • 指示剔除组自身被禁用

com.asurafanclub.frustumculling's People

Contributors

asura336 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.