5 ms·
What was/is holding voxel back? the new programming model? computation density? I guess minecraft is an example of a voxel game (supposed a voxel game written
by hardwaresofton 8y ago
What was/is holding voxel back? the new programming model? computation density?
I guess minecraft is an example of a voxel game (supposed a voxel game written in block style according to a random post on the internet[0]) that became really popular -- so I guess the answer could be "nothing", but it sure seems like voxels are still niche (and don't want to be).
[0]: https://forum.unity.com/threads/voxel-games-vs-block-games.286747/ https://forum.unity.com/threads/voxel-games-vs-block-games.2...
- dragonwriter 8y ago> What was/is holding voxel back? The fact that the domains they might be used in are also the domains people are guaranteed to have spent a lot of money on specialized polygon-pushing processors. Voxel techniques seemed to peak at about the time of the last hurrah of CPU-based rendering.
- s-macke 8y agoThe „Voxel Space“ engine from the 90th has only very little to do with what we call voxel today. It it basically a raycasting engine for height maps [0]. It is very limited. You can‘t look up and down more than 20 degrees and you can‘t even render houses, cars or trees. [0] https://github.com/s-macke/VoxelSpace https://github.com/s-macke/VoxelSpace
- AstralStorm 8y agoThe main problem is memory bandwidth at higher resolutions. Minecraft runs at a really low resolution. (Internally.) Occlusion handling is less efficient too because bounding and occlusion volumes are discrete and either very inaccurate or nearly as slow as rendering the voxels.
- pandaman 8y agoIn principle, "voxels" and "polygons" are the same algorithm - you project some points on the surface to the screen and eliminate invisible ones with the z-buffer. Polygons allow to use sparser points and fill space between them with interpolation, voxels rely on the points density or blowing up the point size. Interpolation is quite complicated and voxels, on the other hand, could be arranged so it would be very easy to draw on a traditional CPU. So one could write a really fast voxel renderer on something like Pentium 200, which would produce better looking graphics than a polygonal renderer at the same speed (it would not be as versatile but when you do a demo you are free to chose scenes where voxels will do the job better). On GPUs interpolation is not just cheap but it's the only way to exploit massive parallelism since you can draw all interpolated points simultaneously. Drawing points, on the other hand, is sequential (because of z-buffer all primitives have to be drawn in the fixed order) and is already super slow by itself. GPUs are also optimized for drawing triangles so they do a lot of things with them they cannot do for a list of points (which would be the primitive you'd use to draw voxels). Of course you can do your voxels on compute but then you are not using color/depth buffer hardware so either way you are disadvantaged.
- dkersten 8y agoIt was my understanding that a large reason why early voxel engines had great performance is because you only draw each pixel once (kinda like how deferred lighting only calculates lights for each pixel once) eliminating overdraw and therefore doing work that wasn’t ever going to be visible. But now GPUs can crunch that data super fast (as you say) and memory bandwidth is often a bigger issue. So while voxels still get used in some places, they’re avoided in favour of more compressed data formats and rendering techniques. At least, that’s what it sounded like to me, I’m no graphics expert.
- JKCalhoun 8y agoEarly voxel engines (referred to as height-map engines in the article) were narrow, optimized, limited ray tracers essentially.
- pandaman 8y ago>because you only draw each pixel once It depends on the algorithm, if you did heightfield then yes, you could easily eliminate invisible pixels without testing each of them against z-buffer. However you could not do complex models with heightfields. A popular general voxel algorithm in 90s was "chains", where an object was represented as a sequence of voxels, where position of each was encoded as an offset from the previous one and voxels were on a regular grid so there were only 26 possible offsets. If you did not do perspective projection then you could have just projected all 26 deltas into the screen space and compute each voxel's position with 3 additions. With the offset taking 5 bits you could fit each voxel in a 16-bit dword together with some ramp-lit material for per-pixel lighting. It was a very fast loop even on a CPU without division. On a modern CPU or GPU, of course, this is painfully slow, since each position depends on the previous one and ensures strict order on the loop. Memory-bandwidth wise this is quite nice because of the very compact input data. E.g. you could put position and texture deltas into 8 bit voxels and had more compact representation for a smaller model than using popular 16/32 byte vertices.
- dkersten 8y agoOh that’s interesting, thanks for the comment! Must read up on it more :) Do you know how modern voxel algorithms work? Do they just blindly render point clouds to make use of the GPU parallelism and let the z-buffer remove invisible voxels (and a spatial index to render only the ones in view) or is there more sophistication? I assume there’s some clever parallel algorithms available nowadays, or?
- phkahler 8y ago>> What was/is holding voxel back? Modeling and animation. I'm not even sure what some of these videos are showing, but it doesn't seem like it can be real voxels on a regular grid. Regular grids are hard to create models with, and are essentially impossible to animate in useful ways. I didn't see mention of how the animation in these clips was being done but there were indications that the models started out as polygons.
- JKCalhoun 8y agoArticle calls out Minecraft: voxel-looking, actually polygons though. A kind of voxel-cheater.
- DonHopkins 8y agoOne question is how to you rig and deform voxel models onto skeletal animation?
- DonHopkins 8y agoAnother technique related to voxels is the "Signed Distance Field" (using a data Field or procedural Function). Signed Distance Function: https://en.wikipedia.org/wiki/Signed_distance_function https://en.wikipedia.org/wiki/Signed_distance_function 2D Signed Distance Fields are used for rendering fonts and other shapes defined by a texture whose signed pixels (-128..128) specify how far each is from the border (+ is outside, 0 is on the border, - is inside). They scale beautifully because you can smoothly interpolate between samples. Drawing Text with Signed Distance Fields in Mapbox GL: https://blog.mapbox.com/drawing-text-with-signed-distance-fields-in-mapbox-gl-b0933af6f817 https://blog.mapbox.com/drawing-text-with-signed-distance-fi... TextMesh Pro - Font Asset Creation Process: https://www.youtube.com/watch?v=eXhfygRgIVY https://www.youtube.com/watch?v=eXhfygRgIVY You can convert them to piecewise outline contours (like an iso-map slicing at many different elevations) with the Marching Squares algorithm, but it's much more efficient to render them directly pixel-by-pixel with a shader. Marching Squares: https://en.wikipedia.org/wiki/Marching_squares https://en.wikipedia.org/wiki/Marching_squares Signed Distance Fields are excellent for shaders efficiently antialiasing and drawing effects like outlines, drop shadows, embossed and beveled edges, glows, multi texture mapping, bump mapping, etc). The shader can quickly determine exactly how far away each pixel is from the outline, and blend the appropriate effects together for that pixel, so you get precise anti-aliasing, outlines, drop shadows, etc, practically for free! (And literally for free, now that Unity gives TextMesh Pro away for free.) TextMesh Pro - Unite 14 Demo: https://www.youtube.com/watch?v=q3ROZmdu65o https://www.youtube.com/watch?v=q3ROZmdu65o 3D Signed Distance Fields are used for rendering volumes with the Marching Cubes and Tetrahedra algorithms (which are nice for users continuously carving and sculpting with tools, like Astroneer). Astroneer: https://astroneer.space/ https://astroneer.space/ Astroneer - Digging to the Center of the Planet: https://www.youtube.com/watch?v=C3zxBhPzxYU https://www.youtube.com/watch?v=C3zxBhPzxYU That also scales and handles different levels of detail nicely because you can interpolate between samples -- it creates smooth polygon meshes with interpolated normals, not harsh cubes with pointy corners like Minecraft. Marching Cubes: https://en.wikipedia.org/wiki/Marching_cubes https://en.wikipedia.org/wiki/Marching_cubes Marching Tetrahedra: https://en.wikipedia.org/wiki/Marching_tetrahedra https://en.wikipedia.org/wiki/Marching_tetrahedra Fast Marching Method: https://en.wikipedia.org/wiki/Fast_marching_method https://en.wikipedia.org/wiki/Fast_marching_method Fast Sweeping Method: https://en.wikipedia.org/wiki/Fast_sweeping_method https://en.wikipedia.org/wiki/Fast_sweeping_method Level-Set Method: https://en.wikipedia.org/wiki/Level-set_method https://en.wikipedia.org/wiki/Level-set_method Shaders can't render 3D Signed Distance Fields as directly and efficiently as 2D (unless you're rendering to 3D volumetric textures). But you can still implement Marching Cubes on the GPU, using compute shaders (or abusing 2D shaders). Marching Cubes on the GPU for Unity3D: https://github.com/Scrawk/Marching-Cubes-On-The-GPU https://github.com/Scrawk/Marching-Cubes-On-The-GPU