Skip to content

fotcorn/VoxelWorld

Repository files navigation

VoxelWorld

Play it in your browser now: https://fotcorn.github.io/VoxelWorld/

Screenshot

Screentshot

Features

  • Procedurally generated endless voxel world
  • Optimized vertex data generation from voxel world
  • OpenGL 4 based renderer
  • Simple water simulation
  • Adding/removing blocks with raycasting from mouse position to 3D block position
  • UI library based on HTML/CSS with flexbox layout support

Dependencies

Install the following tools:

  • conan
  • cmake

Setup and build

Linux (gcc/clang)

.venv/bin/conan install . --output-folder=build/conan --build=missing --remote=conancenter
cmake --preset conan-release
cmake --build --preset conan-release

Conan Center's OpenGL/GLFW packages require the distribution's X11 and OpenGL development packages. If the first command reports missing xorg/system packages, install the packages it lists with your distribution package manager (for example, sudo apt-get install <packages-reported-by-conan>) and rerun it.

To choose a different render distance, configure CMake with the number of chunks to render in each direction from the camera (the default is 15):

cmake --preset conan-release -DVOXELWORLD_RENDER_DISTANCE=24
cmake --build --preset conan-release

Larger values create and draw substantially more chunks, so they have a steep CPU and memory cost.

Controls

Input Action
Mouse Look around
W / A / S / D Move forward / left / backward / right
Space / Shift or E / Q Move up / down
1 / 2 / 3 Select grass / water / stone block
Left mouse button Add the selected block
Right mouse button Remove a block
Ctrl Toggle the debug UI
Hold Left Alt Show the cursor and interact with the visible UI

Windows (Visual Studio)

.venv\\Scripts\\conan install . --output-folder=build/conan -s build_type=Debug --build=missing --remote=conancenter
cmake --preset conan-debug
cmake --build --preset conan-debug

Sources

About

A OpenGL renderer for a voxel world like MineCraft

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors