Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Cubiquity - A fast and powerful voxel plugin for Unity3D

Discussion in 'Assets and Asset Store' started by DavidWilliams, Jun 2, 2013.

  1. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    Very cool, I was not aware of that project. You have a couple of options:

    1. If the source code is just small (a few files) you could include it directly with the example. The license is MIT so this is possible, but of course then it won't get automatically updated. Plus, if someone already has this node editor asset in their project and they import Cubiquity there will be duplicate code and conflicts. You could change the namespace though. Basically this approach is easiest if the code is small (can remove examples).
    2. Disable the example by default until the user manually enables it? Or maybe detect this via an #ifdef (not sure what C# makes possible here). Or can you 'catch'/handle the build error with a custom error message? This stuff is not really possible in C++, but C# is a little higher level so maybe there is a way?
    3. Have the Cubiquity example code actually download the library?! That seems kind of crazy. What about Git submodules? Complicated I think.
    You'll have to do some thinking on this to work out is it is practical... maybe just see if you get something interesting working first.

    Already done :) The plugins are no longer pulled from 'Streaming Assets' but instead just put in a plugins folder. Only tested on Windows so far.

    Great, it looks very interesting!
     
    Mikael-H likes this.
  2. alistairroe

    alistairroe

    Joined:
    Mar 11, 2016
    Posts:
    1
    If anyone can help out with this problem, that would be great.

    I am attempting to modify my voxel grid using multiple C# threads. On calling SetVoxel from any thread, the entirety of Unity crashes. Thinking the issue was a concurrent access problem, I changed my code to only create 1 thread, which would solely modify the voxel grid. However, this still causes crashes. If I run my modification function in the main Unity thread, no such problem exists - this indicates to me that the problem is not with my modification code, but with the interaction between multiple threads and the Cubiquity backend.

    Has anyone had any experience with this, and can help me out? It works only using the main thread, but I'd like to speed things up if I can (or at least decouple them from the main render thread).
     
  3. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    I'm sorry, but unfortunately Cubiquity is not thread safe in this regard so you need to make all your calls from the same thread. The main thread is already used for reading back the voxel data when doing the surface extraction, so the main thread also needs to be used for writing to the volume.

    Obviously it would be desirable to fix this but it won't happen for Cubiquity version 1. Cubiquity 2 will have a simpler code base so it makes more sense to address it then.
     
  4. AaronC5513

    AaronC5513

    Joined:
    Oct 31, 2015
    Posts:
    5
    I`m having difficulty getting started with this asset. I am getting an error because the Region class does not have a constructor with 6 arguments. Is there an updated version somewhere? If not how can I fix it?
     
  5. CTPEJIOK22

    CTPEJIOK22

    Joined:
    Sep 4, 2013
    Posts:
    85
    really great asset! i spent a lot of time playing with voxels, its really fun.

    one question - i read all posts from begining, but didnt find solution to working with phisics. for example, i want to achive falling roof after destroing the walls. any chance to make it with simple volume or splitting to pieces?
     
  6. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    It ain't gonna be easy :) You'll need to figure out for yourself that the piece is disjoint. This can be done with a breadth first search algorithm or something similar. Maybe you could simplify it to a depth first to a certain depth?

    Then you will have to construct a convex mesh collider for the rigidbody of the falling object. Maybe you could use a giftwrapping algorithm for the point cloud?

    I've never done anything like this myself so all of this is pretty much guesswork, except the first part. It ain't gonna be no walk in the park :)
     
    CTPEJIOK22 likes this.
  7. CTPEJIOK22

    CTPEJIOK22

    Joined:
    Sep 4, 2013
    Posts:
    85
    thanks, man. i understand this and think about solution. some other engines support this feature, so, maybe anyone know typical algorythm. first idea - split model to pieces, like walls, roof, door, then search at them broken parts, it shoudn less cpu, than at one volume.or make new array of "objects" at volume and search only at them.
     
  8. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    I think the hard part is actually finding a good way to determine that a piece of geometry is no longer connected. It might be best to implement this c++ side (maybe @DavidWilliams could give more input on this). Not super hard though, just a DFS to a maximum depth should be sufficient. Once you have determined that a part has come loose the intresting part would begin. The most simple implementation (might be good enough for most purposes) would be to construct a convex hull from the point cloud generated by the voxel positions. This seems to be a well researched topic: https://en.wikipedia.org/wiki/Convex_hull_algorithms

    I have a better idea though... I strongly doubt this has been done before. Take the points cloud as a 3D dataset. Determine the most significant axis of variation through principal component analysis (this can be done using mathNet numerics (http://numerics.mathdotnet.com/). Now split the point cloud along the plane that is perpendicular to this axis and that is positioned at the median point along it. Rinse and repeat some number of times. This should generate a non-convex set of several convex hulls that just might fool an observer well enough... Just an idea, couldn't let this one go hehe :D
     
    CTPEJIOK22 likes this.
  9. CTPEJIOK22

    CTPEJIOK22

    Joined:
    Sep 4, 2013
    Posts:
    85
    sounds interesting, need to find more info about this. thanks a lot.
     
  10. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    I can help you with the mathsy stuff, using principal component analysis (PCA) and such. PCA built my avatar picture as described in the thread in my sig about my master thesis :) But it isn't a very advanced concept per se, my idea is best described in the image in the top left of this wikipedia article, https://en.wikipedia.org/wiki/Principal_component_analysis
    you can see a point cloud and the longest arrow is the principal axis. This is the one we want to find and use to divide the set along. Let me know if you actually start working on somthing like this :) It would be cool to add this to the github repo!
     
  11. CTPEJIOK22

    CTPEJIOK22

    Joined:
    Sep 4, 2013
    Posts:
    85
    thanks, man. im searching a simple solution for my game-prototype, maybe, using a simple walls for destructions. you ideas really great, looks very complex.
     
  12. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    Haha yeah in that case stick to the basics, they'll be good enough I'm sure!
     
  13. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    What does your Region constructor look like? It should look like this:
    Note that it has a constructor with six arguments. You should use the latest version from the Asset Store and test on Unity 5.3 if you can. Make an empty test project in case it is some other asset interfering?

    @CTPEJIOK22, @Mikael H - Detecting and rendering chunks which become seperated is indeed a difficult problem which I haven't tackled yet. But is should be possible, even Ken Silverman's Voxlap engine handles that nicely and it is more than 10 years old. That used raycasting though, which makes things easier. A couple of things to consider if you try it in Cubiquity:
    1. When detecting the disconnected chunk, I don't think you need a fully 3D breadth-first search. I *think* it is enough to search along surface voxels, which reduces the problem from O(n^3) to O(n^2).
    2. I wouldn't bother meshing the disconnected voxels. Just keep a list of them (again, only the surface ones) and spawn mesh containing a list of these cubes. You'll probably only have a couple of these disconnect chunks in play at a time so this should be sufficient and easier.
    It might make sense to do some of this in C++ and it would be fun to play with in the future, but it won't happen for a long time as I have other stuff to entertain me :)
     
    CTPEJIOK22 likes this.
  14. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    Right... and if you only search around the surface then you can build a point cloud using only surface voxels too... Damn I think I was just brought back to school... :)
    Yeah you got big fish to fry I am sure, can't wait to see what you come up with! Good thinng then that anyone who knows a bit of c++ could have a go at this thanks to the new MIT license :D... Maybe I'll even dust off some of my old c++ books and try it out myself...
     
  15. Narmer

    Narmer

    Joined:
    Mar 5, 2014
    Posts:
    25
    Hello, I would like to ask you how can I determine when the terrain is loaded so I can make something like a loading screen that will disappear when everything is ready.
     
  16. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    When the terrain finishes an update of its geometry (this means it has also created colliders) then it fires the OnMeshSyncComplete event. So right when starting the game out you want to handle this event the first time it is fired.

    volume.OnMeshSyncComplete += HandleTerrainUpdated;
     
    DavidWilliams likes this.
  17. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    @DavidWilliams I am experiencing a strange bug when digging through my smooth terrain. As you can see in the image, there are areas that are never removed. I can't figure out why... My knowledge of marching cubes is not strong but should formations like these be able to appear? Note that my voxels are 1x1x1m in size and the character lying dead on the ground is about 1.5m tall.

    I was thinking that if these are formations that should not be able to appear with marching cubes then this is probably not a bug that I introduced but if they are valid then it is probably my fault :) So what do you think?


    2016-03-16.png

    Ohh... And sometimes it can even produce a very thin "pillar" like seen in this image:

    2016-03-16 (2).png
     
  18. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    It's only because I spend half my life thinking about this stuff :) I've seen plenty of ideas from other people too.

    They certainly look odd, but I think they are valid (though I haven't seen them myself). I suspect such a thin structure could occur when voxel values are very near to the threshold. Perhaps there could be an off-by-one error in the digging code, or an off-by-one error between the threshold used for the raycasting vs. the threshold used for the surface extraction? These would probably be bugs in Cubiquity. But I would say the actual rendering and mesh extraction is probably correct.

    Were you digging using Cubiquity's build in digging tool or your own? Maybe try clamping values to 0 or 255 to see how it changes? Overall I agree that density field can be very confusing - I had a tough time with the procedural generation example!
     
    Mikael-H likes this.
  19. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    Update: Cubiquity is now fully open source under the MIT license

    Hi guys, I've been promising it for ages, but the entire tech stack behind Cubiquity for Unity3D is now open source under the MIT license! You can read more in the blog post:
    I specifically draw your attention to the note for Unity users:

    Also, as indicated previously, this version of Cubiquity is no longer being actively developed. A new Cubiquity version 2 is currently being prototyped but it will be a few months before we are showing that off.
     
    CTPEJIOK22 and Mikael-H like this.
  20. renlid

    renlid

    Joined:
    Mar 31, 2016
    Posts:
    1
    Hi there,

    I am willing to create an indie game:
    - Cube-based buildings that can be created piece by piece (for base-management features of the game)
    - Cube-based characters and weapons (smaller cubes, for higher definition, like in the "Vox" game/engine)
    - Either cube-based or any other technique for terrain
    - Optionally destructible terrain (not mandatory)
    - Ideally destructible buildings
    - Ideally a cube would be divided in like 16x16x16 "inner cubes", which would allow for both simulating a texture, and break a cube "inner cube by inner cube" (for creating smooth and random-shape holes in walls, for example)
    - Therefore a LOD for cubes (so that very distant cubes are only 1 surface, not 16x16)
    - Ideally the map would be predefined (I will adapt to the format needed by the engine)
    - Ideally the map could be potentially huge, and would load chunk by chunk (like in World of Warcraft)
    - Water to swim in
    - Dynamic lighting
    - Ideally fog

    Is it something that Cubiquity can handle? I heard about it in Reddit, and it looks really great!

    Thank you guys :)
     
  21. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    Hi @renlid - be sure to check out the examples, they should give you a good idea of what Cubiquity can do.

    Yep, no problem

    Cubiquity only handles the rendering of the map/world, not characters or weapons (use standard Unity meshes for those).

    Both cube-based and Marching-cubes terrain are supported.

    Yep, check the demos for examples of this.

    Cubiquity does not differentiate between the building and the terrain (like Minecraft). Therefore both are destructible.

    No, but you can implement such logic on top of Cubiquity.

    Unfortunatly this is not provided.

    Yep, predefined maps are loaded from voxel database files.

    Not really, the map size if quite limited as the whole thing is loaded into memory at once.

    These are not really related to voxels so Cubiquity does not do anything special with them. Just use standard Unity approaches.
     
  22. svk2140

    svk2140

    Joined:
    Apr 4, 2016
    Posts:
    1
    Really create city builder simulator in that engine? As I understand it, a limit of 10 million voxels?
    Retry-style 3D* and territory as at sities skylines at least 5/100 :)
     
    Last edited: Apr 5, 2016
  23. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    The largest city I have tried is 512 x 512 x 64 = 16,777,216 voxels, which is probably not enough to create a real city simulator.

     
  24. Steel WorksDigital EngineSpark

    Steel WorksDigital EngineSpark

    Joined:
    May 13, 2016
    Posts:
    4
    How can I import my vxl files into Cubiquity? i`ve tried and nothing seems to work. what do I have to do for my vxl to be converted to VDB?
     
  25. JonnyHilly

    JonnyHilly

    Joined:
    Sep 4, 2009
    Posts:
    749
    Steel, do you have any more info on where you are importing your data from, and how, and what platform ?

    I used Magica Voxel program to create the file, then follow docs here, using command line tool to convert...... after getting it to work once... make a small batch file to make things easier next time... http://www.cubiquity.net/cubiquity-for-unity3d/1.0/docs/page_obtaining_vol_dat.html ...but note... the tool only worked for me on a PC, not on a Mac, so I had to convert on a pc, then transfer it back to mac to use it. (not an issue if you are on PC already)

    also check here... http://www.cubiquity.net/cubiquity-for-unity3d/1.0/docs/page_user_interface.html#secAddVolumes
    read very carefully.. took me a while and a few attempts also to get any data showing up properly in unity.
     
    Last edited: May 13, 2016
    gashadokuro likes this.
  26. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    Like @JonnyHilly says we will need more details - what have you tried and what error messages, etc did you get? What platform are you on? As stated in the documentation, the command should be:

    It's probably easiest to place input.vxl in the same folder as ProcessVDB.exe.

    P.S. I saw your posts on YouTube, the blog etc but it takes me a little while to reply. This Unity forum is the best place for questions as there are other Cubiquity users.
     
  27. Steel WorksDigital EngineSpark

    Steel WorksDigital EngineSpark

    Joined:
    May 13, 2016
    Posts:
    4
    Screenshot (144).png So when I import my vxl file named "TokyoNeon" into the "ProcessVDB" I get this error.
    Error code 120. system specs
    intel core i3 2328M CPU @2.20GHz
    intel HD 5000 Graphics
    8GB RAM DDR3
    500GB HDD Space
    P.S. Will be upgrading to a newer pc later this year.
     
    Last edited: May 15, 2016
  28. JonnyHilly

    JonnyHilly

    Joined:
    Sep 4, 2009
    Posts:
    749
    The error message (in your screenshot) looks like it's trying access data outside of the valid volume. How big is your voxel map? Is it bigger than max allowed for cubiquity? Is there internal max size in cubiquity? or maybe your pc has a memory issue converting large maps... have you tried a small test map ?
     
    Last edited: May 17, 2016
  29. JonnyHilly

    JonnyHilly

    Joined:
    Sep 4, 2009
    Posts:
    749
    Hi David, I've been using Mac so far. But transferred over to pc yesterday to try a pc build and the cubiquity shader is failing... its all pink. I have a quad i7 2600 64bit pc with nvidia gtx 560 Ti card. It's a fresh unity5 install also. I don't have any gfx emulation turned on. Default forward rendering pipeline. Any idea why the shader is falling down on pc please?
    A friend also reported pink on his older macBook, so I put that down to his machine being older (it runs fine on my newer macBook) but now I'm not so sure, maybe its something else going on ?


    ok, a clue... shader error says...
    cannot map expression to pixel shader instruction set. d3d9 56

    which is this...
    float3 volumeNormal = normalize(cross(ddx(IN.volumePos.xyz), ddy(IN.volumePos.xyz)));
    ...
    and breaking it down more... something on here...
    float3 volumeNormal = cross(ddx(IN.volumePos.xyz), ddy(IN.volumePos.xyz));

    ...update....
    ok so for the shader issue... if shader compile target is shader model 3, it works fine, on a model3 card. If target is model 2, then it may or may not work depending on if the vid card supports the ddx and ddy commands it seems. If I figure out a soln, I'll post something. Also it looks like the noise function could come out of the pixel shader, into the vertex shader perhaps.
     
    Last edited: May 18, 2016
  30. Steel WorksDigital EngineSpark

    Steel WorksDigital EngineSpark

    Joined:
    May 13, 2016
    Posts:
    4
    I tested it with a small map, and it still gives me the "volume out of error"
     
  31. Steel WorksDigital EngineSpark

    Steel WorksDigital EngineSpark

    Joined:
    May 13, 2016
    Posts:
    4
    my maps around 15,000 voxels including buildings, terrain and roads.
     
  32. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    This is correct, and I don't think there is an easy solution to it. If you can't compute normal in the pixel shader then you would have to do it on the CPU and upload them, which would need some significant changes. Even shader model 3 is pretty old though!

    I think there are at least two points here. Firstly, the .vxl importer probably only works with files for the game 'Build and Shoot'. The file format for the commercial 'Ace of Spades' game might be different and I have never tested it. Secondly, the maps need to be exactly 512x512x64, which I believe all Build and Shoot maps are. Obviously this is not so flexible but I just wrote it as a way of getting some test data.

    Do test with one of the sample .vxl files that comes with Cubiquity to see if the process works for you, and then have a look on the build and shoot forums for more data.
     
  33. JonnyHilly

    JonnyHilly

    Joined:
    Sep 4, 2009
    Posts:
    749
    yep, reached the same conclusion. and confirmed with a friend who does more shader coding than me.
    I wonder if there is a way to detect this... so game can fail gracefully, heh
     
  34. aknotsdeath

    aknotsdeath

    Joined:
    May 20, 2016
    Posts:
    2
    Hello not sure where to post this new to forums and game development. So I have been watching videos for about the past month and have done a little stuff around in unity and I am getting ready to start on my first project. want to use Cubiquity however I am not sure how to begin. For example how do I make it procedural generate terrain?
     
  35. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    Hi, I'm not sure Cubiquity is the best place to start if you are new to Unity as you might find the system fairly complex. It's probably worth getting some general Unity experience first and writing a game or two.

    However, when you do start with Cubiquity I would recommend working with the Colored Cubes volumes rather than the Terrain volumes. They are much easier to understand and more future-proof.

    Cubiquity primarily works by loading volumes from disk rather than procedurally generating them. However you can generate them from code if you wish. The maze example shows how to create them from an image (using code), and if you understand the concepts behind procedural generation (not Cubiquity-specific) then you should be able to adapt this.
     
  36. JonnyHilly

    JonnyHilly

    Joined:
    Sep 4, 2009
    Posts:
    749
    This gets a bit more confusing... I added a .php logger to game, so I can track video cards that fail with the vox shader.. Seems like even shader model 4.1 can fail. (friends older macbook pro) , my macbook is also 4.1 but slightly newer but works fine. This is with vox shader set for 3.0 target compilation... very confusing... not sure what to do about this. maybe even some newer cards don't support ddx ddy in the shader. Its possibly as his mac has the built in video card, and mine has the upgraded nvidia card. hrrmmmm
     
  37. aknotsdeath

    aknotsdeath

    Joined:
    May 20, 2016
    Posts:
    2
    So what about with out coding or am I up a creak unless I code?
     
  38. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    I'm afraid I don't have much insight here, but if you post the errors I can try to interpret them. Actually I'd be surprised if it was the ddx/ddy as I think they are quite widespread. Maybe the shader is too large, or uses too many interpolators for older hardware? Unfortunately I don't have easy access to a Mac. Maybe you can try cutting down the shader, to remove the normal mapping or to remove the noise (as a fallback). Do this on the good Mac so that you know it works as you progress.

    Yes, I'm afraid Cubiquity is quite dependant on being able to code. You can place volumes in the scene from the editor but not much else... you need to use code to control any interactivity such as destroying blocks.
     
  39. devstudent14

    devstudent14

    Joined:
    Feb 18, 2014
    Posts:
    133
    Thanks for creating and supporting this asset and for making it freely available! It's great to see.

    I have three main questions:

    1. Using the smooth voxel solution, is it possible to temporarily hide layers of voxels so I can see units mine into a cliff/underground from a top-down perspective? Here's an example of what I mean (starts at 0:40):


    2. Would terraforming in cubiquity be easy to implement into a top-down strategy game where player digs the ground indirectly via units? (similar to Stonehearth and Timber and Stone).

    3. Is there normal map or RTP support for the smooth voxels?

    Just for your info, I'm making small, finite maps (200x200) and I do not need them to be very deep (I'm thinking 20 cubes high would be more than sufficient).

    Thanks for reading!
     
  40. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    This is not provided as a feature but you might be able to emulate something. Have a look at this post (and the previous few) for an example. It will be more difficult with smooth terrain though. Otherwise maybe keep a second copy of your volume, and switch which one is displayed at runtime?

    I don't see any particular problem here, it should be the same as using the editing tools directly.

    No, unfortunately I didn't get around to adding normal map support.
     
  41. gashadokuro

    gashadokuro

    Joined:
    Jan 16, 2016
    Posts:
    4
    I have a problem with the colored cube volume. In the scene viewer it shows up completely black, if i zoom in i can make out each individual cube, but it's very hard to see. In the game view,however, it shows up completely fine. I've tried using different materials in the inspector, but that doesn't seem to help. I took a screenshot of the problem. Someone else seemed to asked this exact question a while back, but they never uploaded a screenshot so you can see the problem.



    Edit: I figured out how to fix it as soon as I posted lol. I had to click the light icon at the top of the scene viewer. Hopefully this helps others

     
  42. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
  43. awesomedata

    awesomedata

    Joined:
    Oct 8, 2014
    Posts:
    1,419
    How difficult would it be to add normal map (and other maps) support to the smooth terrain portion of the engine?

    Just curious because of the great potential of using this as an alternative to Unity terrain (as there's no way to create holes/overhangs/etc. easily using Unity's built-in system!)
     
  44. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    I was always interested in doing this but didn't get around to it. There are a couple of issues to be addressed:

    1) Cubiquity is already quite heavy on texture samplers/units because of the support for arbitrary blending between textures. The texture unit usage should probably be reduced before adding other maps, e.g. with texture atlases or (better still) texture arrays. Not sure if they are supported by Unity yet though.

    2) You need a way to generate the tangent space, keeping in mind that Cubiquity uses triplanar texturing (i.e. there are no texture coordinates associated with the vertices). GPU Gems 3 already showed that normal maps can be combined with this approach, though Morten Mikkelsen has also developed some more advanced approaches.

    In short, it's probably possible but would need some R&D.
     
  45. Voytec

    Voytec

    Joined:
    May 10, 2013
    Posts:
    1
    Hello there!
    I am curious if it is possible to modify cubiquity (colored cubes) so that a voxel is not necesarily a cube. For example - is it possible to make a trunk of a tree a cylinder? And if it is can you point out which part of code I should modify in order to achieve this?

    Thanks! :)
     
  46. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    Unfortunately this is not possible. There is some chance that it will be possible in Cubiquity 2 as this is likely to use geometry instancing rather than surface extraction, but that is still a long way off.
     
  47. shivansps

    shivansps

    Joined:
    Feb 26, 2014
    Posts:
    60
    It is posible to add more height to the voxel terrain? I want to make it 2D, and from 2D perpective what i whould need to Depth about 10 and height about 1024.
     
  48. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    Yes, you can do this. If you are building a volume from code then you pass in the size in the constructor so you can set it to whatever you like. If you are not building from code (e.g. you import a volume from somewhere) then the easiest approach is probably just to rotate the volume in Unity using the standard transform controls.
     
  49. shivansps

    shivansps

    Joined:
    Feb 26, 2014
    Posts:
    60
    I see, i was attempting to use pre-generate for now, im already seeing good results, thanks, personally i cant belive this terrain asset to be free.

    You know the only thing that whould be missing to the cubes terrain? diferent textures for cubes instead of colors.


    EDIT: The one thing that feels it falls short is the procedural generation example, as i undertand it, you are only generating prodecurally 1 material, the rocks, the other two are just filling some empty space leaved by the rocks below "Y" height.
    But i understand is just to point out some way to fill those voxels.

    The other thing that i did discover, is the terrain collider tends to fail sometimes, particles with collider is a good example, they will slip thought it if they are too many, also, as im yet to figureout a proper way to create vegetation on top of a procedurally generated terrain, im just "drooping" trees and bushes from the "sky", the terrain will catch about 70% of them, the rest just fall trought. But that could be Unity3D engine limitations.

    There two things im investigating right now, maybe you can point me in the right direction:
    -Making a proper procedural terrain, with several materials and caves
    -Making asteroids, similar to planets, but "miniable" asteroids are far more usefull, but that cant be spheres like the planets example.
     
    Last edited: Aug 7, 2016
  50. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    It's a popular request, but I'm afraid it isn't planned.

    Yes, but it really is just an example to show how you can get/set/blend voxels. Users are welcome to replace the generation code with something more interesting. But overall I think procedural generation is not strong point of Cubiquity, as overall it is designed to work better but just loading maps from a file.

    I'm afraid I'm not aware of the problem here. Cubiquity uses standard Unity Mesh Colliders but these may have some limitations? For the Colored Cubes Terrain it might be better (more robust) to use box colliders instead but I didn't investigate this yet.

    For both of these the key is to experiment with different combinations of noise functions (Perlin noise is a good starting point). In the case of the asteroid you can combine (usually by multiplying) Perlin noise with the sphere to give the asteroid a more interesting shape.