Search Unity

Cubiquity - A fast and powerful voxel plugin for Unity3D

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

  1. PixelSpartan

    PixelSpartan

    Joined:
    May 11, 2015
    Posts:
    26
    Also will it be for UE4 too cuz i kinda switched and would like to continue using UE4
     
  2. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    There is no fixed schedule, it's just done when it's done. I'm still hoping to get a prototype of the core engine on GitHub by the end of the year, but Unity and or UE4 integration will take longer.
     
  3. Kroikey

    Kroikey

    Joined:
    Nov 26, 2012
    Posts:
    2
    Hi David, I appreciate the hard work on this engine but have a couple of questions if you have time. The GetMesh function in Cubiquity.dll seems to be the bottleneck in my testing, I guess because of the SQLlite implementation. Is it possible to store everything in memory? I'm seeing 26ms in profiler with a small volume.
     
  4. Kroikey

    Kroikey

    Joined:
    Nov 26, 2012
    Posts:
    2
    For others I found enabling unsafe code to stop 99% of the spikes. The files are in the Cubiquity/Unsafe folder and should be copied to Assets and modified to mcs.rsp instead of smcs.rsp. Restarted Unity and found much better performance.
     
  5. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    Hi, I'm glad you found the problem. The GetMesh() function does involve passing a significant amount of data from the DLL to the managed runtime so it makes sense that this would be a potential bottleneck. But to be honest I never profiled the safe vs. unsafe methods (or really noticed any difference myself), I just provided the unsafe version because I knew it was better in theory. I'm glad it turned our to be useful!
     
  6. DavidWilliams

    DavidWilliams

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

    In the past a few people have asked for a way to export a TerrainVolume to a mesh prefab. One of our users has provided me with some sample code which does this. I'm not going to integrate it because I'm focused on Cubiquity 2 now but I thought I'd share it in case it is useful to anyone. You can get it here: Export TerrainVolume as mesh prefab
     
  7. ootz0rz

    ootz0rz

    Joined:
    Mar 31, 2013
    Posts:
    4
    For some reason I'm having issues with lighting....

    When the scene is not playing, it looks perfectly fine:



    as soon as I hit play... it seems like the entire terrain gets covered in a shadow



    this happens even in the included example scenes, without any modifications... using Unity 2017.1.1f1

    anyone have any ideas? :/ the lighting on other geometry (ex the blue cylinder below it) looks the same in both cases
     
  8. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    I've seen this bug a lot but I never resolved it properly (perhaps the most annoying remaining bug in Cubiquity?). It actually not the shadow but the lighting, because the normals are being flipped to point in the wrong direction. Have a look at computeNormalMultiplier():

    https://bitbucket.org/volumesoffun/...meRenderer.cs?at=master#VolumeRenderer.cs-213

    This horrible bit of code flips the normal to try and get it working consistently on each combination of OS, graphics API, play vs editor mode, etc. This is because normals are not part of the vertex data but are instead computed (inconsistently) in the fragment shader. Unfortunately I never properly tested it after Unity 4 (and even there it had problems). Maybe it isn't even needed anymore?

    I have a better solution under development for Cubiquity 2, if you are feeling adventurous and are comfortable writing shaders I could give you a snippet to back-port. Otherwise just hack that computeNormalMultiplier() function until it works for your situation.
     
  9. pappynaidenov

    pappynaidenov

    Joined:
    Dec 11, 2017
    Posts:
    2
    Same problem. Started with Trello, but it is pretty simple and doesn't have enough features. Switched to Kanbanize. We built various Kanban boards. It fits the needs of the team and it is pretty flexible and it has great analytics panel.
     
  10. PixelSpartan

    PixelSpartan

    Joined:
    May 11, 2015
    Posts:
    26
    I get the bug too and its very annoying but come on man whens the 2.0 comming :(
     
  11. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    I'm sorry but it is kinda stalled at the moment. I haven't had any time to work on it for the last few months and the next few aren't looking good either :-( I'm thinking about it all the time and have a head full of ideas... just no time to implement them right now.

    But it is not dead, just going very slow. Unfortunately you shouldn't have expectations about getting it soon.
     
  12. TwoBentCoppers

    TwoBentCoppers

    Joined:
    Feb 12, 2017
    Posts:
    16
    It's been almost a year since I posted on the project I was working on using Cubiquity. I'm still finalizing some 14th hour things. I do have a blurry gif from the Alpha stage.
    https://twitter.com/TwoBentCoppers/status/972165919966248960

    So far Cubiquity is hanging in there, even through 2018.1.0f2. Testing it out today since it was officially released.

    This new Unity 2018 doesn't seem to like the old ColoredCubes shader. Made a new one with their Shader Graph. I'll see about finding a place to host it when I get the noise generation connected back in, for other people trying Cubiquity in Unity 2018 and getting the same problem.

    https://twitter.com/TwoBentCoppers/status/991877235102511104

    In 2017.3.1f1 computeNormalMultiplier() seems to be doing its job for my current project, both on Windows and on Mac.
     
    Mikael-H likes this.
  13. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    Nice to see someone is still using this! The PBR metal look really cool :)

    That was always one of the more painful parts of Cubiquity as it was so fiddly to get it right on every system (and it always felt like such a hack). I'm glad to say that it is gone from the current version of Cubiquity 2, which instead renders the scene as instanced cubes. The normal is then just the vector from the centre of the cube to the point on the cube's surface, then snapped to the nearest axis. So it only depends on the geometry, nothing shader-system specific.

    I forget, but does Cubiquity 1 have access to the voxel centre in the shader? Perhaps the noise function uses it? If so the trick could be back-ported, but I am away from the code at the moment.
     
  14. TwoBentCoppers

    TwoBentCoppers

    Joined:
    Feb 12, 2017
    Posts:
    16
    Like others, definitely looking forward to Cubiquity 2.

    Sadly shaders are still one of my weak areas. It looks like it's trying setup it up for the ColoredCubesUtilities to do the random noise. Something there is going wrong and reading the wrong value. Cutting out the randomization and using just the vertex color works to restore color.

    I think, with my almost non-existent knowledge of shader programming, that it's having trouble reading the Position value. Something about the differences between Potion and SV_Position in DirectX 11.

    It doesn't seem worthwhile trying to fix the old shader, as the new Lightweight Render Pipeline (LRP) in 2018 doesn't understand it. Everything just errors to pink. From what I understand about the LRP, the shader would have to be rewritten from scratch to support it. Setting up the Shader Graph for it worked, and will hopefully be compatible as Unity updates both the LRP and Graph.

    Unity 2018.1.0f2 tested ColoredCubes ShaderGraph and Material, for the LRP
    https://drive.google.com/drive/folders/1NzYo8acn3enhN8j9P1QYMrj83m_o0HMQ?usp=sharing

    It's currently set to Specular workflow, but its easy enough to switch it to Metallic.
     
  15. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
  16. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    186
    I also have been running Cubiquity in Unity 2018 - I'm trying to build caves systems but even thought the code works fine these editor tools are difficult to build extensive branching caves with the terrain volumes...I keep punching through ceilings and floors. Anybody have any good sized cave volume maps they are willing to share?
     
  17. TwoBentCoppers

    TwoBentCoppers

    Joined:
    Feb 12, 2017
    Posts:
    16
    If/when I get around to lava caves I'll let you know. With Kilauea erupting, that may move up from 6th in my development list to 3rd after this current project. Most of my terrain generation has been through ProcessVDB.exe, or a rather hacky in-Unity c# script I made for combining multiple height maps. I'm mainly working with pre-exising volumes, mostly elevation DEMs but at some point I'll be looking at point clouds of sanddune surfaces.

    The Unity script is more or less an extended version of the MazeFromImage example. It reads a grey-scale image pixel by pixel and uses that as the Z position in the VDB. The most complicated combine I did was for a gravel deposit. Took the maximum depth as one image, and the minimum depth as the other. The script then used those two inputs figure out which voxels to set active.

    You could consider something similar, create two height maps, one for the cave floor(s) and one for the cave roof. Use the Floor map as the base. Then the Roof map as modifier from there, which would likely be mostly black for like (4, 4, 4, 255) if you're sticking at 1 meter/unity-unit per voxel, a good 4 meter roof.

    If a Floor pixel is (10, 10, 10, 255), then the script would fill the first 10 voxels up. Then the Roof map would be used to tell it to leave the next 4 voxels off. And then it would fill the rest up to the height limit of the VDB.

    That way you could paint your cave network in Photoshop or GIMP, run a custom script to generate the gross layout, and then do a "walk through" to do touch up with the editor tools.

    The script could get a bit more complex for the Terrain Volume if you wanted to set textures during the import. It's something I want to play with myself since 2018.2.0b3 is supposed to have support for 8 UVs in the Mesh now. I want to try and see if I sneak back in the 8+ textures weights some how.
     
    Last edited: May 12, 2018
  18. HonKasumi

    HonKasumi

    Joined:
    Apr 25, 2018
    Posts:
    45
    hii there, soory for asking this question but, i saw a harder edge brush and i wanted to know can i use this asset from somewhere and does it work on my actal unity version?
     
  19. PixelSpartan

    PixelSpartan

    Joined:
    May 11, 2015
    Posts:
    26
    ya working on 2 ?
     
  20. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    Hi, sorry for the slow replies, I've been on vacation for the last couple of weeks.

    The source code is available on BitBucket here: https://bitbucket.org/volumesoffun/cubiquity-for-unity3d

    Unfortunately it is now quite old and hasn't been properly tested since Unity 4. It might not work properly on more recent versions.

    Yes, but it still goes very slowly. I don't get more than a few hours a week to work on it unfortunately. When there is something useful to show I will put the source on GitHub.
     
    twobob likes this.
  21. TravicDeLeon

    TravicDeLeon

    Joined:
    Jan 12, 2018
    Posts:
    4
    Hello,
    I realize this is no longer being developed, but I was hoping you could still help me out.
    I am determined to build my game despite everyone I know telling me that as one person, I have no chance of succeeding.
    I am sure it doesn't help that coding and scripting is proving quite foreign to me.



    Whenever I create a "Terrain Volume Data" from "Voxel Database" The resulting asset is set to read only. Creating an "Empty Volume Data" is set to read/write. Unity says the database is open, so I can not switch the Volume Data for the "from database" one to read/write unless I restart Unity. Is there somewhere this can be changed so the volume data is read/write on the "from database" as well.


    Also:

    I have been able to use the script to generate a planet style database, but would love if I can have an option to create a new "Planet Terrain Volume" with the variables settable at creation. In the same manner as the existing create "terrain Volume" put in the Unity menu.


    Unity gave me two notices when starting this up in 2018 version. I fixed the "GameModeStateChange" one but still have this:
    Assets\Cubiquity\Scripts\Impl\OctreeNode.cs(317,21): warning CS0618: 'EditorUtility.SetSelectedWireframeHidden(Renderer, bool)' is obsolete: 'Use EditorUtility.SetSelectedRenderState'

    The line in the code is:
    EditorUtility.SetSelectedWireframeHidden(meshRenderer, !volumeRenderer.showWireframe);

    Could you tell me the correction. I tried but it just confused me more.

    Thank you for any help you can provide.
     
  22. TravicDeLeon

    TravicDeLeon

    Joined:
    Jan 12, 2018
    Posts:
    4
    I'm also having this problem:
    Cancelling DisplayDialog because it was run from a thread that is not the main thread: Opening file failed Opening file E:/Unity Projects/Test 1/Assets/StreamingAssets/Cubiquity/VoxelDatabases/CreatedForAssets/planet-1577009808.vdb: The process cannot access the file because it is being used by another process.

    It seem like something is not closing properly?
     
  23. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    522
    I'm sorry, I don't remember the details here. But you do have a work around, in that you can restart Unity? And you only have to do this once to change the flag, and then it stays read/write? So hopefully it is not too inconvenient..

    You'll need to do some programming for this I'm afraid, I didn't create a user interface for it.

    I don't have Unity installed anymore so I can't test, but I would try replacing that single line with:

    Code (CSharp):
    1. if(volumeRenderer.showWireframe)
    2. {
    3.     EditorUtility.EditorSelectedRenderState(meshRenderer, EditorSelectedRenderState.WireFrame)
    4. }
    5. else
    6. {
    7.     EditorUtility.EditorSelectedRenderState(meshRenderer, EditorSelectedRenderState.Highlight)
    8. }
    It should compile at least, I'm not certain the functionality is correct (maybe 'Highlight' should be 'Hidden'?) but I also don't think it's critical.

    I'm sorry, I don't know... it's too long since I worked with this system! But keep this page in mind i case it is relevant:

    http://www.cubiquity.net/cubiquity-for-unity3d/1.2/docs/page_duplication.html

    Sorry I can't be more help!
     
  24. TravicDeLeon

    TravicDeLeon

    Joined:
    Jan 12, 2018
    Posts:
    4
    Sorry that code snippet Didn't work. I will work on it. Thank you anyway. I appreciate your response.
     
  25. Marble007

    Marble007

    Joined:
    May 4, 2018
    Posts:
    1
    Do you have any ideas?
     
  26. Aismudi

    Aismudi

    Joined:
    Sep 14, 2017
    Posts:
    5
  27. Aismudi

    Aismudi

    Joined:
    Sep 14, 2017
    Posts:
    5

    How can i export Cubiquity terrain mesh? I find this function only run at runtime.
    https://bitbucket.org/snippets/volumesoffun/EEjedk/export-terrainvolume-as-mesh-prefab
     
  28. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    455
    I have just discoverd this and think is interesting and I do not know if there will be a possible 2.0 version and will be available again the asset store.

    thanks
     
    AldeRoberge likes this.
  29. AldeRoberge

    AldeRoberge

    Joined:
    Jun 23, 2017
    Posts:
    60
    3 years later, I'm wondering the same thing.