Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[Open Source] Quixel Terrain Engine – Smooth Voxel Terrain

Discussion in 'Assets and Asset Store' started by Chippington, Apr 15, 2014.

  1. Chippington

    Chippington

    Joined:
    Sep 20, 2012
    Posts:
    26
    Quixel Terrain Engine
    Quick Voxel Terrain Engine

    The Quixel (Quick Voxel) terrain engine is a procedural (marching cubes) terrain engine that allows for large scale terrain rendering at acceptable generation speeds. If you're looking for fast voxel terrain that allows for caves, digging, and potential, then this may be a good starting point. If you're looking for an engine that specializes in high quality terrain editing and finite worlds, or in-editor terrain editing, you honestly may be better off looking at other solutions like TerraVol, though this may still be able to work for you.

    Original Thread: http://forum.unity3d.com/threads/195585-WIP-Procedural-Terrain-via-Marching-Cubes
    Download (GitHub): https://github.com/Chippington/Quixel

    Example Project: (Tested only on Unity 4)
    Rar - https://www.dropbox.com/s/yu2xkfdi7nsdoqm/QuixelExample.rar
    Zip - https://www.dropbox.com/s/3ooi2p6bgg67pl6/QuixelExample.zip

    Documentation:
    Google Doc:
    https://docs.google.com/document/d/1ha5eLEsvmYe76cXGLJBBtMrsIqIsPUjYbMszIoxdXnI/edit?usp=sharing
    PDF: https://www.dropbox.com/s/gpu1l72x40k0s83/QuixelDocumentation.pdf

    Hello, folks! I’ve decided to go open source with this voxel engine of mine that I've been working on since summer of last year. Due to reasons, progress on this has been stagnating and I don't think I'll have much time to work on it during the coming months. So, instead of letting this rot on a shelf somewhere, I'm releasing it free here. I've documented it somewhat, made a setup and use guide, and overall tried to make it somewhat acceptable for the public. There is undoubtedly a number of bugs currently, I'll list them later in the post.

    Now just to clarify, this is definitely not the best voxel terrain engine out there, and it's very far from being finished. I'll have time to do small bug fixes and answer questions here but overall, progress on the engine with adding new features just isn't going to happen soon. With that said, if others are interested in continuing my work here I would absolutely love that. Get in contact with me and we can talk about it more.

    It's under the MIT open source license, so you're free to use this commercially if you so wish.


    Features:
    • Procedural terrain generation in every direction
    • Level of detail system for large scale terrain rendering
    • Terrain editing (buggy/limited)
    • Node saving/loading system
    • Saved nodes only save changes to the terrain, in RLE compression
    • Threaded terrain generation/saving/loading

    Non-features (planned):
    • Seamless transition between levels of detail
    • Direct heightmap support
    • In-editor terrain editing
    • Vegetation (possibly)

    Note: I may say planned, but these are things far, far, far down the road for me. When I do implement planned features or develop this engine to a point better suited for release, it will be when I pick up this project again months later.

    Known Bugs:
    • Seams between levels of detail*
    • Threads are not stopped when the game ends unless QuixelEngine.terminate() is called

    Webplayer Demo: Coming soon
    Asset Store: No plan to release on asset store currently.


    Screenshots: (Simple triplanar shader, skybox and fog)






    An imgur album containing all past screenshots can be found here
     
    Last edited: Jul 22, 2014
    tequyla and Sir-Spunky like this.
  2. bstone89

    bstone89

    Joined:
    Jun 8, 2013
    Posts:
    5
    This is pretty great of you, I'll totally take a look at it when I get home.
     
  3. Hard target

    Hard target

    Joined:
    Oct 31, 2013
    Posts:
    132
    I am guessing this does not work with the free version of unity.
     
  4. Chippington

    Chippington

    Joined:
    Sep 20, 2012
    Posts:
    26
    It does work with the free version, though. Is it not working for you?
     
  5. Hard target

    Hard target

    Joined:
    Oct 31, 2013
    Posts:
    132
    I have not tested it yet.But I certainly will.I tried the example but i don't know how to dig.Could you tell me?Here is the problem i see with Quixel Terrain Engine.The edges of your voxels are seen in game.
     
    Last edited: Jul 22, 2014
  6. Chippington

    Chippington

    Joined:
    Sep 20, 2012
    Posts:
    26
    The seams between the levels of detail are not easy to fix properly, and is the biggest downside to this engine. I've recently picked this project back up and I'm trying to optimize it to the point where I can try a few different techniques, but it's just not fast enough as it is right now.

    As for digging, it's not implemented in the example. I'll see if I can throw something together later today and try to get my webplayer working.

    Edit: There is also an example from the original thread that has digging implemented, you can check that out here. Although the current implementation is much less buggy.
     
    Last edited: Jul 23, 2014
  7. Hard target

    Hard target

    Joined:
    Oct 31, 2013
    Posts:
    132
    I was thinking that the quixel terrain engine.Would allow me to make a game where the enemy could follow me forever.Or until i kill him or he kills me.I could could make the game so that if i hide from the enemy.He would appear to have a hard time finding me.This could also be done randomly.Meaning sometimes he would find me fast and other times it would take longer.This could be done for every enemy in the videogame.You need to add support for unity trees and
    grass.Meaning you can add that to the smooth voxels.
     
    Last edited: Jul 23, 2014
  8. MarcOrion

    MarcOrion

    Joined:
    Nov 27, 2014
    Posts:
    4
    This is an amazing engine. I am working on something that requires a much simpler voxel engine but I would love to make something with this someday. The thing that struck me the most when checking out the demo is the sheer vastness of the world. It really gives you an impression of a large world.
    I hope you decide to continue with this someday. It’s got a lot of potential.
     
  9. dudester

    dudester

    Joined:
    Oct 25, 2014
    Posts:
    311
    hi first off truly great engine,performance is quite amazing.i was wondering if you of a way to decrease the amount of chunks created at a time,i had a look at your docs but im unsure of where exactly you create the chunks i wanna put a coroutine in between each creation to help with the lag spikes.thanks very much for making this open sourced.:edit so I've had vegetation generation to your world performance is good just gotta find out where you move your chunks around for pooling so I can continue generation of plants at new location,once again truly great engine!
     
    Last edited: Jan 9, 2015
  10. PandawanFr

    PandawanFr

    Joined:
    Nov 27, 2013
    Posts:
    68
    Could you help me? When I copy-paste the script in a new TerrainController.cs script, it tells me "the name 'QuixelEngine' does not exist in the current context..."


    EDIT: Could you possibly make a video on it?
     
  11. dudester

    dudester

    Joined:
    Oct 25, 2014
    Posts:
    311
    you should download the whole project source,that has all the necessary files as well a sample scene.you can also go onto his bitbucket site which is at the top of the page which has a guide to setting up the scene which the op kindly created for us.hope this helps get you started.
     
  12. tripknotix

    tripknotix

    Joined:
    Apr 21, 2011
    Posts:
    738
    http://quixel.se/

    Quixel is already a trademarked product for texturing 3D models, their interpretation of Quixel seems to be "Quick Pixel" similar to your "Quick Voxel".
     
  13. b15h09

    b15h09

    Joined:
    Apr 22, 2013
    Posts:
    4
    Quoxel. Definitely Quoxel.

    This may be just what I've been looking for (kicking around an idea for an RTS with voxel terrain). Thanks for making this available to the community :)
     
  14. jason-fisher

    jason-fisher

    Joined:
    Mar 19, 2014
    Posts:
    133
    Not sure if you're around, and waiting for the demo to download now so I don't have any experience with your implementation, but if you are sampling a chunk based on a set bounds, then you could make a superset of chunks (a 'page') that contains all of the marched vertices that lie on any of the bounds min/max dimensions, and then run marching squares against that superset to create your stitches.
     
  15. deus0

    deus0

    Joined:
    May 12, 2015
    Posts:
    24
    Has anyone found a way to stitch the vertices yet?
    Also thank you for this code, I once got marching cubes to work on ue4, but when i ported my code over I couldn't get it to work again. The maths for me is really difficult for me to understand :/.
    It looks like you use the same lookup map from here:
    http://paulbourke.net/geometry/polygonise/
     
  16. f5fairy

    f5fairy

    Joined:
    Nov 21, 2012
    Posts:
    6
    I also have this problem. And sample project is 404. Please, reupload it.
     
  17. Lesnikus

    Lesnikus

    Joined:
    Aug 29, 2015
    Posts:
    47
    I'm doing all the instructions, but get an error "Assets/Quixel/TerrainController.cs(21,59): error CS1525: Unexpected symbol `<internal>''"

    The file "TerrainController.cs" all the inscriptions "QuixelEngine" underlined in red.

    What to do?
     
  18. Lesnikus

    Lesnikus

    Joined:
    Aug 29, 2015
    Posts:
    47
    Answer my question! I put the files of QuixelEngine to the folder "Quixel" (which was created in the main project folder) and did everything according to the instructions.
    2.jpg



    In the TerrainController.cs i get an error: "The name 'QuixelEngine' does not exist in the current context"
    Please, help!



    1.jpg
     
  19. MrLoki

    MrLoki

    Joined:
    Mar 13, 2015
    Posts:
    1
    at the top of your script you need to add this line
    using Quixel;

    alternately, you could prefix every call to QuixelEngine with Quixel.
    e.g.
    Quixel.QuixelEngine.setVoxelSize......
     
  20. cody42

    cody42

    Joined:
    Dec 30, 2015
    Posts:
    1
    has anyone got this working in unity 5.
    I keep getting these 2 errors when i try to assign materialArray a variable

    IndexOutOfRangeException: Array index is out of range.
    (wrapper stelemref) object:stelemref (object,intptr,object)
    TerrainController.Start () (at Assets/TerrainController.cs:13)

    NullReferenceException: Object reference not set to an instance of an object
    Quixel.MeshFactory.update () (at Assets/_myAssets/Quixel-master/MeshFactory.cs:59)
    Quixel.QuixelEngine.update () (at Assets/_myAssets/Quixel-master/QuixelEngine.cs:63)
    TerrainController.Update () (at Assets/TerrainController.cs:34)

    Materialmaterial=Resources.Load("gmat",typeof(Material))asMaterial;
    materialArray[0]=material;
    gmat is just a green material in the resource folder
     
  21. zollo_hd

    zollo_hd

    Joined:
    Sep 10, 2016
    Posts:
    4
    Is it possible to use 3d perlin noise, because in your examples you only show 2d perlin noise
     
  22. Nimsy

    Nimsy

    Joined:
    Apr 2, 2018
    Posts:
    3
    Hey! Sorry I'm a little late to this post...When I tried downloading the example of the usage of the voxel terrain from dropbox, I get the code 404 'cant find what you're looking for'. Perhaps the link has expired or something? This would be an outstanding asset I could use in my project and I just wanted to mention how generous you were for making this open source.
     
  23. arnesso

    arnesso

    Joined:
    Mar 3, 2015
    Posts:
    93
    Very nice, Any idea how to add digging ,building ?
    thank you
     
  24. JotaRata

    JotaRata

    Joined:
    Dec 8, 2014
    Posts:
    39
    I am having a crash when using Unity 2019.2 with HDRP, my initial guess is that the game overloads the threads and makes them to crash, anyone lese has experienced this issue?
     
unityunity