Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

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:
    23
    Soo ma man when the 2 commin up :C
     
  2. PixelSpartan

    PixelSpartan

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

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    520
    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.
     
  4. 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.
     
  5. 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.
     
  6. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    520
    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!
     
  7. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    520
    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
     
  8. 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
     
  9. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    520
    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.
     
  10. 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.
     
  11. PixelSpartan

    PixelSpartan

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

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    520
    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.
     
  13. TwoBentCoppers

    TwoBentCoppers

    Joined:
    Feb 12, 2017
    Posts:
    7
    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.
  14. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    520
    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.
     
  15. TwoBentCoppers

    TwoBentCoppers

    Joined:
    Feb 12, 2017
    Posts:
    7
    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.
     
  16. DavidWilliams

    DavidWilliams

    Joined:
    Apr 28, 2013
    Posts:
    520
  17. BryanO

    BryanO

    Joined:
    Jan 8, 2014
    Posts:
    128
    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?
     
  18. TwoBentCoppers

    TwoBentCoppers

    Joined:
    Feb 12, 2017
    Posts:
    7
    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