Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Voxeland - Voxel Terrain Tool

Discussion in 'Assets and Asset Store' started by Wright, Jun 25, 2013.

  1. Xype

    Xype

    Joined:
    Apr 10, 2017
    Posts:
    339
    Yes @Wright I agree everything still works, other than warnings, yellow means itll work. The issue I have is with obsolete, at that stage it means they can completely remove it from the code on any upcoming release without warning. Usually no big deal, but the nested prefabs man we are going to need that hehe.
     
  2. ibbybn

    ibbybn

    Joined:
    Jan 6, 2017
    Posts:
    181
    In that case may I request something like a random landblock selecter.
    This would fake megasplat texture clusters by randomly assigning the textures to the voxels.
    Basically switching between multiple selected landblocks with every 'replace' click.
    In continous paint mode it could switch between the landblocks on new voxel selected.
    Right now I'm filling an area with one texture then selecting another block and randomly clicking everywhere etc.. Bit of an awkward workflow. I usually create about 4-5 similar textures in substance designer otherwise even huge textures look too repeating. So selecting those textures and painting them with one stroke over an area would speed up the whole process of texturing a level tremendously.
     
  3. Xype

    Xype

    Joined:
    Apr 10, 2017
    Posts:
    339
    I havn't had any issues with voxeland and megasplat looking repeating since he finished the integration several months ago. You just need to add more generation rules to get a good mixup of block types. Even better look in the generator.cs and figure out how to completely customize that, that is where you can get the most power.
     
  4. ibbybn

    ibbybn

    Joined:
    Jan 6, 2017
    Posts:
    181
    I don't use generators at all except to create the starting plane. My levels are all custom build. The game doesn't have huge levels but complicated cave systems which is why I chose voxeland for the easier level building and collider generation. Works perfect for that I must say!
     
  5. Xype

    Xype

    Joined:
    Apr 10, 2017
    Posts:
    339
    Is there a limit to the amount of object blocks you can set up? I keep getting assertion failed, and im not auto baking which is the normal cause of that.
     
  6. hongtm

    hongtm

    Joined:
    May 22, 2018
    Posts:
    20
    How to bake the voxeland object? I can't use the navmesh baking in Unity (version:2018.3.0b3)
     
  7. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,837
    Guess bot Texture Array Inspector and Amplify Shader are using their own editor classes for the texture array. If so I'm afraid there's nothing I can do about it. However just wondering why AS uses the editor class but does not change the inspector. I'll look into it once I'll deal with MapMagic.

    The fixed version is available on the Asset Store. It brings the 2018.3b compatibility too.

    You can use the Voxeland's brush in Replace mode (Shift by default). This way it will not create or remove blocks, but will change their type. The effect is equivalent to painting.

    You can use 240 (256 - 16 technical types) blocks types for land, 240 for objects and 240 for the grass. Voxeland GUI will not allow you adding more than that, so if you have issues I doubt it is related. What the error exactly is?

    If you are using static mode then Voxeland mesh already have a "baked" collider object. Each time you change the terrain it is "re-baked". Make sure you are using Navigation Static flag.
    Obviously, terrain cannot be baked in dynamic or infinite mode.
    Just to mention: it's better using today's version from the asset store with Unity 2018.3 beta.
     
  8. Xype

    Xype

    Joined:
    Apr 10, 2017
    Posts:
    339
    @Wright the error is: Assertion failed on expression: 'kValidSceneObjectIdentifier == res' once those errors start, its not one its a huge chain of them, and I have to load in my backup if it starts because unity is done at that point, it will just freeze over and over again. Not sure what I am doing wrong, was getting it before and I turned off auto lightmap baking, it went away, then i added some more object blocks and it blew up lol.

    I am trying it without using megasplat encoding on a new project to see if I can reproduce it using the voxeland land material.
     
  9. Xype

    Xype

    Joined:
    Apr 10, 2017
    Posts:
    339
    @hongtm I had success experimenting runtime nav mesh baking on the github using voxeland. However it is very performance intensive, needs a lot of optimization, but it does work.
     
  10. ibbybn

    ibbybn

    Joined:
    Jan 6, 2017
    Posts:
    181
    Well, of course I'm doing that already. ;) I was talking about a way to randomize the selected landblocks..
     
  11. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,837
    If you are using Unity 2018.3 beta it could be a Unity bug.

    You can try doing this via script, like
    Code (CSharp):
    1. voxeland.landTypes.selected = myRandomNum;
     
    ibbybn likes this.
  12. Coltenney

    Coltenney

    Joined:
    Mar 10, 2015
    Posts:
    21
    Im starting to dig into the generators as I am trying to make my own. Ive had very good looking results using an array of raycasts to terrain height to place surface voxels on a unity terrain. I initially tried using a heightmap texture with the heightmap generator but it never came out right, possibly due to compression on the texture and the scale was hard to perfectly overlay on the terrain.

    Only problem is I am calling Alter() 3 times for every column (3 voxel thick columns, dont need subsurface voxels) in a Start() and this is slow. It would be nice if there was a way to buffer Alter calls and execute all the Alters at once.

    What I've come up with is that I need to make a Matrix[x,z] of heightmap thickness and assign that to voxeland.data via the FillHeightmap(matrix) method? Ideally I would like to implement this as its own generator, but ill likely run into issues with calling raycasts from the generators background thread. Any guidance? Thanks a ton.
     
    Last edited: Oct 11, 2018
  13. ilesonen

    ilesonen

    Joined:
    Sep 11, 2012
    Posts:
    49
    This looks really interesting! I'd first like to test it out and was trying to get your free evaluation version but the link gives 404 error?
     
  14. Xype

    Xype

    Joined:
    Apr 10, 2017
    Posts:
    339
    I am having trouble with some objects not spawning on the ground. I can't seem to find a way to change the prefab so that it will spawn in the proper position, any pointers anyone?

     
  15. Xype

    Xype

    Joined:
    Apr 10, 2017
    Posts:
    339
    Got it seems the voxeland object section in the generators add +.5 to positions...changed that and most things are on the ground now, some need some tweaking.

    Suggestion @Wright what I am going to put in myself is an offset for each object type, sometimes you buy art and it just doesn't line up right, most tools for foilage and trees contain an offset so you can get them to line up right. Almost all my trees were above the ground with that + 0.5f you have.

    That being said after getting things to line up better its coming out very nice

     
    camta005 likes this.
  16. Coltenney

    Coltenney

    Joined:
    Mar 10, 2015
    Posts:
    21
    So I made a MultiAlter() method to accomplish what I need. It was actually surprisingly easy to make. I only need it to work with the single brush in replace mode so its not as featured as Alter(). Just pass in a List of CoordDir and it will apply all the replacements (in this case) at once. Something like this should be included in the source as an overload to Alter().

    Code (CSharp):
    1. public void MultiAlter(List<CoordDir> centers, Brush brush, EditMode mode, int landType = -1, int objectType = -1, int grassType = -1)
    2.         {
    3.             mode = EditMode.replace;
    4.          
    5.             CoordDir min = brush.Min(CoordDir.Min(centers.ToArray()), mode);
    6.             CoordDir max = brush.Max(CoordDir.Max(centers.ToArray()), mode);
    7.             CoordRect brushRect = new CoordRect(min.x, min.z, max.x - min.x, max.z - min.z);
    8.  
    9.             if (landType >= 0)
    10.             {
    11.                 Matrix3<byte> matrix = new Matrix3<byte>(min.x, min.y, min.z, max.x - min.x, max.y - min.y, max.z - min.z);
    12.                 data.FillMatrix(matrix);
    13.  
    14.                 foreach(CoordDir center in centers)
    15.                 {
    16.                     matrix[center.x, center.y, center.z] = (byte)landType;
    17.                 }
    18.  
    19.                 data.SetMatrix(matrix);
    20.                 data.RemoveObjectsByLandMatrix(matrix);
    21.  
    22.                 foreach (Chunk chunk in chunks.WithinRect(CoordRect.PickIntersectingCells(brushRect.Expanded(meshMargin), chunkSize))) chunk.Rebuild(mesh: true);
    23.                 foreach (Chunk chunk in chunks.WithinRect(CoordRect.PickIntersectingCells(brushRect.Expanded(ambientMargin), chunkSize))) chunk.Rebuild(ambient: true);
    24.                 foreach (Chunk chunk in chunks.WithinRect(CoordRect.PickIntersectingCells(brushRect, chunkSize))) chunk.Rebuild(objects: true);
    25.  
    26.             }
    27.  
    28.         }
     
    camta005 and Xype like this.
  17. hongtm

    hongtm

    Joined:
    May 22, 2018
    Posts:
    20
    I have the problem when intergrate with GPU Lightmapper asset:
    "Mesh doesn't have albedo UVs. Please create them in your modelling package"
     
  18. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,837
    The best way to change multiple blocks at once is:
    Code (CSharp):
    1. CoordDir size = new CoordDir(10,10,10); //the size of the area we are going to edit
    2. CoordDir offset = new CoordDir(100,100,100);  //the offset of this area from data zero. Currently we are going to edit blocks within 100-110 on each axis
    3. Matrix matrix = new Matrix3<byte> (offset, size);  //creating a matrix (sort of 3D array) of the area. Each byte in array is the block number
    4. voxeland.data.FillMatrix(matrix);  //reading terrain at 100-110
    5.  
    6. //changing matrix
    7. matrix[105,105,105] = 0; //setting center block to the first one
    8. matrix[101,102,103] = Data.emptyByte;  //setting to empty
    9.  
    10. voxeland.data.SetMatrix(matrix, pin:true); //applying changed matrix, and pinning area to avoid re-generating it if player will leave location and return
    11.  
    12. //re-building changed chunks. Not necessary - can press "Rebuild" instead
    13. CoordRect areaRect = new CoordRect(100,100,10,10); //editable area in 2D
    14. CoordRect chunksRect = CoordRect.PickIntersectingCells(areaRect, voxeland.chunkSize); //area in chunk coordinates
    15. foreach (Chunk chunk in voxeland.chunks.WithinRect(chunksRect))
    16.     chunk.Rebuild(mesh:true); //re-building chunks within area
    It seems to be working fine now. Just in case: here is the link. I can't call my site host very reliable, so such things can occur. Going to change it soon.

    Yes, each object is placed in the center of the block, not on the floor. But I can make a checkbox in an object type so user could select the way it's placed.

    Voxelan use triplanar mapping, so it does not have a UV. Even if it did it should not be used for lightmapping since the color of the terrain is determined by the texture blending rather than texture color, so it will use the wrong information.
     
  19. hongtm

    hongtm

    Joined:
    May 22, 2018
    Posts:
    20
    First, I really love your asset, it's amazing to create landscape and cave. I would to use GPU Instancy asset for optimization:
    1. Can you suggest me the asset that can used to combine Voxeland (Chunk) to a mesh?
    2. Is there anyway to use grass such as a prefab?
    Thanks a lot
     
  20. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,837
    Thanks!
    Actually, Voxeland chunks are already the standard Unity meshes. Theoretically they could be combined, but only using the static mode. In this case I guess static batching would do the same.
    Just to mention: Voxeland chunks could not be combined in shader using instancing since they are actually different meshes, even if they share the same material.

    Well,you can use an object as a grass, but this will not incline grass meshes along the terrain. All of the grass meshes will be vertical, and I'm afraid there will be tons of them. Maybe they will be rendered fast, but placing huge amount of transforms will definitely slow down the performance.
     
  21. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,071
    Does Voxeland support splitting into separate scenes? My world is split into chunks (not voxeland chunks of course) which are individual scenes
     
  22. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    @Wright is there a new Voxeland coming out soon with the Spline tool? I was just looking at Vegetation studio and it used a spline system to punch its shape into Unity terrain.. I was thinking/hoping that between the both of you, you guys might have already made your spline tool compatible. Also Megasplat compatibility looks like it may be coming to VSP so river rock or mud blocks etc could potentially be stamped in at the same time.
     
    ftejada likes this.
  23. Xype

    Xype

    Joined:
    Apr 10, 2017
    Posts:
    339
    I have been discussing this a little with NatureManufacture (they work closely with VS guys, and use a spline system...in fact we were discussing RAM and LAVA splines) he seems to feel it should work fine, both NM and VSP are preparing for the VSP release, but afterwards they may be willing to work more directly with Denis if he has time to make sure it works smoothly.

    Here is the very brief conversation I had, I didn't want to take up their time right now they are very busy working on a new tree/foilage/rock etc pack to release along side VSP

     
  24. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,837
    I don't really know what do splines have to do with Voxeland and what way they could be used here, but if I have to choose the spline system I'll take the one from MapMagic2 (formely SplineBend).

    The only way you can split Voxeland between several scenes is to bake it by turning Voxeland script off and them manually saving chunks to different scenes. And I guess it's not what you are looking for.
     
    joshcamas and Ascensi like this.
  25. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    @Wright just a summery of a conversation we had several months ago about an alternative cave making system stamping or cutting out a cave path/road/river -you had shared that you were actually making a spline system to do this, maybe you meant it only for MM? In my project I was forced in the end to just use Voxeland with Heightmap with hand made paths but still wish Voxeland itself had this tool. After a spline is created it could be made so that the edges have a texture assigned and the running down the middle of the spline has another for example rocks and to press a button on the spline tool to paint assigned river materials (paints to normals on the x & z) , or cave materials (paints to normals on the x,y & z) -ceiling. The spline tool could have switchable profiles each with their own set of 2-3 materials/land blocks; for x & z (river, lava, path, road) and x,y & Z for caves.

    About saving chunks to different scenes maybe someone could write a code that after pressing a button could automatically switch the Voxeland script off and save each chunk to a new scene file? AND if someone makes a change to the original/master scene file that the chunks replace the old individual scene files.
     
    Last edited: Oct 22, 2018
    ftejada likes this.
  26. sparkwd

    sparkwd

    Joined:
    Aug 12, 2018
    Posts:
    12
    Hi Denis,

    First off, MapMagic and Voxeland are awesome, and I'm totally happy with the purchases. That said, I've been going back and forth with which one to use for my project for a few months and finally decided to ask you some questions. I'd prefer to use voxels just so long as Voxeland is capable of my wishful expectations. If it isn't, I'll just go back to using MapMagic alone.

    I've watched all of your tutorial videos for each asset, read through both wikis, and read most of each forum. I may have overlooked the answers to these questions, and I'm sorry if I have. I know you've already answered a million questions like this, so I'll try to keep this brief.

    1) Biomes I've read that Voxeland doesn't support biomes, and I've also read that it does. Based on your MapMagic Blending 3 Biomes Together video on YouTube, I was quickly able to blend biomes in MapMagic, but I'm having no success with Voxeland. Is there an entirely different approach required for Voxeland - or are biomes just flat out unsupported with Voxeland?

    2) Pinning Is there a way to pin/unpin terrains in Voxeland like in MapMagic, or do terrains just "become" pinned once they are edited?

    3) Block deforming/breaking Is it possible to have voxels break down and deform as they are hit? Also, could a hit counter be attached based on the voxel land type? For example, could dirt have a lower durability count than stone and require less hits?

    4) Using Voxeland as a MapMagic extension I understand trying to convert a node structure made for a MapMagic terrain over to the Voxeland output won't work. Is there a way to know which nodes are compatible with Voxeland and which ones are not?

    Thanks for your help and sorry for the long post. Again, thanks for the assets - MapMagic alone is worth the price of both.
     
  27. MakeGames2

    MakeGames2

    Joined:
    May 23, 2016
    Posts:
    82
    I'm no expert but I could try to answer some of it and maybe it might be helpful in some way.

    1. I have both assets too and they can work together if you enable integration in the settings menu. You can use them together to make different biomes but I don't believe Voxeland has biome support on it's own, though it's been awhile since I've used it on it's own.

    2. I'm not sure about pinning but I think you can do that when you use them together. I don't use that feature yet so I'm not certain about that. I'm pretty sure Voxeland stores any modified chunks but again, it's been awhile.

    3. You can detect which texture it uses and you can adjust the voxels to remove them or add new ones. I had made a script that did this at one point and event sent it over the network but it still had more work left to do. I can't find it at the moment. But you can hook into some Voxeland function to adjust it. I'm pretty sure there are examples around. Check this thread and maybe, dare I say, the Ultimate Survival thread where people had created examples of breaking it with a tool. However I'm not sure about slowly deforming it as you hit it.

    As for a durability I'm not sure that it has any way to store that or not but you probably could just store that data somewhere with the location of the voxel.

    4. I think that most of the nodes should work but they tie together different. I was told something like you have to think of it in a different way because Voxeland has height/depth to it, etc. since blocks are stored in a matrix and not just standard terrain data. You can have blocks that are lower down that can be different than blocks that are higher up. You can make caves and all sorts of neat things. It takes some experimenting to figure it out.

    He recommended to me to start with MapMagic and learn how to use it properly and then once comfortable with that throw Voxeland into the mix.

    When I was playing with them together awhile back I was having various little issues here and there and took the advise to just use MapMagic for awhile until I figure it out. I may wait until the next big releases come out of each so that I know they work together and whatnot and then try them out again together and see how it goes.
     
    sparkwd likes this.
  28. sparkwd

    sparkwd

    Joined:
    Aug 12, 2018
    Posts:
    12
    Thanks @MakeGames2 for the reply. I still have some questions, but you’ve covered almost all of them! I’m sorry, I should have mentioned that I’ve been able to use MapMagic and Voxeland together to generate standard maps with caves and such, and it’s worked great.

    For Voxeland biomes: The tutorial video Blending 3 Biomes Together works great for MapMagic alone, but I wasn’t sure how to implement it with MapMagic and Voxeland together. I tried to add Biome nodes to that tutorial’s node structure but I’m not sure where to place the Biome nodes in relation to the Voxeland Output node. Do the Biome nodes get placed prior to the input or following the output of the Voxeland Output node? Maybe there's a tutorial for a MapMagic node structure using Voxeland with biome nodes that I’ve overlooked?

    As for pinning the terrains: Although I do want to eventually add points of interest on the Voxeland terrain that would require being pinned, the main reason I asked about this was because when following along with the above mentioned tutorial, Denis pins the terrains in a 5x5 grid before adding a gradient to his Simple Form node. I realized the tutorial was clearly directed toward MapMagic users, but since I couldn’t find anything similar for Voxeland I tried to add Voxeland output to its node structure. Which doesn't work as expected because I'm obviously doing something wrong. I just thought it would work similarly in Voxeland, but then again, I have no idea since Voxeland is not technically a “blendable” terrain and therefore won't work the same due to inherent incompatibility. For all I know, Voxeland might not even support gradients using the Simple Form node.

    You answered all my questions perfectly about block deforming and breaking. And you’ve pointed me in the right direction for the last question about extending Voxeland through MapMagic. I guess my only remaining question now is what a node structure would look like if it included MapMagic nodes with a Voxeland output node and biome nodes. Thanks again for the help, @MakeGames2.
     
  29. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,837
    Thanks! Nice to hear that!

    When using Voxeland together with MapMagic you can create biomes. Obviously, there's no way to create a biome with a generator built-in in Voxeland, but it's possible with MM.

    Terrain areas are pinned only after they have been changed. Pinning MapMagic creates a new terrain, while there's no need to create new Voxeland object. But I admit that users find pin system more useful, so I'm going to use something like that in further Voxeland versions.

    You can add block durability with the help of scripting. First of all I'd like to recommend you looking through Editing terrain with scripts to get familiar with all those edit functions. Then you can try this script:
    Code (CSharp):
    1. public CoordDir prevAimCoord;
    2. public float prevAimCoordTime;
    3. public float digTime = 2; //2 seconds to dig the block
    4.  
    5. void Update ()
    6. {
    7.     Ray aimRay = Camera.main.ScreenPointToRay(Input.mousePosition);
    8.     CoordDir aimCoord = voxeland.PointOut(aimRay);  //finding coordinate under mouse cursor
    9.  
    10.     if (aimCoord.exists) voxeland.Highlight(aimCoord, voxeland.brush);  //drawing highlight
    11.  
    12.     if (prevAimCoord == aimCoord && Input.GetMouseButton(0))  //when aiming the same block and mouse is pressed
    13.     {
    14.         if (prevAimCoordTime > digTime)
    15.         {
    16.             voxeland.Alter(aimCoord, voxeland.brush, Voxeland.EditMode.dig,
    17.                 landType:voxeland.landTypes.selected,
    18.                 objectType:voxeland.objectsTypes.selected,
    19.                 grassType:voxeland.grassTypes.selected);  //digging
    20.             prevAimCoordTime = 0;
    21.         }
    22.         prevAimCoordTime += Time.deltaTime;  //timer ticking
    23.     }
    24.     else prevAimCoordTime = 0;  //reset timer when mouse is not pressed or the other block chosen
    25.  
    26.     prevAimCoord = aimCoord;  //saving currently aimed coord
    27. }
    28.  
    All of the nodes are compatible with Voxeland - except the Output nodes. Only Voxeland, Voxeland Grass and Voxeland Objects output nodes work with Voxeland. All of the other nodes could be used to generate voxel terrain. Conversion problems are mainly not the matter of nodes, but the way to use them.

    Like any other output node, like Height or Textures, Voxeland node should be placed inside the biome graph. This way you will get the number of Voxeland nodes equal to the number of biomes. All of the Voxeland nodes will be blended using the biome masks the way Height outputs are blended.
    IMHO the most convenient way to create a map with biomes is to create graphs for each of the biomes first (just a planar graphs with no biome nodes). And once you are happy with your biomes create a parent graph with biomes stored in Biome node, and blend them the way you like. This works both in MM and Voxeland.
    Hope it helps.
     
    sparkwd likes this.
  30. sparkwd

    sparkwd

    Joined:
    Aug 12, 2018
    Posts:
    12
    Excellent - thanks a ton for the detailed response @Wright! That clears up all of my confusion. I may be back to ask more questions further on down the road, but this is plenty to go on for now. Good luck finishing up MapMagic 2! Can't wait to see what else you have planned for these assets.
     
  31. rmorph

    rmorph

    Joined:
    Apr 3, 2012
    Posts:
    86
    Hi I've had map magic and voxeland for a while and would be really interested in seeing a tutorial or getting some help on creating lumps - ala "voxelump". DO I understand right that this is a script or plugin for voxeland?
     
  32. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,837
    It's just my plans for the new asset. "Voxelump" doesn't exist - at least yet. It's just some thoughts of where to move next, not even announcement.
     
  33. joshua1232

    joshua1232

    Joined:
    Jan 18, 2014
    Posts:
    6
    Hey,

    I just started using this asset. I am loving it so far, it really is very helpful. However, I am wondering if it is possible to change the size of the voxels themselves? For example, I would like the size of the voxels to be half the size that they currently are, is there an easy solution?

    Thanks so much for the great asset!
     
  34. hongtm

    hongtm

    Joined:
    May 22, 2018
    Posts:
    20
    Hello,
    I have problem with the texture array.
    1. I change the texture array.
    2. Some old material is broken (black)
    3. I replace them with a new one
    4. When I restart the unity, it's revert to the older

    Have another way to reset the texture?
    I use Voxeland Infinity, Megasplat and Speedtree
     
  35. Loki18000

    Loki18000

    Joined:
    Apr 1, 2015
    Posts:
    41
    Hello, I'm thinking about buying Voxeland. I've been playing around with the Demo version. It seems really powerful I also know that the Subnautica game uses the plugin too.

    I wanted to know, is there a way to make the map flat in some areas? Or is that the purpose of the Smooth brush? Does look like it would be pretty hard to get some NPC's moving around on these maps though.

    Thanks.
     
  36. Bodyclock

    Bodyclock

    Joined:
    May 8, 2018
    Posts:
    145
    Hi, in my previous project I was using a procedural workflow that used Map Magic, Megasplat and Vegetation Studio. I'm starting to plan for the next project and am thinking of adding Voxeland to the mix and upgrading to Vegetation Studio Pro. So just a few of questions:

    1. Do you think this is a viable workflow? Are the integrations of Megasplat and VS in MM capable of driving a procedurally generated terrain in Voxeland?
    2. Is there integration in MM for Vegetation Studio Pro and would/will it be a good fit with Voxeland?
    3. Should I wait for MM2? Will it contain the required integrations and will it offer features that could support this new workflow (I'm thinking of the new Function nodes and per channel masks).
    4. Is there an ETA for MM2

    Thanks for your time.
     
  37. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,837
    Sure, you can scale Voeland object up or down to change the voxel size.

    There's no level brush in Voxeland: when using 2D (or 2.5D) terrain such a leveling tool is rather easy to implement - all of the edited pixels are within the brush range. But it becomes more complicated when using voxels - imagine a brush 5*5 voxels used to flatten land at the height of 10 - you will need to change the voxels that are outside the brush, lower or higher. I can't say it could not be done, but this will require changing a bit of core things, so don't expect it soon.

    VS Pro is a different asset rather than VS, and both MM and Voxeland do not have it's support - at least yet. But I guess I will add it after MM2 release. And speaking of it I don't have ETA - I want to be absolutely happy with the asset I'm creating before releasing it, it's hard to say for sure when it happen.
     
    P_Jong likes this.
  38. hongtm

    hongtm

    Joined:
    May 22, 2018
    Posts:
    20
    Hey Wright,
    You not answer my question. How to reset texture when I change texture array?
     
  39. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    @Wright VSP now has mesh support but I haven't been able to test it with Voxeland yet.. I'm currently getting this error on a new project in 2018.3.0b9 "Assets\Voxeland\Main\BlockType.cs(117,11): error CS0246: The type or namespace name 'MegaSplatTextureList' could not be found (are you missing a using directive or an assembly reference?)"

    I'm thinking your asking "how do I see the change in Voxeland if I change a texture in the array?" Answer Hit the rebuild button at the top if you've updated your texture array.
     
  40. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,837
    You mean VS Pro? It should not work neither with Voxelenad nor with MM.
    Try resetting Scripting Defile Symbols in Edit - Project Settings - Player by erasing everything in line.

    Sorry, missed it. But your question raises more questions - I'd like to clarify some things if you don't mind:
    What exactly are you changing? What is the way you change it? Are you doing it by directly selecting texture array in inspector? If so, try using Voxeland's Blocks menu instead.
    Do you mean you create a new material and assign it to Voxeland? Or how and what do you replace with a new one?
    If you are talking about texture array - you can reset it by pressing "Reload from Sources" button.
     
  41. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    @Wright Hi Denis just had an idea for Voxeland triangles to become GPU instances. Imagine, a card memory game, if you find one or more matches the cards flip and disappear. In the case with Voxeland if the same texture gets added to one or more triangles it automatically is converted/merged into instances.
    Non textured areas would start off as being generated from one instance and as you paint, matching patterns become their own instance. The problems that might arrise to do this might be pattern recognition and how to manage collider generation.

    I guess Voxeland might have to be rewritten if you tried something like this.. making each triangle a GPU instance/chunk, but hey now there would be even more control over culling and culling speed rather than LOD.

    Anyway, just an idea -might be insane to do.. who knows lol
     
  42. fastbomb

    fastbomb

    Joined:
    Jun 28, 2013
    Posts:
    26
    I am really interested in buying this Asset. It looks great! A couple of quick questions though.. Does a voxel in Voxeland have a specific measurement? Would it be possible to set each voxel [face] to be 1m²?

    Super curious. Any information would be greatly appreciated.
     
    Last edited: Nov 28, 2018
  43. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,837
    Thanks for sharing an idea! I don't get it quite clear, but making each triangle an instance doesn't seems to be a very performance-friendly approach. Anyways, I appreciate your advice!

    Sure, you can scale the Voxeland object up or down to change the block size
     
  44. fastbomb

    fastbomb

    Joined:
    Jun 28, 2013
    Posts:
    26
    Tx for the info. I will give it a shot.

    Anyone have an example of something that looks a little less stepped and stamped with nice slopes?
     
    Last edited: Nov 29, 2018
  45. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,535
    So I asked this in 2016
    And you said..
    So I didn't Voxelplay back then, not sure how much of that stuff happened and what future plans are now, its come up again and I'm sort of re evaluating the smooth voxel options as it seemed things here were more focused on MapMagic, are things coming back to Voxelplay now?

    In similar question to my post in uTerrains https://forum.unity.com/threads/ute...xel-terrain-engine.383959/page-7#post-3937819 does Voxeplay have tooling improvements for working with terrain in a more creative and less node graph approach (which seems to be the focus?) and does it support doing patches of terrain that are on separate gameobjects something that could be done on different scenes?

    Cube blocks aren't support? ie 7days days to die? Future improvements with Unity's new tech coming?
     
  46. Wright

    Wright

    Joined:
    Feb 26, 2013
    Posts:
    1,837
    And every each item from the list was implemented, wasn't it?

    I can't say Voxeland is designed for node graph approach. Except the integration with MapMagic it has no nodes at all. If you have any tool ideas - feel free to share them.

    If it will be ever made it will be the other plugin called "Voxelump" or "Voxelith" or something. It's just a thought, I can't say if it will be really made.

    It's a point of Voxeland - it creates the smooth blocks terrain.

    The integration with shader node editor, full-scale LWRP and HDRP support are planned. Possibly jobs support.
     
  47. Junya-Ogihara

    Junya-Ogihara

    Joined:
    Sep 20, 2017
    Posts:
    1
    I recently started using this tool. Since there are some problems, please cooperate with problem solving.
    Registered land blocks are referenced from VOXELAND,

    test1.jpg
    test2.jpg
    test3.jpg
    the registered No. 1 and No. 2 are overlapped.

    This is a fatal bug.
    I am developing a game for DX 11 of Windows 10.

    test4.jpg
    Although 24 types of block types can be used in the manual, only 4 can actually be registered. In addition, there are three kinds of land blocks that can be used with VOXELAND for the above bugs. There is a mistake in specifying the reference number.
    Please fix it quickly.


    I would like to use more than 4 block types. However, development itself has no problem.
    I am glad if I can use it in the future.
    Please fix a fatal bug. Thank you.
     
  48. Dust-Cloud

    Dust-Cloud

    Joined:
    Sep 3, 2014
    Posts:
    9
    What is the timeline for the HDRP support?
     
  49. Ascensi

    Ascensi

    Joined:
    Sep 7, 2013
    Posts:
    579
    @Wright making each mesh triangle a GPU instance could offer giant performance if textured and non textured triangles are matched and merged as their own single instance, I don't know if I can explain it clearer than that. It's like purposely matching pixels, once a match has been made the pixel becomes an instance that can be used to create the rest of the picture with a smaller file/loading & rendering size

    It's almost like how compressed video works.. find all black areas and remove them.. but in this case make it an instance that gets used elsewhere. Not only GPU instancing for performance but also easy hiding/disable mesh render of areas/triangles out of sight and the triangles with normals facing away from the camera. If finite control over mesh triangles were to be established then Dynamic Occlusion culling can cull more unseen areas on the area size of what would be a chunk -polygonal culling rather than a whole chunk. So polygonal culling could remove all chunks plus areas unseen on a chunk the player is on!
     
    Last edited: Nov 30, 2018
  50. Inicus-Qvist

    Inicus-Qvist

    Joined:
    Mar 12, 2015
    Posts:
    8
    Has anyone been able to get a low poly look for Voxeland? Intuitively I didn't think it would be a matter of shaders but mesh creation. "Low poly" terrain doesn't actually require fewer polygons but hard edges instead of soft edges, and that can be a feature of a mesh. I was able to create a low poly look in Cubiquity by editing the MeshConverter.cs:
    Low-Poly_Voxel0.png

    But Cubiquity has huge performance hits with real-time voxel editing, and it is defunct now as well, no longer supported. Is something like this possible with Voxeland? I believe Cubiquity uses Marching Cubes.

    If you want to know how I did this for Cubiquity, here is the code:
    Code (CSharp):
    1. bool smoothEdges = false;
    2.                 if(smoothEdges || onlyPositions)
    3.                 {
    4.                     // Cubiquity uses 16-bit index arrays to save space, and it appears Unity does the same (at least, there is
    5.                     // a limit of 65535 vertices per mesh). However, the Mesh.triangles property is of the signed 32-bit int[]
    6.                     // type rather than the unsigned 16-bit ushort[] type. Perhaps this is so they can switch to 32-bit index
    7.                     // buffers in the future? At any rate, it means we have to perform a conversion.
    8.                     int[] indicesAsInt = new int[noOfIndices];
    9.                     for (int ct = 0; ct < noOfIndices; ct++)
    10.                     {
    11.                         indicesAsInt[ct] = indices[ct];
    12.                     }
    13.  
    14.                     // Clear any previous mesh data.
    15.                     mesh.Clear(true);
    16.  
    17.                     // Create the arrays which we'll copy the data to.
    18.                     Vector3[] positions = new Vector3[noOfVertices];
    19.                     Vector3[] normals = new Vector3[noOfVertices];
    20.                     Color32[] colors32 = new Color32[noOfVertices];
    21.                     Vector2[] uv = new Vector2[noOfVertices];
    22.                     Vector2[] uv2 = new Vector2[noOfVertices];
    23.  
    24.                     // Copy the vertex positions from Cubiquity into the Unity mesh.
    25.                     for (int ct = 0; ct < noOfVertices; ct++)
    26.                     {
    27.                         // Get and decode the position
    28.                         positions[ct].Set(vertices[ct].x, vertices[ct].y, vertices[ct].z);
    29.                         positions[ct] *= (1.0f / 256.0f);
    30.                     }
    31.                     // Assign vertex data to the mesh.
    32.                     mesh.vertices = positions;
    33.  
    34.                     // For collision meshes the vertex positions are enough, but
    35.                     // for meshes which are rendered we want all vertex attributes.
    36.                     if(!onlyPositions)
    37.                     {
    38.                         for (int ct = 0; ct < noOfVertices; ct++)
    39.                         {
    40.                             // Get the materials. Some are stored in color...
    41.                             colors32[ct].r = vertices[ct].m0;
    42.                             colors32[ct].g = vertices[ct].m1;
    43.                             colors32[ct].b = vertices[ct].m2;
    44.                             colors32[ct].a = vertices[ct].m3;
    45.  
    46.                             // And some are stored in UVs.
    47.                             uv[ct].Set(vertices[ct].m4 / 255.0f, vertices[ct].m5 / 255.0f);
    48.                             uv2[ct].Set(vertices[ct].m6 / 255.0f, vertices[ct].m7 / 255.0f);
    49.  
    50.                             // Get and decode the normal
    51.                             ushort ux = (ushort)((vertices[ct].normal >> (ushort)8) & (ushort)0xFF);
    52.                             ushort uy = (ushort)((vertices[ct].normal) & (ushort)0xFF);
    53.  
    54.                             // Convert to floats in the range [-1.0f, +1.0f].
    55.                             float ex = ux * (1.0f / 127.5f) - 1.0f;
    56.                             float ey = uy * (1.0f / 127.5f) - 1.0f;
    57.  
    58.                             // Reconstruct the origninal vector. This is a C++ implementation
    59.                             // of Listing 2 of http://jcgt.org/published/0003/02/01/
    60.                             float vx = ex;
    61.                             float vy = ey;
    62.                             float vz = 1.0f - Math.Abs(ex) - Math.Abs(ey);
    63.  
    64.                             if (vz < 0.0f)
    65.                             {
    66.                                 float refX = ((1.0f - Math.Abs(vy)) * (vx >= 0.0f ? +1.0f : -1.0f));
    67.                                 float refY = ((1.0f - Math.Abs(vx)) * (vy >= 0.0f ? +1.0f : -1.0f));
    68.                                 vx = refX;
    69.                                 vy = refY;
    70.                             }
    71.                             normals[ct].Set(vx, vy, vz);
    72.                         }
    73.                         // Assign vertex data to the mesh.
    74.                         mesh.normals = normals;
    75.                         mesh.colors32 = colors32;
    76.                         mesh.uv = uv;
    77.                         mesh.uv2 = uv2;
    78.                     }
    79.  
    80.                     // Assign index data to the mesh.
    81.                     mesh.triangles = indicesAsInt;
    82.                 }
    83.                 else if(!smoothEdges)
    84.                 {
    85.                     // Cubiquity uses 16-bit index arrays to save space, and it appears Unity does the same (at least, there is
    86.                     // a limit of 65535 vertices per mesh). However, the Mesh.triangles property is of the signed 32-bit int[]
    87.                     // type rather than the unsigned 16-bit ushort[] type. Perhaps this is so they can switch to 32-bit index
    88.                     // buffers in the future? At any rate, it means we have to perform a conversion.
    89.                     int[] indicesOriginal = new int[noOfIndices];
    90.                     for (int ct = 0; ct < noOfIndices; ct++)
    91.                     {
    92.                         indicesOriginal[ct] = indices[ct];
    93.                     }
    94.                     int[] indicesAsInt = new int[noOfIndices];
    95.  
    96.                     // Clear any previous mesh data.
    97.                     mesh.Clear(true);
    98.  
    99.                     // Create the arrays which we'll copy the data to.
    100.                     Vector3[] positionsOriginal = new Vector3[noOfVertices];
    101.                     Vector3[] flatPositions = new Vector3[noOfIndices];
    102.                     Vector3[] normals = new Vector3[noOfVertices];
    103.                     //Vector3[] flatNormals = new Vector3[noOfIndices];
    104.                     Color32[] colors32 = new Color32[noOfVertices];
    105.                     Color32[] flatColors = new Color32[noOfIndices];
    106.                     Vector2[] uv = new Vector2[noOfVertices];
    107.                     Vector2[] flatUv = new Vector2[noOfIndices];
    108.                     Vector2[] uv2 = new Vector2[noOfVertices];
    109.                     Vector2[] flatUv2 = new Vector2[noOfIndices];
    110.  
    111.                     // Copy the vertex positions from Cubiquity into the Unity mesh.
    112.                     for (int ct = 0; ct < noOfVertices; ct++)
    113.                     {
    114.                         // Get and decode the position
    115.                         positionsOriginal[ct].Set(vertices[ct].x, vertices[ct].y, vertices[ct].z);
    116.                         positionsOriginal[ct] *= (1.0f / 256.0f);
    117.                     }
    118.                     for (int ct = 0; ct < noOfIndices; ct++)
    119.                     {
    120.                         // Get and decode the position
    121.                         flatPositions[ct].Set(vertices[indicesOriginal[ct]].x, vertices[indicesOriginal[ct]].y, vertices[indicesOriginal[ct]].z);
    122.                         flatPositions[ct] *= (1.0f / 256.0f);
    123.                         indicesAsInt[ct] = ct;
    124.                     }
    125.                     // Assign vertex data to the mesh.
    126.                     mesh.vertices = flatPositions;
    127.  
    128.                     // For collision meshes the vertex positions are enough, but
    129.                     // for meshes which are rendered we want all vertex attributes.
    130.                     if(!onlyPositions)
    131.                     {
    132.                         for (int ct = 0; ct < noOfVertices; ct++)
    133.                         {
    134.                             // Get the materials. Some are stored in color...
    135.                             colors32[ct].r = vertices[ct].m0;
    136.                             colors32[ct].g = vertices[ct].m1;
    137.                             colors32[ct].b = vertices[ct].m2;
    138.                             colors32[ct].a = vertices[ct].m3;
    139.  
    140.                             // And some are stored in UVs.
    141.                             uv[ct].Set(vertices[ct].m4 / 255.0f, vertices[ct].m5 / 255.0f);
    142.                             uv2[ct].Set(vertices[ct].m6 / 255.0f, vertices[ct].m7 / 255.0f);
    143.  
    144.                             // Get and decode the normal
    145.                             ushort ux = (ushort)((vertices[ct].normal >> (ushort)8) & (ushort)0xFF);
    146.                             ushort uy = (ushort)((vertices[ct].normal) & (ushort)0xFF);
    147.  
    148.                             // Convert to floats in the range [-1.0f, +1.0f].
    149.                             float ex = ux * (1.0f / 127.5f) - 1.0f;
    150.                             float ey = uy * (1.0f / 127.5f) - 1.0f;
    151.  
    152.                             // Reconstruct the origninal vector. This is a C++ implementation
    153.                             // of Listing 2 of http://jcgt.org/published/0003/02/01/
    154.                             float vx = ex;
    155.                             float vy = ey;
    156.                             float vz = 1.0f - Math.Abs(ex) - Math.Abs(ey);
    157.  
    158.                             if (vz < 0.0f)
    159.                             {
    160.                                 float refX = ((1.0f - Math.Abs(vy)) * (vx >= 0.0f ? +1.0f : -1.0f));
    161.                                 float refY = ((1.0f - Math.Abs(vx)) * (vy >= 0.0f ? +1.0f : -1.0f));
    162.                                 vx = refX;
    163.                                 vy = refY;
    164.                             }
    165.                             normals[ct].Set(vx, vy, vz);
    166.                         }
    167.  
    168.                         for (int ct = 0; ct < noOfIndices; ct++)
    169.                         {
    170.                             flatColors[ct] = colors32[indicesOriginal[ct]];
    171.                             flatUv[ct] = uv[indicesOriginal[ct]];
    172.                             flatUv2[ct] = uv2[indicesOriginal[ct]];
    173.                         }
    174.                         // Assign vertex data to the mesh.
    175.                         //mesh.normals = normals;
    176.                         mesh.colors32 = flatColors;
    177.                         mesh.uv = flatUv;
    178.                         mesh.uv2 = flatUv2;
    179.                     }
    180.  
    181.                     // Assign index data to the mesh.
    182.                     mesh.triangles = indicesAsInt;
    183.                     mesh.RecalculateNormals();
    184.                 }
     
unityunity