{"id":1127,"date":"2012-09-30T00:46:11","date_gmt":"2012-09-29T21:46:11","guid":{"rendered":"http:\/\/unitycoder.com\/blog\/?p=1127"},"modified":"2021-07-20T23:35:00","modified_gmt":"2021-07-20T20:35:00","slug":"marching-cubes-voxel-terrain","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2012\/09\/30\/marching-cubes-voxel-terrain\/","title":{"rendered":"Marching Cubes Voxel Terrain"},"content":{"rendered":"<p><a title=\"start webplayer demo\" href=\"http:\/\/unitycoder.com\/upload\/demos\/VoxelTerrain1\/\" target=\"_blank\" rel=\"noopener\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1128\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2012\/09\/30\/marching-cubes-voxel-terrain\/marching_cubes_voxel_terrain_unity1\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/marching_cubes_voxel_terrain_unity1.jpg?fit=680%2C390&amp;ssl=1\" data-orig-size=\"680,390\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"marching_cubes_voxel_terrain_unity1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/marching_cubes_voxel_terrain_unity1.jpg?fit=680%2C390&amp;ssl=1\" class=\"alignnone wp-image-1128\" title=\"marching_cubes_voxel_terrain_unity1\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/marching_cubes_voxel_terrain_unity1.jpg?resize=680%2C390\" alt=\"\" width=\"680\" height=\"390\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/marching_cubes_voxel_terrain_unity1.jpg?w=680&amp;ssl=1 680w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/marching_cubes_voxel_terrain_unity1.jpg?resize=300%2C172&amp;ssl=1 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/a><\/p>\n<p>Marching cubes terrain sculpting v2.0 (this is also based to the earlier <a href=\"http:\/\/unitycoder.com\/blog\/2012\/09\/25\/marching-cubes-javascript\/\">webgl port<\/a>)<\/p>\n<p><strong>Current Features:<\/strong><br \/>\n&#8211; Can add \/ remove ground<br \/>\n&#8211; Special shader for blending materials (based on world Y)<br \/>\n&#8211; Moved raycasting to camera, can add multiple chunks (but they are not &#8220;connected&#8221; to neighbours yet)<br \/>\n&#8211; Chunks are now connected to neighbours (bubblegum solution: each chunk has list of neighbours in array, based on name+x+y+z..)<\/p>\n<p><strong>TODO:<\/strong><br \/>\n&#8211; Try INT version (creates blocky graphics like minecraft..?)<br \/>\n&#8211; Find better terrain UV mapping or shader techniques.. (texture atlas? texture painting? world slope based textures?)<br \/>\n&#8211; Custom collision system, instead of mesh collider?<br \/>\n&#8211; Save the mesh from play-mode to asset..<br \/>\n&#8211; Brush size adjusting..<br \/>\n&#8211; Display brush on terrain.. (using projector?)<br \/>\n&#8211; Try explosions? Dirtball?<\/p>\n<p><strong>References:<\/strong><br \/>\n&#8211; Marching cube system is based on this earlier test: <a title=\"http:\/\/unitycoder.com\/blog\/2012\/09\/25\/marching-cubes-javascript\/\" href=\"http:\/\/unitycoder.com\/blog\/2012\/09\/25\/marching-cubes-javascript\/\" target=\"_blank\" rel=\"noopener\">http:\/\/unitycoder.com\/blog\/2012\/09\/25\/marching-cubes-javascript\/<\/a><br \/>\n&#8211; Terrain shader is modified version of this: <a title=\"http:\/\/answers.unity3d.com\/questions\/54313\/shader-rgb-colour-based-on-y-value-vertex.html\" href=\"http:\/\/answers.unity3d.com\/questions\/54313\/shader-rgb-colour-based-on-y-value-vertex.html\" target=\"_blank\" rel=\"noopener\">http:\/\/answers.unity3d.com\/questions\/54313\/shader-rgb-colour-based-on-y-value-vertex.html<\/a><br \/>\n&#8211; Textures are from: <a title=\"http:\/\/opengameart.org\" href=\"http:\/\/opengameart.org\" target=\"_blank\" rel=\"noopener\">http:\/\/opengameart.org<\/a><\/p>\n<p><strong>Webplayer:<\/strong><br \/>\n<a title=\"start webplayer demo\" href=\"http:\/\/unitycoder.com\/upload\/demos\/VoxelTerrain1\/\" target=\"_blank\" rel=\"noopener\">http:\/\/unitycoder.com\/upload\/demos\/VoxelTerrain1\/<\/a> (v2.0)<br \/>\n<a title=\"http:\/\/unitycoder.com\/upload\/demos\/VoxelTerrainUnity3\/\" href=\"http:\/\/unitycoder.com\/upload\/demos\/VoxelTerrainUnity3\/\" target=\"_blank\" rel=\"noopener\">http:\/\/unitycoder.com\/upload\/demos\/VoxelTerrainUnity3\/<\/a> (v3.0)<\/p>\n<p>*Source is available here:<br \/>\n<a href=\"https:\/\/unitycoder.com\/blog\/2016\/12\/24\/voxel-terrain-js\/\">https:\/\/unitycoder.com\/blog\/2016\/12\/24\/voxel-terrain-js\/<\/a><\/p>\n<p>&#8212;<\/p>\n<p><strong>Notes for 3.0:<\/strong><\/p>\n<p>worldroot (empty game object) has script CreateWorld<br \/>\nparameters:<br \/>\nChunk: chunk prefab<br \/>\nsize: (is actually resolution, if its too high will hit 65k vertices error), for example 16 seems fine.<br \/>\naxismin: 0 (chunk pivot from 0)<br \/>\naxismax:8 (chunk width 8 units)<br \/>\nsizex and sizez: 16&#215;16 means 16*16 chunks side by side.<\/p>\n<p>main terrain script is in the prefab VoxelMesh<br \/>\n&#8220;MarchingCubesJ.js&#8221;<\/p>\n<p>some variables on the script:<br \/>\nnoiseScale: adjust this when creating perlin terrains<br \/>\nstrength, addStrength: digging and terrain adding strengths<\/p>\n<p>functions:<br \/>\n&#8211; InitChunkPerlin() fills\/creates the chunk, in this place you can create more interesting chunks.<\/p>\n<p>For example can use this function instead (and change noiseScale to 0.1), (might need a 2 sided shader).<\/p>\n<pre><pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\n function InitChunkPerlin3D()\n {\n var terrainHardness:int = 4; for (var z:int = 0; z lt; size; z++) \/\/ z - blue { for (var y:int = 0; y lt; size; y++) \/\/ y - green { for (var x:int = 0; x lt; size; x++) \/\/ x - red { var offX:int = x+offset.x; var offY:int = y+offset.y; var offZ:int = z+offset.z; var vx:float = axisMin + axisRange * x \/ (size -1); var vy:float = axisMin + axisRange * y \/ (size -1); var vz:float = axisMin + axisRange * z \/ (size -1); points.Add(Vector3(vx,vy,vz)); var value:float = p.Noise(offX*noiseScale,offY*noiseScale,offZ*noiseScale); if (y==0) value=terrainHardness*10000; \/\/ bottom is capped if (y==size-1) value=terrainHardness*10000; \/\/ top also values.Add(value); } } } }\n<\/pre>\n<p><strong>Screenshot of what is included (v3.0)<\/strong><br \/>\n<a href=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/marching_cubes_3_unity3d.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1475\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2012\/09\/30\/marching-cubes-voxel-terrain\/marching_cubes_3_unity3d\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/marching_cubes_3_unity3d.jpg?fit=1424%2C791&amp;ssl=1\" data-orig-size=\"1424,791\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"marching_cubes_3_unity3d\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/marching_cubes_3_unity3d.jpg?fit=1024%2C568&amp;ssl=1\" class=\"alignnone size-medium wp-image-1475\" title=\"marching_cubes_3_unity3d\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/marching_cubes_3_unity3d-300x166.jpg?resize=300%2C166\" alt=\"\" width=\"300\" height=\"166\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/marching_cubes_3_unity3d.jpg?resize=300%2C166&amp;ssl=1 300w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/marching_cubes_3_unity3d.jpg?resize=1024%2C568&amp;ssl=1 1024w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/marching_cubes_3_unity3d.jpg?w=1424&amp;ssl=1 1424w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a>&lt; Click to view image<\/p>\n<p><strong>Info:<\/strong><br \/>\n&#8211; Try the <a title=\"http:\/\/unitycoder.com\/upload\/demos\/VoxelTerrainUnity3\/\" href=\"http:\/\/unitycoder.com\/upload\/demos\/VoxelTerrainUnity3\/\" target=\"_blank\" rel=\"noopener\">Webplayer demo 3.0<\/a> to see the current features (and <strong>bugs<\/strong>!)<br \/>\n&#8211; Main difference to that: This download version uses perlin noise terrain (Perlin.cs included)<br \/>\n&#8211; There are MANY bugs, for example: Setting chunk size &amp; resolution only works with certain values..<br \/>\n&#8211; Feel free to ask more info<br \/>\n&#8212;<\/p>\n<p><strong>Image#2<\/strong>: Testing multiple chunks, somehow they should affect the neighbours (to connect the surfaces).. not sure yet how..<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1136\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2012\/09\/30\/marching-cubes-voxel-terrain\/voxel_terrain_chunks1\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/voxel_terrain_chunks1.jpg?fit=680%2C316&amp;ssl=1\" data-orig-size=\"680,316\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"voxel_terrain_chunks1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/voxel_terrain_chunks1.jpg?fit=680%2C316&amp;ssl=1\" class=\"alignnone size-full wp-image-1136\" title=\"voxel_terrain_chunks1\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/voxel_terrain_chunks1.jpg?resize=680%2C316\" alt=\"\" width=\"680\" height=\"316\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/voxel_terrain_chunks1.jpg?w=680&amp;ssl=1 680w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/voxel_terrain_chunks1.jpg?resize=300%2C139&amp;ssl=1 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/p>\n<p>&#8212;<\/p>\n<p><strong>Image#3<\/strong>: Big Map (50 x 50 chunks, each chunk is 120 x 120 x 120 meters..) [click image to view full size]<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/big_voxel_map_unity.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1140\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2012\/09\/30\/marching-cubes-voxel-terrain\/big_voxel_map_unity\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/big_voxel_map_unity.jpg?fit=1368%2C656&amp;ssl=1\" data-orig-size=\"1368,656\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"big_voxel_map_unity\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/big_voxel_map_unity.jpg?fit=1024%2C491&amp;ssl=1\" class=\"alignnone size-medium wp-image-1140\" title=\"big_voxel_map_unity\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/big_voxel_map_unity-300x143.jpg?resize=300%2C143\" alt=\"\" width=\"300\" height=\"143\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/big_voxel_map_unity.jpg?resize=300%2C143&amp;ssl=1 300w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/big_voxel_map_unity.jpg?resize=1024%2C491&amp;ssl=1 1024w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/big_voxel_map_unity.jpg?w=1368&amp;ssl=1 1368w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&#8212;<\/p>\n<p><strong>Image#4:<\/strong> Current version (28.10.2012) <em>(click to view full size)<\/em><br \/>\n&#8211; Chunks now connect properly, also while editing chunk borders<br \/>\n&#8211; Terrain can be generated with perlin noise<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/marching_cubes_terrain_unity3d_4.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1358\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2012\/09\/30\/marching-cubes-voxel-terrain\/marching_cubes_terrain_unity3d_4\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/marching_cubes_terrain_unity3d_4.jpg?fit=1117%2C608&amp;ssl=1\" data-orig-size=\"1117,608\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"marching_cubes_terrain_unity3d_4\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/marching_cubes_terrain_unity3d_4.jpg?fit=1024%2C557&amp;ssl=1\" class=\"alignnone size-medium wp-image-1358\" title=\"marching_cubes_terrain_unity3d_4\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/marching_cubes_terrain_unity3d_4-300x163.jpg?resize=300%2C163\" alt=\"\" width=\"300\" height=\"163\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/marching_cubes_terrain_unity3d_4.jpg?resize=300%2C163&amp;ssl=1 300w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/marching_cubes_terrain_unity3d_4.jpg?resize=1024%2C557&amp;ssl=1 1024w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/marching_cubes_terrain_unity3d_4.jpg?w=1117&amp;ssl=1 1117w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&#8212;<\/p>\n<p><strong>Image#5:<\/strong> Current version (3.11.2012) <em>(click to view full size)<\/em><br \/>\n&#8211; This one is using 2D Mathf.PerlinNoise, instead of Perlin.cs, had some problems connecting chunks..<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/voxel_terrain_unity3d_chunks.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1382\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2012\/09\/30\/marching-cubes-voxel-terrain\/voxel_terrain_unity3d_chunks\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/voxel_terrain_unity3d_chunks.jpg?fit=1247%2C647&amp;ssl=1\" data-orig-size=\"1247,647\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"voxel_terrain_unity3d_chunks\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/voxel_terrain_unity3d_chunks.jpg?fit=1024%2C531&amp;ssl=1\" class=\"alignnone size-medium wp-image-1382\" title=\"voxel_terrain_unity3d_chunks\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/voxel_terrain_unity3d_chunks-300x155.jpg?resize=300%2C155\" alt=\"\" width=\"300\" height=\"155\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/voxel_terrain_unity3d_chunks.jpg?resize=300%2C155&amp;ssl=1 300w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/voxel_terrain_unity3d_chunks.jpg?resize=1024%2C531&amp;ssl=1 1024w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/voxel_terrain_unity3d_chunks.jpg?w=1247&amp;ssl=1 1247w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&#8212;<\/p>\n<p><strong>Image#6<\/strong>: Current version (3.11.2012) <em>(click to view full size)<\/em><br \/>\n&#8211; Now its possible to use heightmap texture and build it as a voxel chunks terrain (still some leaks at chunk borders)<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/heightmap_to_voxel_terrain_unity3d.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1384\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2012\/09\/30\/marching-cubes-voxel-terrain\/heightmap_to_voxel_terrain_unity3d\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/heightmap_to_voxel_terrain_unity3d.jpg?fit=1223%2C729&amp;ssl=1\" data-orig-size=\"1223,729\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"heightmap_to_voxel_terrain_unity3d\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/heightmap_to_voxel_terrain_unity3d.jpg?fit=1024%2C610&amp;ssl=1\" class=\"alignnone size-medium wp-image-1384\" title=\"heightmap_to_voxel_terrain_unity3d\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/heightmap_to_voxel_terrain_unity3d-300x178.jpg?resize=300%2C178\" alt=\"\" width=\"300\" height=\"178\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/heightmap_to_voxel_terrain_unity3d.jpg?resize=300%2C178&amp;ssl=1 300w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/heightmap_to_voxel_terrain_unity3d.jpg?resize=1024%2C610&amp;ssl=1 1024w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/heightmap_to_voxel_terrain_unity3d.jpg?w=1223&amp;ssl=1 1223w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&#8212;<\/p>\n<p><strong>Image#7:<\/strong> Current version (4.11.2012) <em>(click to view full size)<\/em><br \/>\n<a href=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/voxel_terrain_unity3d_map1.jpg\" target=\"_blank\" rel=\"noopener\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"1386\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2012\/09\/30\/marching-cubes-voxel-terrain\/voxel_terrain_unity3d_map1\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/voxel_terrain_unity3d_map1.jpg?fit=1172%2C621&amp;ssl=1\" data-orig-size=\"1172,621\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"voxel_terrain_unity3d_map1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/voxel_terrain_unity3d_map1.jpg?fit=1024%2C542&amp;ssl=1\" class=\"alignnone size-medium wp-image-1386\" title=\"voxel_terrain_unity3d_map1\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/voxel_terrain_unity3d_map1-300x158.jpg?resize=300%2C158\" alt=\"\" width=\"300\" height=\"158\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/voxel_terrain_unity3d_map1.jpg?resize=300%2C158&amp;ssl=1 300w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/voxel_terrain_unity3d_map1.jpg?resize=1024%2C542&amp;ssl=1 1024w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/voxel_terrain_unity3d_map1.jpg?w=1172&amp;ssl=1 1172w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Marching cubes terrain sculpting v2.0 (this is also based to the earlier webgl port) Current Features: &#8211; Can add \/ remove ground &#8211; Special shader for blending materials (based on world Y) &#8211; Moved raycasting to camera, can add multiple chunks (but they are not [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1128,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[4,3],"tags":[286,18,309,342,144,314,313,312,168,311],"class_list":["post-1127","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-demos","category-unity3d","tag-caves","tag-javascript","tag-marching-cubes","tag-marching-squares","tag-minecraft","tag-mountains","tag-ridges","tag-sculpting","tag-terrain","tag-voxel"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2012\/09\/marching_cubes_voxel_terrain_unity1.jpg?fit=680%2C390&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-ib","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/1127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/comments?post=1127"}],"version-history":[{"count":32,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/1127\/revisions"}],"predecessor-version":[{"id":5392,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/1127\/revisions\/5392"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/1128"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=1127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=1127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=1127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}