Giter Club home page Giter Club logo

unity-sparse-voxel-octrees's Introduction

Unity Sparse Voxel Octrees

A Unity-based method of rendering voxels using Sparse Voxel Octrees as seen in Nvidia's paper: "Efficient Sparse Voxel Octrees โ€“ Analysis, Extensions, and Implementation".

Installation

Currently the only way to use the library is to download the files and compile them yourself in unity.

Quick Start

Place the SVO folder in your Unity Project. You must enable unsafe code: Project Settings > Player > Other Settings > Allow 'unsafe' Code. To get a simple octree working, create a script:

  • Create a Start method
  • In the start method, create an octree with new SVO.Octree()
  • Modify the octree however you want
  • Set the texture of a material using an octree shader with material.mainTexture = octree.Apply()

A demo with code is available here.

Screenshot

This image contains voxels from the minimum size of 2^-23 up to approximately 2^-8. At this scale there are a lot of artifacts due to floating point errors, but in practice (when working at reasonable scales) this will not happen.

image

Limitations

  • Deformations, such as vertex deformations commonly used to animate characters or other objects, are not implemented, and are not planned (If its even possible).
  • No collider support. Unlike normal meshes, there is no built-in collider for representing an Octree. Any octree-based object will need to be represented using an approximate collider. This is not a huge deal, as an approximate collider is generally the more performant approach with traditional triangle-based meshes anyways. Theoretically, an exact octree collider could be made by recreating the octree using box colliders, but this would be memory intensive and slow, and implementation would take time, so this is not planned.
  • No shadows. Someone with experience developing shaders in Unity could resolve this, but as of now I do not have the time to add them in. PRs are welcome.

unity-sparse-voxel-octrees's People

Contributors

budgettoaster 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.