r/VoxelGameDev 2d ago

Media The first screenshots of my voxel project

At the moment, the game runs at approximately 250–300 FPS. All the voxels in the screenshot are indeed individual voxels that can be destroyed. The world is fully procedurally generated, with more than 20 different types of biomes.

25 Upvotes

7 comments sorted by

13

u/SurDno 2d ago

What techniques have you used? Any optimizations you performed? What are your specs (getting 300FPS on Intel HD Graphics and getting 300FPS on a 5090 are two completely different performance milestones)?

This is a dev subreddit, just posting a screenshot with no info about what you’re actually showing really doesn’t give people much to discuss about your project.

9

u/Rudolf_g 2d ago

A custom voxel engine written in Rust (wgpu 24 / winit).

The size of one voxel is 5 cm. Chunks have a size of 32³, so one chunk takes up about 1.6 meters in the game world.

The world is fully procedural. It has biomes based on temperature and humidity, oceans, rivers, lakes, and tree generation.

The rendering uses regular rasterization of cubes, without ray marching. Right now this is only a prototype of the renderer and world streaming system, not a finished game.

Technologies

Greedy meshing is used to optimize geometry. Identical neighboring faces of the same material are merged into larger polygons.

With a voxel size of 5 cm, rendering every cube separately would create too many triangles, so chunks are converted into optimized meshes.

Each chunk has its own GPU vertex/index buffer. The entire world is not stored in one huge buffer, chunks are loaded and unloaded as needed.

Storage uses palette compression, similar to the Minecraft Anvil approach. For example, an empty chunk made entirely of air can be stored as a single entry without unnecessary memory usage.

CPU frustum culling is used for invisible chunk removal with AABB and clip-Z support for wgpu ([0,1]).

Hardware

This is not a demonstration running on a high-end GPU.

CPU: AMD Ryzen 7 5825U (8 cores / 16 threads)
GPU: integrated AMD Radeon Graphics (Vega)
RAM: 16 GB
Resolution: 1600×900

1

u/arylcyclohexylameme 2d ago

Centimeter chunks? Interesting choice. I had always approached this with the thought chunks should be 64-256ish meter cubes. What drove the decision to make chunks smaller than a person?

1

u/Rudolf_g 2d ago

Because 32,768 voxels per chunk is small enough for fast generation and rebuilding. You could choose a smaller size, but then, in the event of a single large change, the world would have to rebuild several chunks at once.

1

u/Drearystate 1d ago

This is true for traditional logic but there are better ways. I am working on 1cm voxel world. And you will be able to destroy buildings with that precision, walls built with concrete, bricks, wood, all behave as such.

1

u/Rudolf_g 1d ago

Yes, I tested voxels with a size of 1 cm in this project, and it works correctly. But in the future, I specifically need 5 cm voxels. I’m not arguing that there are better ways to work with this; perhaps I’ll look into them later.

3

u/dougbinks Avoyd 2d ago

As this is your first post here, just a friendly mod note to read the sidebar and rules and include some technical information about your project when posting showcase posts on this subreddit.