A multidimensional array represented as a 1D flat array is called strided array. Another, very specialized variant, is bitboard, where you represent a 2D array of booleans as an integer.
This video helped me out enough to implement this myself in C# and I was able to generate meshes for implicit geometry. I'm now looking for a way to better approximate it, so I'm looking up how to implement the dual contouring "Surface Nets" algorithm.
I was scratching head watching Sebastian Lague's Marching cube video as it's example is in compute shader with unity which in godot it's hilariously complex to use - now this video helps me understand better. Not to say SL's one was bad but found myself dumb to understand it due to engine difference(I think)
Damn i was on a threejs implementation of this. Your video helped me a shitton. Also if someone comes here with the issue that the cubes are at the right place but in seemingly random orientation, try flipping the binary index. Turns out I was reading the points in reverse when building it.
Created something very similar lately in an attempt to make modifiable procedural terrain at runtime. The issue Im running into is linear interpolating based on noise values to improve the shape of the cubes, have you done any work on this?
Assuming you're talking about the thing I hinted to at the end (6:35); I'm thinking about making a video appending this one but that might be a while, since I'm currently working on something else entirely. So I'll try to answer it here as detailed as I can. During the creation of the vertices, we place it at the center (6:10) but we want to place it where we expect to find '0' (if the transition were linear). Then we also need the values of the two voxels adjacent to the vertex; replace: let position = (pos_a + pos_b) * 0.5; with: let val_a = voxel_grid.read(x + x0, y + y0, z + z0); let val_b = voxel_grid.read(x + x1, y + y1, z + z1); let t = val_a / (val_a - val_b); let position = pos_a + (pos_b - pos_a) * t; Hope this helped. If there's anything I explained poorly, feel free to ask.
Yeah, I'm sorry about that. Previously, I had a 30 second 'teaser' where I showed an example of what marching cubes can do but it felt too slow. So I removed it to get straight to the point, but I had forgot that the following scene had a reference to it.
Is this similar to using the equivalent of minecraft voxels but not rendering them; instead, calculating a flexible "blanket" that smoothly lays over the active (invisible) blocks, and takes their data as reference for what materials/ textures/ actors belong with the rendered "blanket" landscape that spans between the invisible blocks vertices?
A multidimensional array represented as a 1D flat array is called strided array.
Another, very specialized variant, is bitboard, where you represent a 2D array of booleans as an integer.
I am so glad I saw this video in the suggestions after watching the same video you did.
This video helped me out enough to implement this myself in C# and I was able to generate meshes for implicit geometry. I'm now looking for a way to better approximate it, so I'm looking up how to implement the dual contouring "Surface Nets" algorithm.
I was scratching head watching Sebastian Lague's Marching cube video as it's example is in compute shader with unity which in godot it's hilariously complex to use - now this video helps me understand better.
Not to say SL's one was bad but found myself dumb to understand it due to engine difference(I think)
Damn i was on a threejs implementation of this. Your video helped me a shitton. Also if someone comes here with the issue that the cubes are at the right place but in seemingly random orientation, try flipping the binary index. Turns out I was reading the points in reverse when building it.
Simple & short explanation: How to make something that's minecrafty look less minecrafty, with 1st order interpolation
This is a really great explanation of the marching cube algorithm 👍
Thank you!
everyone else:
me at 0:10: I literally just watched that video!
Amazing video! Helped me a lot to understand it and also it's well made.
nice work!
Created something very similar lately in an attempt to make modifiable procedural terrain at runtime. The issue Im running into is linear interpolating based on noise values to improve the shape of the cubes, have you done any work on this?
Assuming you're talking about the thing I hinted to at the end (6:35); I'm thinking about making a video appending this one but that might be a while, since I'm currently working on something else entirely. So I'll try to answer it here as detailed as I can.
During the creation of the vertices, we place it at the center (6:10) but we want to place it where we expect to find '0' (if the transition were linear). Then we also need the values of the two voxels adjacent to the vertex;
replace:
let position = (pos_a + pos_b) * 0.5;
with:
let val_a = voxel_grid.read(x + x0, y + y0, z + z0);
let val_b = voxel_grid.read(x + x1, y + y1, z + z1);
let t = val_a / (val_a - val_b);
let position = pos_a + (pos_b - pos_a) * t;
Hope this helped. If there's anything I explained poorly, feel free to ask.
0:30 I didn't spot the perlin noise? @Deadlock
Yeah, I'm sorry about that. Previously, I had a 30 second 'teaser' where I showed an example of what marching cubes can do but it felt too slow. So I removed it to get straight to the point, but I had forgot that the following scene had a reference to it.
@@DeadlockCodeis that hlsl??
Is this similar to using the equivalent of minecraft voxels but not rendering them; instead, calculating a flexible "blanket" that smoothly lays over the active (invisible) blocks, and takes their data as reference for what materials/ textures/ actors belong with the rendered "blanket" landscape that spans between the invisible blocks vertices?
Interesting way to say it, but yes.
Thank you !
In what language is it written ?
What do you use to render the image in 3D in your video ?
All the code is written in Rust and I used the Bevy Engine to animate and render the 3D elements of this video.
Thank you !