Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

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 interesting, I haven't seen this. I had a quick go at reproducing it but without success. I looked at the ColoredCubeMazeFromImage.cs example because this sets the voxels to pure red, blue, and white as you describe. Can you have a look at this example on your system to see how it looks?

    As for the cause, well I can imagine it might be related to quantization as internally only four bits are used to store each color value. Or maybe the material color is being added to the base color and that doesn't work if it is already maxed out? But why only the top... does the affected side change if you rotate the light to come from a different angle? Or if you turn shadows on/off?

    And what exactly are you doing to the material? It looks like you removed the normal map but left a diffuse map (which should work fine)?

    Not really, because the mesh is created at runtime so it doesn't exist as far as your baking tools are concerned. I would have liked to add simple ambient occlusion to Cubiquity but didn't get around to it. You may find you get acceptable results with SSAO although that will be applied to the rest of your scene as well.
     
  2. Jiraiyah

    Jiraiyah

    Joined:
    Mar 4, 2013
    Posts:
    175
    Hi David,
    I asked this question by email but you guided and asked me to post in the forums so here is the thing :
    I followed 3D buzz and their terrain system tutorial, that system by itself is very powerful, the work flow is basically like this : you start by getting a DEM file of the location you like, let's say UK, then you export that as image, for example png, using something like photoshop, you make it gray scale and tweak it so that the color tone meet some criteria, then you use this as a height map system, with noise (perlin) on top of it and generate meshes at the end. the system easily gives back the coordinates for each vertex, uv, triangle, so the question was that can i use these data to convert the terrain to voxel at any time i want? you said that your system currently does not have such a thing, but i asked if is it possible to extend the system? after all, if you are supporting height map, one way or another you are generating 3 dimentional coordinates from it.
     
  3. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    Your system only gives back vertex/triangle data, but can it (in principle) be converted back to a heightmap? That is, does the terrain have caves, overhangs, or other features which make a heightmap representation impossible? If you can convert back to a heightmap then this will be a good start for getting the data into Cubiquity.

    Cubiquity does provide direct access to the voxel data via SetVoxel()/GetVoxel(), but you will need to come up with an algorithm to test whether each point in space (that is, each voxel) is inside or outside the terrain. If you have a heightmap then this is quite straightforward. If you don't have a heightmap (and can't build one) then you may need to apply a different technique - perhaps by performing a raycast against the terrain.

    It is actually possible to convert completely arbitrary geometry to voxels and there are numerous academic papers on the topic of 'voxelization'. They can be complex though, so if you have a restriction (like no caves/overhangs) it will be a bit easier. Also, be aware that the resolution of Cubiquity volumes is generally quite limited.
     
  4. croliver

    croliver

    Joined:
    Nov 11, 2015
    Posts:
    1
    The software is pretty awesome. Thank you for developing it.

    My one question that I can't seem to figure out is how to load a database at runtime. I have read the editor code but it uses an editor specific function to reload/draw the voxel database when you select a new one. What variable or function should I call to update the voxel database being used at runtime?

    This is my most recent test:
    void Update(){
    if (shouldLoad) {
    coloredCubesVolume = VolumeData.CreateFromVoxelDatabase<ColoredCubesVolumeData> (LoadLocation, VolumeData.WritePermissions.ReadWrite);
    shouldLoad = false;
    }
    }
     
  5. cpt1985

    cpt1985

    Joined:
    Oct 3, 2015
    Posts:
    7
    you were right, the directional light was affecting the surface of the top of the voxels. The maze example and a quick test confirmed this. Thanks a lot!
     
  6. Jiraiyah

    Jiraiyah

    Joined:
    Mar 4, 2013
    Posts:
    175
    sorry for late reply, actually the system I have is still hightmap based, meaning, although the terrain gets away from original height map when you use brushes, but at the end, there is no such thing like overhangs or caves and basically it could be generated from a height map if the map was correct, not sure if it will be easy to convert the terrain back to a height map or not because the system gives terrain patches, the whole system uses a map of for example UK but then, it generates massive (like you can fly the map for 6 hour and you won't be even close to edges) world, all it does is at each point it checks if a previous terrain patch was created or not, if not, it uses that UK map to generate new patches, what i wanted to know is that is it possible to use the data we already had to convert the terrain to voxel version or not, and by your reply, i get that I have two choices :

    1- Generate a temporary height map and convert the terrain patch using it
    2- Find an algorithm to feed it with my position data and it generates the voxel version using sort of position checks.

    am I correct?
     
  7. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    After you create an instance of a VolumeData subclass you need to assign it to the '.data' property of your volume component. Make sure you understand the difference between a Volume, VolumeData, voxel database, etc: http://www.cubiquity.net/cubiquity-for-unity3d/1.2/docs/page_key_components.html

    I assume it is possible to replace the volume data at runtime though I don't think I've tried it.

    Great! But do you still think it is a bug in Cubiquity or it was an issue with your test setup?

    Yes, this is basically correct. But both approaches mean you need to know how high your terrain is at a given point. If you can determine this then you should be able to convert it to a voxel terrain one way or another. But with such a big terrain you will find that Cubiquity is quite limited (approx 512x512 voxels?).
     
  8. Jiraiyah

    Jiraiyah

    Joined:
    Mar 4, 2013
    Posts:
    175
    Well, i was not planning on making big chunks converted to voxels, actually the terrain patches are smaller than 512*512, I was planning of giving a button control to the user to convert a single patch to a voxel terrain, so that he could dig caves and other needed stuff into it, keeping other terrain patches that are generated as they are (each terrain patch is a separated mesh after creation.) that brings me a question that i didn't thought before hand, is it possible to convert a mesh (an actual mesh with mesh collider blah blah) into voxel directly in unity editor?
     
  9. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    Yes, but again it is some implementation work on your part. You basically need that ability to decide whether any point in 3D space is inside or outside of your mesh. Unity's collision system may be able to help here, but otherwise you can implement an algorithm yourself. These are known as 'mesh inside/outside tests', and one algorithm I know of is to cast a ray from the point in question to infinity, and then count how many times the ray intersects the mesh data. If it is an odd number of times then the point is inside the mesh, otherwise it is outside.

    But there are more sophisticated (and robust) algorithms available - searching for 'voxelization algorithms' should give you some leads.
     
  10. LaireonGames

    LaireonGames

    Joined:
    Nov 16, 2013
    Posts:
    683
    Hey everyone,

    We have just released a UI package for minecraft styled games and thought you would be interested:

    Asset Store: https://www.assetstore.unity3d.com/en/#!/content/49991
    Web Build: https://dl.dropboxusercontent.com/u/29289192/Laircraft UI/Web Build.html

    Not intending to step on anyones toes, noticed this pacakge doesn't come with UI and thought it would be a nice add-on for anyone interested but if you are not happy with me promoting my asset here I will of course remove this post.

    Cheers!
    Jason
     
    Last edited: Nov 28, 2015
  11. Heldenwelt

    Heldenwelt

    Joined:
    Jul 8, 2015
    Posts:
    12
    Hi David,

    I would like to use your tool for other volume data. Since you have no other importing then from MagicaVoxel. Is there a descripition of your *.vdb file format. Maybe I can program something to import my volume data. I think its a lot of work but maybe I can make it and provide it here. That would be great.

    Greetings,

    Ralf
     
  12. Heldenwelt

    Heldenwelt

    Joined:
    Jul 8, 2015
    Posts:
    12
    Hi David,

    and another question.
    I tried to convert an *.vox from Magica to *.vdb and it says:
    "magic number does not match"

    what is the reason and what can i do?

    Thanks,

    Ralf
     
  13. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    You asset store link seems broken and unfortunately the Webplayer doesn't support Chrome. However, I don't mind you mentioning this in principle, but be aware that Cubiquity doesn't do textured (Minecraft-style) voxels but does solid colors instead. So I don't know how useful it will be for Cubiquity users.

    Hi Ralf,

    The .vdb file is actually an SQLite database, which I treat as a 'black-box'. I take the chunks of voxel data, run them through a ZIP compressor, and send the result to SQLite. As such, I don't even know the exact file format myself!

    The best approach is to make use of the C# API to create your voxel databases, fill them using the SetVoxel() function(), and save the result as a .vdb.

    This would usually mean that it is not actually a MagicaVoxel file (something else with a .vox extension?) or perhaps that the version of MagicaVoxel is wrong (maybe you have an alpha/beta release, I have '0.96.3')?

    Test it with one of the example volumes that comes with MagicaVoxel. Also, you can send me an example of a file which fails to convert and I will test it myself.

    Edit: I also saw (by email) that you had difficulties with an image stack, but I don't see that post here. Did you get it resolved?
     
  14. LaireonGames

    LaireonGames

    Joined:
    Nov 16, 2013
    Posts:
    683
    Thanks for that David, its strange I copied the link and nothing has changd and now it works :/ probably had a space on the end or something!
     
  15. Heldenwelt

    Heldenwelt

    Joined:
    Jul 8, 2015
    Posts:
    12
    Hi David,

    thanks for the answers.
    1. Stack: Yes, I solved the problem with stack. I reformated the png's with an alpha Kanal and transparent background. I still have to test a little arround with the transparency (which color and so). But in the end I used IrfanView with its batch possibility. Its able to set an alpha chanal choosed by color in batch mode.

    2. *.vdb: So, you say I should use your c# API to create file and then fill it. Okay, I will try it and have some urher questions. :)

    3. *.voc --> *.vdb: I loeded my own *.obj to Magica and saved it as *.vox -> and that didnt work with your Software. If I used a example vox it worked.
    There is a new Magica Version right now and I think it will work now. I wrote to the Magica Guy.

    4. A new Question: I managed to load data over the stack method and it works with your destroy script. But If I build an executable the scene is empty. Is there an instruction page or something. Or is it not possible? I didnt find something in your PDFs. Sometimes it worrks, sometimes I have to reopen the exe several times before I see a volume.

    Anyways, thanks for the help and the software.
    I will send you some results as a reference if you want to.

    Ralf
     
    Last edited: Dec 3, 2015
  16. jreach

    jreach

    Joined:
    Dec 3, 2015
    Posts:
    1
    Hello David,

    I was curious why you never implemented textured cubes and stuck with colored cubes?
    Did you leave it as an excersize for the reader?

    Thanks,
    Jonathon
     

    Attached Files:

  17. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    Very strange, if you send me a .vox file which opens in MagicaVoxel but does not import into Cubiquity then maybe I can see what the problem is.

    I haven't seen this. The standalone export should work for Windows, Linux, and OSX but it's won't work for mobile or webplayer (those are unsupported). But if it works only sometimes then I don't really have an explanation. Try a smaller volume? Do the Cubiquity example scenes export correctly?

    It was really just my personal interest. My work with voxels predates Minecraft and I never really played that game, so I just didn't get attracted to the 'textured blocks' look.
     
    Heldenwelt likes this.
  18. Heldenwelt

    Heldenwelt

    Joined:
    Jul 8, 2015
    Posts:
    12
    Hi and thanks for the answers. It works now, but I dont know what it was. Sometimes it showed the data and sometimes not.

    A new question:
    Right now I use your stack system. Now I got an error I cant explain (see attached).
    I loaded much bigger datasets before. One difference is how I calculate the png. Its more correct now. The alpha chanal has only ones and zeros in that dataset.The other bigger datasets were more like screenshots with an alpha chanal between one and zero. The error doesnt come if I have less ones in the png...less solid voxels. What happens to the zero voxel? You are not put it in your vdb, dont you?
    I could not copy the error message, because it doesnt stop.
    PNG size 452x336 and 285 png's!
    I did an 830x1100x510 and it worked. All processed with your ProcessVDB Tool. The larger one are screenshots that where I added an Alpha Chanal with "Irfanview batch". That worked fine. The smaller dataset, that doesnt work is processed with Matlab of the original data. A diffrerence is the Alpha (1 and 0) and the larger one has several values between 1 and 0. Any Idea why it stucks with that error message or what could I test?

    Thanks for the help and your work,

    Ralf
     

    Attached Files:

    Last edited: Dec 10, 2015
  19. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    @Heldenwelt - I'm not sure I fully understand your question, but I'll try to help. First of all, Cubiquity does not support partially transparent voxels - every voxel is either displayed fully opaque (solid) or is invisible. It is true that each voxel has an 'alpha' value but this is not properly used by the engine. As I recall, the engine simply checks if the value is greater than 127 and if so it draws the voxel as solid.

    Transparent voxels are still stored in the .vdb. A transparent voxel can still have a color, but you won't see it until you increase the alpha to make the voxel visible.

    I'm not sure what is causing the error but some tests will help narrow it down:
    1. Size can be a problem. Although you say 830x1100x510 works, I would expect this to be towards the upper limit of what the system can handle. If you are struggling with .png import or alpha channels then work with smaller volumes until you understand what is going wrong.
    2. It should not be possible to generate an 'invalid' .vdb file (unless it is too large). If you have a .vdb which does not load then you can send it too me.. However, do check it is really the .vdb file which is the problem (not e.g. the scene) by importing it into one of the example scenes.
    3. The ProcessVDB tool is the most likely source of problems. There may well be some images it doesn't deal with well. For example, I know that it doesn't handle 16-bit PNGs. If you can create a small stack of .png images wich don't convert then again you can send then to me, and I'll try to see why.
     
  20. Heldenwelt

    Heldenwelt

    Joined:
    Jul 8, 2015
    Posts:
    12
    Hi and thanks for the ansers:
    1. The png read in works fine. I used your batch for all my data.

    The problem has something to do with the number of voxel, but I dont understand it. I used a stack of screenshots and it worked really well and I had a lot of voxel in unity.
    After that I swichted from screenshots to self generated png's that I propper generated with Matlab to have the right data. Screenshots can be aa little wrong. The thing is I could not load have the voxels of the screenshots with the selfgenerated PNGs.
    my time ist short right now. But I test a bit around whats the problem and could send you some *vdb data, if you want to. But it has to be with mail.


    Thanks for looking into it,

    Ralf
     
  21. RTSlang

    RTSlang

    Joined:
    May 3, 2013
    Posts:
    57
    I'm not getting shadows on the ground it seems. Checking/unchecking receive/cast shadows doesn't change anything. I'm using 5.2 Any ideas on how to get shadows back?


    Edit: Shadows are visible until I hit play.
     
    Last edited: Dec 18, 2015
  22. RTSlang

    RTSlang

    Joined:
    May 3, 2013
    Posts:
    57
    Ok so it seems to be a shader issue with ColoredCubes. Certain shaders I have replaced it with bring back the shadows. What can I do to fix this shader? The destruction looks for the Normal and Noise amount which is a rare breed among my other shaders.
     
  23. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    Yes, you are welcome to send me some data to have a look at. You can email the data david@volumesoffun.com, but we should keep the discussion here (for an open source project I try to keep communication public where possible). You can send me a .vdb and/or some image slices and I'll see what I can find.

    Does it work properly with the example scenes? 'Cubiquity/Examples/Basic/ColoredCubesExampleScene' is a good one to test. If you have the same problem there then what platform are you on?
     
  24. RTSlang

    RTSlang

    Joined:
    May 3, 2013
    Posts:
    57
    I ended up swapping out the shaders and manually editing the FakeCube one to follow suit. I'll post video progress of how everything looks once I feel a little more confident in the graphics.
     
  25. Gordune

    Gordune

    Joined:
    Apr 20, 2013
    Posts:
    3
    Capt1985 and RTSlang's problems seem related to me -- in the demo scenes I'm seeing lights apply on the opposite side, consequently failing to shadow. With Linear rendering it renders properly only in Scene view, in Deferred it renders correctly in game view too up until you actually run the scene.
     
  26. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    Indeed I have seen some of these issues. I thought I had handled most of them, but actually I haven't even tried deferred rendering and so wouldn't be surprised if that has problems.

    The underlying cause is that Cubiquity does not store any normal data (per-vertex normals) with the mesh when working with ColoredCubesVolumes. The reason is that we want flat shading, and this means duplicating the vertices if we use per-vertex normals. For example, a cube would require 24 vertices instead of the usual eight.

    Therefore Cubiquity uses some shader tricks to compute normals on the fly and avoid enlarging the mesh data. Unfortunately these normals can become flipped depending on a number of factors including Unity 4 vs 5, operating system, OpenGL vs. Direct3D, play mode vs. edit mode, etc. This means I have a number of tests in place to correct these normals depending on the current configuration, but it is quite easy for me to miss some (or perhaps it is not consistent?).

    There are proper solutions to this problem without bloating the mesh data too much, but it seems to work in most cases and to be honest I'm more focused on researching the tech behind Cubiquity 2 at the moment. I will make sure that it doesn't suffer from the same problem, but I probably won't improve it in the current version.
     
  27. Gordune

    Gordune

    Joined:
    Apr 20, 2013
    Posts:
    3
    Thanks for the explanation, that clears up what I observed. I like Cubiquity and I'm looking forward to seeing how C2 pans out.

    I'll un-flip the normals in the shader and call it good for now.
     
  28. Ahmad45123

    Ahmad45123

    Joined:
    Dec 28, 2015
    Posts:
    1
    Hello there,
    I've downloaded this incredibly amazing asset, and before I start I must say, Thanks a lot for you efforts.

    Basically, I want to render a world thats loads from a binary file, I did all the reading and stuff then used the ColoredCubesVolume to render it and it worked amazingly however, I don't want only colors.

    Is it possible to use 2d textures to be applied to voxels ? If so, how ?

    Thanks in advanced.
     
  29. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    You might have seen it already, but you can set the 'normalMultiplier' to 1.0 or -1.0 depending on whether you want to flip or note. See the computeNormalMultiplier() method.

    No, unfortunately not (though it is a popular request!). Cubiquity is not aimed at Minecraft-style worlds and I'm not currently aiming in that direction. The main direction is instead to make the voxels as small as possible (which could in turn be used to emulate Minecraft by building a block out of many voxels, but that is some way off still).
     
  30. JonnyHilly

    JonnyHilly

    Joined:
    Sep 4, 2009
    Posts:
    742
    after the level loads, you have to wait a while while all the voxel chunks are setup/loaded in....
    Is there an easy way to check to see if these are all finished.... so I can display a loading screen on top or something ? thanks.
     
  31. pixlweaver

    pixlweaver

    Joined:
    Dec 21, 2012
    Posts:
    92
    Check out OnMeshSyncComplete event on the Volume class.
     
    DavidWilliams likes this.
  32. JonnyHilly

    JonnyHilly

    Joined:
    Sep 4, 2009
    Posts:
    742
    thanks pxlweaver
     
    pixlweaver likes this.
  33. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    Hey guys, I have been playing around a bit (ummhh maybe a lot...) with Cubiquity the last few weeks and, yes, I have been having volumes of fun :)

    I have been working on making an integration with a package of my own so I haven't been only playing, I have been a little bit productive too.

    While working on it, I have among other things made a triplanar shader that also includes normal maps and I have at least generated maps for (but not included in shaders) for what's needed in standard shader (i.e. ambient occlusion etc etc). I have also made some other cool stuff with destructible environments if I may say so myself:


    Now some of these things may be interesting to others and so I was thinking as @DavidWilliams stated that he is moving to open source, and hopefully soonish MIT-license (http://www.volumesoffun.com/reflections-on-cubiquity-and-finding-the-path-forward/#comments) I thought that maybe I could contribute some of my stuff.

    So, are there any instructions for how to get started contributing to this project? I haven't participated in open source development before so bear with me :)
     
    Last edited: Feb 15, 2016
  34. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    Very nice, it's always inspiring to see what people are working on with Cubiquity! Do remember though that the TerrainVolume is the part which will be removed in the future, as we focus on the colored voxels instead.

    Great! I'm sorry it takes some time for the open source aspect to happen but I promise it is moving forward!

    The basic process is that you should create a Bitbucket account and fork the project. This gives you your own copy of the repository on Bitbucket, and you can then clone that to you local machine. You make you changes, and can push them to your fork on Bitbucket when ever you are happy with them. These changes only affect your fork on Bitbucket and not other Cubiquity users.

    When you have something which work well and is generic enough for other people to make use of, you can then send me a 'pull request', which basically asks be to pull your changes into my copy of the repository. After you do this, other users can update their repository from mine.

    However, do remember that this version of Cubiquity is reaching the end of its life (as discussed in the blog post) and the next version will be a complete rewrite in a different repository. Therefore I will be conservative in terms of what features I pull into the main repository as I don't want to spend too much time testing on different platform, etc. Bug fixes and small features should be fine though.
     
    Mikael-H likes this.
  35. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
    So was just trying this out...
    When playing, if you pause, and then resume, it seems to redraw the voxel mesh(s).. and it also seems to reset the scene of rigidbodies... like if you check a frame out on the debugger soon as it resumes all rigidbodies, like those created from the ClickToDestroy script are removed.

    Not sure if a known issue or just something new that has cropped up with recent unity versions?
     
    Mikael-H likes this.
  36. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    While I am sure your new project will be to the brim full of awesomeness this makes me a little sad to hear :)

    Ok, thanks, maybe I'll do so when I have increased code wuality of my work a little.

    This makes me think... Is there a possibility for the current version to live its life as an opensource lib? And maybe separated from Cubiquity 2 which would go in a direction with smaller voxels? Or maybe there's not enough interest in voxels among unity devs to keep two such projects alive?

    I definitely see the rationale for you to go forward in a direction of smaller voxels as that is an area that seems very interesting from a research point of view. From a production point of view though, I think the textured voxels are far from dead yet. I can see many ways that they would be interesting to indies still. Just looking around Steam there seems to be tonnes of indies making games with textured voxels.

    I have never been involved in any serious opensource development though so I don't know how much extra work it would mean to keep two separate projects alive as an admin and I do understand that you're more interested in doing cutting edge research rather than spending time on "old tech" :)
     
  37. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
    Yknow that seems great, but unless monopolies like Intel start putting out even better cpu's and more cores at lower prices, and developers start multithreading the heck out things even better. I don't see going smaller with voxels is such a good idea, and Intel are already going backwards most there mobile/desktop cpu's out now are not much better than those out 5years ago (OC'd anyway), todays prices aren't any better either.

    Given the current performance of the scene generated with Cubiquity going smaller just isn't going to happen easily. And people want games with large landscapes to explore, developers want that option to. Keeping a decent view distance is another problem for performance. Maybe you should think of Cubiquity implementing an actual chunk loading/unload before going smaller. Because by smaller unless you go 1/8 or 1/16 of the current size, to were each voxel cube is like the size of a 16x16 textured pixel, on the current size cube, then it just won't look right. And even 16x16 textured blocks look kinda ugly for a style, 32x32 block textures is happy medium, before the entire cube style worlds start to look weird because of the lack of polygons to texture res ratio starts to look weird. Maybe actually just support multiple texture blocks (even better with coloring ontop), I'm sure its your number one requested feature for an actual reason :)

    And dropping marching cubes and smooth terrain... Well again it seems the best approach so far, cubiquity smooth gen terrain is pretty good, its just lacking a way for us to really take advantage of it in larger scale worlds. I had a look at the atomontage demos which I didn't realize is what you meant by small (when I wrote the above paragraph).. but looks like would be more of a technical project than one of actually providing useable tech for todays hardware let alone mobile... making an actual game that is playable and fun is what its actually about.. those tech demos look ok but I don't see any fun games being made with it so easily.. I'm sure it has a ton of its own problems, and we don't need super realistic voxels at that size, we just want something actually usable and performant to build a game ontop of +this+ that+ etc etc :)

    And this engine despite having implemented some really nice features, multiple volumes for a start. However both the cube and smooth style options have some huge negatives, no multitextures cubes, and the other is really just limited textures for smooth terrain, but both are hindered by a limited total volume size.. and lastly only desktop pc,mac,linux platform support, which wouldn't be so bad, if it wasn't for the fact the engine limitations already put desktop games developed with this engine in a worse position than just using one of the other voxel engines which provide better features for desktop games like chunk loading/unloading, lod, etc. So this engine seems perfect for smaller styled games that are using voxels smartly efficiently. It would work on newer gen mobiles well, using limited amount of voxel sized volumes ...and yet no support for those platforms... on Unity... I would say you really need to think more about the direction you go with for your next voxel engine project if its what you're doing. Of course you mention Unreal engine being easier to support mobile platforms through? Great well I'm always looking to see more assets on Unreal and that engine getting better for indie's to really use without needing a resident c++ wizard, however for now, Unity is where I'm at...for now anyway :)
     
  38. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    Hi guys,

    I'm happy to say that I have finally flipped the switch and made the Cubiquity C++ repository public! It contains all the code needed to build the Cubiquity shared library which is used by Cubiquity for Unity3D, and is released under the terms of the MIT license as previously promised.

    You can find the source here: https://bitbucket.org/volumesoffun/cubiquity

    Be sure to check out the develop branch as otherwise you will have problems building it. Note that there is still more work to be done so doing a proper announcement (blog post, etc) for this yet, but interested parties can at least get the code.

    Thanks, I did not know about that issue. I've logged it here: https://bitbucket.org/volumesoffun/.../83/pausing-and-unpausing-in-play-mode-causes

    Yes, that is exactly the intention. The C++ code from Cubiquity 1 is now open source (see comment above) and I expect Cubiquity 2 will live in a completely separate repository. It is being rewritten from scratch so I don't think it makes sense to use the same repository. Most likely we'll put the next engine on Github and leave the current one on Bitbucket.

    That's basically the intention - if the voxels can get this small then it allows developers to imitate the Minecraft look if they wish, but without being limited to that style of game.

    To an extent this is true. But the cutting-edge is a much more fun place to be working, and I'm really curious to see what can be achieved. Really, I'm just taking this direction because it is interesting to me personally, rather than because it is what other people need. It may not end up providing an easy-to-use, drop-in solution for Unity, but should still be of use to those who want to be a bit adventurous with their technology.
     
    Mikael-H likes this.
  39. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
  40. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    Ok, sounds awesome!

    I have been playing around with it a little bit and I am starting to generate some worlds with some proc gen scripts of my own. (See attachment) I was thinking about building a nodebased noise generator to generate worlds, is that something you think would be appropriate for a demo scene within the repository?
     

    Attached Files:

  41. Player7

    Player7

    Joined:
    Oct 21, 2015
    Posts:
    1,533
    Well I'd certainly be interested in checking that out
     
  42. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    Happy to hear it! My own needs right now are 2D noise gen for a 2.5D sidescroller but I am sure I can make it extendible to 3D as well. Simplex/Perlin noise doesn't care :)

    When I have anything worthwhile I'll make a branch and repost here. Maybe you're interested in working on it ass well? :)
     
  43. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    @DavidWilliams I think I remember reading somewhere that you mentioned the marching squares should be able to support 8 materials, not just 4. Checking a bit of the c# code it seems that the room for the data is already there (8 bytes per voxel). Is the triplanar shader the only thing that needs fixing for it to support 8 materials?
     
  44. kane_253

    kane_253

    Joined:
    Aug 18, 2015
    Posts:
    2
    I am very excited with Cubiquity, but.. will it support WebGL? I think, it may be possible, because Unity convert C++ to JS with Emscripten, and, you , maybe, somehow can add your C++ library to this process?
    Or Cubiquity 2 will support WebGL from scratch? Anyway, please, answer me!
     
  45. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    In the long run, maybe. This is not the fault of Cubiquity. Cubiquity like all other (I certainly hope) voxel engines run multithreaded. WebGL does not support multithreading but this may change in the future, see: http://forum.unity3d.com/threads/webgl-roadmap.334408/
    If they fix that I would think that Cubiquity should run in WebGL.
     
  46. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    Ummmh... I just realized I get the wierdest bug I have EVER seen using Cubiquity....

    The colored cubes volumes are receiving light from the inverse direction of the light source. But this happens only at runtime. When displaying the exact same volumes in design time everything looks allright. Anyone got any idea what is going on here?
     
  47. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    To be honest I think it will be of more interest to people who want to port to different platforms. Patching or extending the code requires a good knowledge of the code and algorithms, whereas porting to new platforms only requires a decent knowledge of C++/build system on your platform of choice.

    Sounds interesting, but how will you implement the node-based editor? Using something from the asset store? That's fine for an example, but obviously we shouldn't make Cubiquity depend on such an external library.

    As I recall it works in Unity 4 but not Unity 5. So I think the C++ and C# code is in place, but Unity 5 changed the way that shaders were handled and I couldn't find enough free shader variables? It can probably be made to work with some creativity and shader knowledge. Maybe I can fix it when dropping Unity 4 support, but I won't put too much effort there.

    I think it will be difficult to get the currently version of Cubiquity to work with WebGL/Emscripten simply because the C++ code is rather complex and template heavy.

    I think this is more likely. One of my aims for Cubiquity 2 is to make the code much simpler, and I do intend to try to make it work with Emscripten. However, getting it working wth Unity+WebGL will probably be more complex than just WebGL on it's own. Don't know much about this to be honest, but at least you would have a starting point.

    Cubiquity 2 is still a long way off though, and is just being prototyped at the moment.

    Yep, I've seen this. Cubiquity lighting uses a cleaver hack which is unfortunately very sensitive to OpenGL vs Direct3D, OS, Unity version, play vs edit mode, and possibly other factors. I try to handle all the combinations but it gets tricky (and is one reason I want to drop Unity 4 support).

    I use a variable called 'normalMultiplier' to flip the normal so try searching for that in the code. Also check the comments in 'computeNormalMultiplier()'.

    The proper solution is a lot of work and isn't likely to happen. See point (2) here: https://bitbucket.org/volumesoffun/...er-adding-very-local-ambient#comment-24350756

    However, I may be able to fix it with another clever hack... let me look into it over the next couple of weeks as I polish Cubiquity a little more prior to the final Cubiquity 1 release.
     
  48. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    Just a heads up that I've now updated the develop branch of the Cubiquity Git repository to Unity 5.3. This means that Unity 5.3 will be required for the next (final) release. This is because I don't have the time to test on Unity 4 any longer, and it's quite old now anyway. It might let me fix some other minor annoyances as well.

    Ok, I've checked in a proper fix for this so you can update your repository from mine. I believe it is a better solution which should work on all platforms. Give it a try and let me know if you see the problem again.
     
    Mikael-H likes this.
  49. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    I intend to use an open source node system for unity, https://github.com/Baste-RainGames/Node_Editor
    Sitll, you're right that it wouldn't loook good if you got a lot of build errors first time you download cubiquity if you haven't also downloaded that node editor... Maybe include a version of itt and update at regurlar intervals? Let me know what you think...

    I'm no shader expert and this is no extremely high priority of mine. I'll give it a try when I have some time to spare. I'd also like to try just adding a shininess map and maybe a heightmap to offer some good looking PBR visuals. I didn't know about shader variable limitations, that might be a problem if I start adding PBR maps also...

    If I may suggest, wait and see what happens with WebGL and multithreading... If they add support for it then it will be a helluva lot easier to support WebGL I think.

    A clever hack! I love it!! :) Drop Unity 4 right now dammit, it is an ever decreasing slice of the market and no one starting a new project will do so in Unity 4! If there is a small percentage of people who actually do then they can download from earlier versions anyway.

    Once again, thanks a lot for your hard work on this, I'm having a lot of fun with Cubiquity. I am currently working on trying to generate sidescrolling 2.5D worlds where I combine smooth terrain with colored cubes buildings and the first experiments look promising! 2016-03-04.png
     
  50. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    Yup this worked! Thanks, that was a lot faster than the estimated weeks mentioned at frst! :D