Hot answers tagged

23 votes
Accepted

Storing voxels for a voxel Engine in C++

Storing the blocks as the positions and the values is actually very inefficient. Even without any overhead caused by the struct or object you use, you need to store 4 distinct values per block. It ...
user avatar
  • 14.5k
14 votes
Accepted

How to make natural looking voxel

This is achieved by interpolating ramps between cubes of different height. When you have a scenery like this (seen from the side) # #### ## ############ ...
user avatar
  • 112k
12 votes

How does transvoxel algorithm work and how can I implement It?

The transvoxel paper is a fairly in-depth work, discussing a variety of topics on how to create an entire voxel terrain system, including an overview of marching cubes, how to fix the ambiguity ...
user avatar
  • 121
9 votes

How does transvoxel algorithm work and how can I implement It?

The first thing I didn't understood was if transvoxel is a modified marching cubes or a second layer that modifies the work of the marching cubes. My reading of the paper is that Transvoxel's ...
user avatar
  • 115k
9 votes
Accepted

How can I smooth my voxels similar to 7 Days to Die?

It is not simply Marching Cubes With marching cubes, a block would expand into the surrounding ones. In fact, with the default configurations for the Marching Cubes algorithm the result is a ...
user avatar
  • 18.9k
7 votes

Storing voxels for a voxel Engine in C++

Octrees exist to solve exactly the problem you describe, allowing dense storage of sparse data without large search times. The fact that your voxels are the same size just means that your octree has ...
user avatar
  • 115k
7 votes

Texturing different block types on an optimized voxel mesh

Nice idea by the author. From experience... High vertex counts aren't that much of a problem (100Ks, millions even). Dealing with complex UV mapping is far more so. Sometimes it is worth staying ...
user avatar
  • 29.1k
6 votes

How to make natural looking voxel

There are two obstacles you need to deal with in order to achieve similar quality like the one in the image, the first is artistic and the second is technical (memory, processing). First I assume that ...
user avatar
  • 12.5k
6 votes
Accepted

Unity block chunk generation pattern

Remember, the whole point of using a chunk mesh is to try to render just the outside skin, and hide all the internal detail inside the chunk where we can't see it. If we generate a whole cube (all 12 ...
user avatar
  • 115k
6 votes
Accepted

How should I store loaded world chunks in RAM (For my game similar to Minecraft)?

If you don't want a 2d array of chunks indexed by world position because the player might get very far away from the world origin or you might have negative indexes, then it might be worth to look at ...
user avatar
  • 112k
6 votes
Accepted

Texturing different block types on an optimized voxel mesh

Quoting the meshing page you link: It isn’t too difficult to modify the code deal with either multiple block types or different normal directions. What you would do is modify the array called “mask” ...
user avatar
  • 115k
5 votes
Accepted

Unity3D: Efficiently loading chunks in an infinite voxel engine

Non sequitur, your question does not entirely make sense. You cannot store infinite chunks. You can only ever store the subset that is currently of interest, i.e. those around the player(s). So how ...
user avatar
  • 29.1k
5 votes

How is structural analysis done in games (e.g.: bridge building, Dig or Die, and 3D)?

I am the dev of Dig or Die, so I can give a little more details about the game physics Indeed the most crucial point was the performances, as in the game you can build thousands of physical blocks, ...
user avatar
  • 151
4 votes
Accepted

Can someone explain dual contouring?

The normals would be generated based on the gradient of the density function at the same time that you get the intersection points between the edges and the surface. If it's something simple and ...
user avatar
  • 4,853
4 votes
Accepted

OpenGL How to render a voxel based world scene with many objects

The way you are rendering voxels is extremely ineffective. For each cube you have to do calculations, set uniforms, and worst of all bind textures(This is usually a very expensive operation) ...
user avatar
  • 1,651
4 votes

How is structural analysis done in games (e.g.: bridge building, Dig or Die, and 3D)?

I've personally had good success with Iterative Relaxation. I think it follows the laws of physics quite nicely when dealing with objects made of aggregates of blocs. I believe the BridgeBuilder ...
user avatar
  • 421
4 votes
Accepted

How to make far block graphically better?

What you see is there because the textures are in a higher resolution than what they get drawn in. This results in a very pixelated look. To "fix" this you can generate mipmaps. Mipmaps are the ...
user avatar
  • 14.5k
4 votes
Accepted

Overcoming fill rate and generation bottlenecks in voxel engine

The overhead of instantiation on the GPU is huge relative to those 12 triangles in each cubes. GPUs don't like small (12-triangles) batches. The faster the GPU the worse this overhead gets compared to ...
user avatar
4 votes
Accepted

Minecraft-Style Voxel Sunlight Algorithm

For each block that you visit as you're doing your light propagation, store an offset/direction to the brightest light shining onto it from a neighbour (eg. if a block is receiving a value of 5 from ...
user avatar
  • 115k
3 votes

Finding break in voxel grid (3D array)

When you remove a node, take any solid nodes attached to it and do a connectivity test between each pair. If any of the solid nodes that were once connected to the solid node you just removed are no ...
user avatar
  • 72.7k
3 votes

How to texture a surface generated by marching cubes algorithm?

So this doesn't provide details to every problem you'll encounter with your approach, but, if you want to map each vertex to the closest non-air voxel in order to scrape information from it (such as ...
user avatar
3 votes
Accepted

Pathfinding in 3d voxel: waypoints?

Take a look at hierarchical A* (aka HPA*); its basically what you're looking for. However, keep in mind that adding pre-processing can add so much overhead that it might not be worth it. You will want ...
user avatar
  • 3,567
3 votes

Mining cubes out of marching cubes

I would suggest using Dual Contouring instead of Marching Cubes, for the following reasons: It supports both smooth and sharp features It works well with level-of-detail methods It requires no ...
user avatar
  • 4,853
3 votes

Unity3D: Efficiently loading chunks in an infinite voxel engine

A great explanation of a well known voxel chunk system can be found in the minecraft wiki Regardless of how you want to store the data programmatically, the ability to generate smooth flowing ...
user avatar
  • 530
3 votes

OpenGL what is VBO and when to use it?

A Vertex Buffer Object (in short VBO) is an object(buffer) that holds vertex data. It's your job, as the programmer, to fill the VBO with this data (usually Vertex positions, texture coordinates and ...
user avatar
  • 332
3 votes

How to remove voxel lights with Minecraft-style algorithm?

You can't. That's one of the downsides to MC's lighting model. What you can do is update the just the cell by setting them to max of the neighbours minus the decay like if there wasn't a light there ...
user avatar
3 votes
Accepted

How to render water reflections on multiple heights

There are two possibilities I can come up with that don't involve ordinary planar reflection. The first is to perform screen-space reflection, which is fairly cheap and works for any manner of ...
user avatar
  • 4,853
3 votes

How to handle collision detection & response in voxel engine with slopes?

There is a fairly simple way to do collision detection between a single "voxel shape" and an AABB. It relies on the SAT (separating axis theorem) - finding a plane which separates both objects. As ...
user avatar
  • 442
3 votes
Accepted

Voxel river flow simulation

A fairly straightforward algorithm for this can be established, if you can assume some fixed 2D grid of cells, each of which contains a value for the level of the water in them. Imagine an infinitely ...
user avatar
  • 6,018

Only top scored, non community-wiki answers of a minimum length are eligible