Giter VIP home page Giter VIP logo

smooth-infinite-voxel-terrain's Introduction

Smooth-Infinite-Voxel-Terrain

A voxel terrain generator that allows artists to easily create endless, diverse game worlds.

dependencies: transvoxel and polyvox

octree:

The original version of polyvox used virtual memory to page in & out terrain chunks.

For this project, we use octree instead, as it allows us to easily implement chunk LOD.

Built-in multi-threading supports memory-consuming components such as A.I. units and surface vegetation.

Chunk management with octrees

Each leaf node contains a single chunk, whose LOD is updated by the tree. The player carries a voxel modification component integrated with polyvox, and each octree calculates the distance between the component and its central location per frame. The variables mentioned above are used to determine a chunk's LOD, which tremendously improves the overall performance during runtime. Here are some pictures comparing a terrain segment generated with the conventional method that loads chunk with virtual memory paging, and another one generated with the maneuver mentioned above.

Generated with conventional method:

A small-sized, limited with virtual memory paging:

alt text

Generated with octrees:

Huge terrain segment with vegetation and dynamic LOD

alt text alt text alt text

Each octree calculates the distance between the player and its central position to determine its LOD. A lower LOD indicates a larger octree with a single chunk in the same size.

Drawbacks of virtual memory paging:

When used with a large-scale polygon engine, chunks must be paged out of virtual memory in a constructor. As a result, engine-specific multi-threading functions can not access terrain data during construction, which is probably the reason why the conventional method is so slow.

smooth-infinite-voxel-terrain's People

Contributors

dxgatech avatar

Watchers

James Cloos avatar  avatar  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.