Giter VIP home page Giter VIP logo

voxel-mapper's Introduction

Amethyst Game Engine

Pic

The Voxel Mapper is a set of Amethyst-compatible systems for creating beautiful voxel worlds.

Demo

Supports both smooth voxels and cube voxels. Just edit the MeshMode resource.

Demo

Editor Usage

To build and run with the example assets:

run/download_assets.sh

GRAPHICS_BACKEND=metal
cargo run --bin editor --release --features amethyst/$GRAPHICS_BACKEND,amethyst/no-slow-safety-checks -- assets/maps/example_map.ron

When you exit the app, a binary file "saved_voxels.bin" will contain the map you just created. You can load it back into the editor by setting voxels_file_path: Some("saved_voxels.bin") in "assets/maps/example_map.ron."

Control bindings can be found in "assets/config/map_editor_bindings.ron".

If you want to import your own material images, take a look at material-converter. It makes it easy to import material images from sites like freepbr.com (don't you wish they meant the beer?).

Library Usage

To use the voxel mapper in your own Amethyst app, you'll need to:

  • Add the VoxelSystemBundle to your Dispatcher
  • Add the RenderSplattedTriplanarPbr render plugin to your renderer
  • Insert a VoxelMap into your World
    • You can create one in the editor and save it to a ".bin" file
    • Reference the ".bin" file in your RON map file and load it with load_voxel_map
  • Insert a VoxelAssets into your World
    • You load the assets using the VoxelAssetLoader and your VoxelMap

Development

It's early days for this project. These features are currently supported:

  • a voxel map that supports:
    • real-time editing (terraforming)
    • serialization
    • real-time LZ4-(de)compression
    • LRU-caching of decompressed chunks
  • real-time, smooth chunk meshing using Surface Nets
  • multiple blended materials (texture splatting)
  • physically-based, triplanar material rendering, courtesy of Amethyst
  • a mouse-based terraforming controller
  • a camera controller that resolves collisions with the voxels

Planned features (by priority):

  1. multiple array materials
  2. more realistic texture splatting using depth textures
  3. shadows
  4. procedural generation
  5. streaming voxel maps from persistent storage
  6. dynamic voxel types (e.g. water, foliage)
  7. GPU acceleration of voxel algorithms
  8. beautiful example maps
  9. level of detail
  10. texture detiling

voxel-mapper's People

Contributors

alvelarsson avatar bonsairobo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

voxel-mapper's Issues

Voxels not displaying in example map

I'm on Windows 10 and the master of this repo. I tried to checkout a previous version from a few weeks ago and had no luck there either.
I downloaded the assets using the script.
folder
I run

cargo.exe run --release --features="amethyst/vulkan,amethyst/no-slow-safety-checks" --bin editor .\assets\maps\example_map.ron

It works but the voxels are invisible, though I can create more phantom voxels using C it doesn't show them:
folder
Seems to be some kind of asset loading issue. There's no error in the console.

download asset failed

Downloading array_materials...
Archive:  array_materials.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of array_materials.zip or
        array_materials.zip.zip, and cannot find array_materials.zip.ZIP, period.
<html lang=en><meta charset=utf-8><meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width"><title>Error 404 (Not Found)!!1</title><style nonce="GCO9ctnML7ei_FljxpxNIw">*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{color:#222;text-align:unset;margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px;}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}pre{white-space:pre-wrap;}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}</style><main id="af-error-container" role="main"><a href=//www.google.com><span id=logo aria-label=Google role=img></span></a><p><b>404.</b> <ins>That’s an error.</ins><p>The requested URL was not found on this server. <ins>That’s all we know.</ins></main>

looks like the resource was dead

Master's compilation failed

cargo run --bin editor --release --features amethyst/vulkan,amethyst/no-slow-safety-checks -- assets/maps/example_map.ron
   Compiling voxel-mapper v0.1.0 (/home/elias/amethyst/voxel-mapper)
error[E0432]: unresolved import `ilattice3::Chunk`
 --> src/voxel/double_buffer.rs:5:17
  |
5 | use ilattice3::{Chunk, VecLatticeMap};
  |                 ^^^^^ no `Chunk` in the root

error[E0432]: unresolved import `ilattice3::point::FACE_ADJACENT_OFFSETS`
 --> src/voxel/editor.rs:5:17
  |
5 | use ilattice3::{point::FACE_ADJACENT_OFFSETS, prelude::*, VecLatticeMap};
  |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `FACE_ADJACENT_OFFSETS` in `point`

error[E0432]: unresolved imports `ilattice3_mesh::calculate_material_weights`, `ilattice3_mesh::MaterialVoxel`, `ilattice3_mesh::SignedDistanceVoxel`, `ilattice3_mesh::MATERIAL_WEIGHT_TABLE`
  --> src/voxel/meshing.rs:15:5
   |
15 |     calculate_material_weights, greedy_quads, make_pos_norm_material_mesh_from_quads, surface_nets,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ no `calculate_material_weights` in the root
16 |     MaterialVoxel, PosNormMaterialMesh, SignedDistanceVoxel, SurfaceNetsOutput,
   |     ^^^^^^^^^^^^^                       ^^^^^^^^^^^^^^^^^^^ no `SignedDistanceVoxel` in the root
   |     |
   |     no `MaterialVoxel` in the root
17 |     MATERIAL_WEIGHT_TABLE,
   |     ^^^^^^^^^^^^^^^^^^^^^ no `MATERIAL_WEIGHT_TABLE` in the root

error[E0405]: cannot find trait `IsEmpty` in this scope
   --> src/collision/voxel_bvt.rs:140:8
    |
140 |     T: IsEmpty,
    |        ^^^^^^^ not found in this scope
    |
help: consider importing this trait
    |
1   | use ilattice3::IsEmpty;
    |

error[E0405]: cannot find trait `Indexer` in this scope
   --> src/collision/voxel_bvt.rs:141:8
    |
141 |     I: Indexer,
    |        ^^^^^^^ not found in this scope
    |
help: consider importing one of these items
    |
1   | use ilattice3::Indexer;
    |
1   | use ilattice3::indexer::Indexer;
    |

error[E0405]: cannot find trait `Indexer` in this scope
  --> src/voxel/meshing.rs:38:8
   |
38 |     I: Indexer,
   |        ^^^^^^^ not found in this scope
   |
help: consider importing one of these items
   |
4  | use ilattice3::Indexer;
   |
4  | use ilattice3::indexer::Indexer;
   |

error[E0405]: cannot find trait `Indexer` in this scope
  --> src/voxel/meshing.rs:89:8
   |
89 |     I: Indexer,
   |        ^^^^^^^ not found in this scope
   |
help: consider importing one of these items
   |
4  | use ilattice3::Indexer;
   |
4  | use ilattice3::indexer::Indexer;
   |

error[E0405]: cannot find trait `Indexer` in this scope
   --> src/voxel/meshing.rs:102:8
    |
102 |     I: Indexer,
    |        ^^^^^^^ not found in this scope
    |
help: consider importing one of these items
    |
4   | use ilattice3::Indexer;
    |
4   | use ilattice3::indexer::Indexer;
    |

error[E0405]: cannot find trait `Indexer` in this scope
   --> src/voxel/meshing.rs:119:8
    |
119 |     I: Indexer,
    |        ^^^^^^^ not found in this scope
    |
help: consider importing one of these items
    |
4   | use ilattice3::Indexer;
    |
4   | use ilattice3::indexer::Indexer;
    |

error[E0405]: cannot find trait `Indexer` in this scope
   --> src/voxel/meshing.rs:137:8
    |
137 |     I: Indexer,
    |        ^^^^^^^ not found in this scope
    |
help: consider importing one of these items
    |
4   | use ilattice3::Indexer;
    |
4   | use ilattice3::indexer::Indexer;
    |

error[E0405]: cannot find trait `Indexer` in this scope
   --> src/voxel/meshing.rs:170:8
    |
170 |     I: Indexer + Send + Sync,
    |        ^^^^^^^ not found in this scope
    |
help: consider importing one of these items
    |
4   | use ilattice3::Indexer;
    |
4   | use ilattice3::indexer::Indexer;
    |

error: aborting due to 11 previous errors

Some errors have detailed explanations: E0405, E0432.
For more information about an error, try `rustc --explain E0405`.
error: could not compile `voxel-mapper`.

To learn more, run the command again with --verbose.

Will this compile on Windows 10 (x64)

Hello,

I am wondering if this will compile and run on Windows 10 (x64)?

Also, do you have any binary Releases that can be downloaded and tested?

Thanks and have a good day

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.