Search Unity

Planetary Terrain: Quadtree Planets for Unity

Discussion in 'Assets and Asset Store' started by simitro, Nov 10, 2017.

  1. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    Planetary Terrain adds spherical worlds to Unity. The level of detail dynamically changes, high quality terrain always is around your camera. This allows for a smooth transition from space to the ground. A floating origin system always keeps the origin close to the player, it allows planets to have an essentially unlimited radius. An included demo scene has a planet the size of Earth.

    Planets use spherical heightmaps that can be generated with a built-in tool or are dynamically created with noise. There is also a hybrid mode that uses both methods.

    Earth-like Planet, Radius 50 000 units




     
    Last edited: Jun 6, 2020
    Gekigengar, Siccity and softrare like this.
  2. Asanay

    Asanay

    Joined:
    Nov 6, 2015
    Posts:
    8
  3. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    Hello,
    Tell me more the project
     
  4. Asanay

    Asanay

    Joined:
    Nov 6, 2015
    Posts:
    8
    I do not know much.
    But this is something like the old planetary terraine
    With the possibility of larger planets. Like so.
    I hope I understand correctly ...


    https://www.assetstore.unity3d.com/en/#!/content/101118

    taylank
    1. Features:
    2. -Planet radius only limited by the floating point precision you need (10 000 ~ 100 000 units)
    3. -Built in noise generator and converter from Textures for RAW-heightmaps
    4. -Planet Shader with up to four textures and normal mapping
    5. -Atmospheric scattering shader
    6. -All source code included
    7. -Quadtree based dynamic, adjustable LOD
    8. -Bilinear Interpolation prevents pixely surface
    9. -Unlimited heightmap resolution


    Reply from publisher
    1 week ago

    Performance issues and exceptions have been fixed in the latest update. A better ocean system and floating origin will be added soon, that will allow for even larger planets and fix the seeming LOD blockyness. Terrain Generation at runtime isn't included on purpose because of bad performance. Heightmaps are only about 10MB in size after compression.​
     
  5. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    Looks like it has a LONG way to go. Its currently an idea. It is not ready for the asset store from what I can see.
     
  6. rapidrunner

    rapidrunner

    Joined:
    Jun 11, 2008
    Posts:
    944
    It is a good starting point. Maybe the price for what it offer, is a bit high; but it is a good start as base to do quad manipulation.
    Ideally you should make something that allow to spawn a planet; set parameters for water and land ratio, terrain variations and atmosphere, and then will be up to the users to add props on the terrain (trees, buildings, creatures and such).

    Keep up the good work.
     
  7. patchworkx

    patchworkx

    Joined:
    Nov 8, 2014
    Posts:
    20
    Planetary Terrain
    hopefully anywhan is an possible standard asset..--
    thanks all folts producing it..`


    lookin forwards about importing data into the
    Planetary Terrain
    [such as : https://assetstore.unity.com/packages/tools/terrain/terrain-importer-21223 ]
    it will /would be nice to have the possibillity to direct import terrain data from external software producers such as:
    http://www.world-creator.com/features/
    http://www.world-machine.com/
    https://store.speedtree.com/unity/
    http://rbx.e-onsoftware.net/outage.html?f=14&t=10287&p=49891&sid=0172b01a9e770f7443d14174a01fc8c7


    same interresting is all that feachers (errosion ,those noise generators,sone brushes to directly edit what is done automatically,+++an big save and exportbutton wich works fine... )


    [ probably nice to work an bit together with some others on asset store..:
    probably....-

    https://assetstore.unity.com/packages/tools/surface-waves-rivers-lakes-and-oceans-19139
    https://assetstore.unity.com/packages/tools/terrain/worldcomposer-13238
    https://assetstore.unity.com/packages/tools/painting/meshbrush-14453
    https://assetstore.unity.com/packages/tools/particles-effects/circular-gravity-force-8181
    https://assetstore.unity.com/packages/tools/modeling/planet-terrain-editor-generator-20550
    https://assetstore.unity.com/packages/tools/particles-effects/fog-volume-3-81802
    https://assetstore.unity.com/packag...physical-accurate-atmosphere-scattering-27279
    https://assetstore.unity.com/packages/tools/terrain/terrain-quality-manager-28949
    https://assetstore.unity.com/packages/tools/utilities/world-streamer-36486
    ]
     
  8. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    Hi! Thanks for your interest in the asset.

    I am currently working on making the planets a little more visually appealing, and making the noise system easier to use. I will definitely include a randomized prop spawning and grass system, and probably different biomes to regulate it.

    The new noise system is node-based and makes it easier to set the water to land ratio and terrain variations. Buildings and such can already be placed manually or spawned with the API. Make sure to add them to the Objects list of Floating Origin, if you're using it.

    You can import heightmaps with the "Heightmap Texture to RAW" utility already, though the resolution is limited. I will fix that eventually.

    The problem with World Machine and such is that they can't generate spherical terrain, heightmaps they produce would look very distorted, as this asset only supports equirectangular heigtmaps (Like these from NASA).

    I am currently not planning on adding a painting or brush feature to alter the terrain, but if there is great interest in it, I can.

    I think the system has progressed far from an idea and is definitely usable.

    If you have any suggestions or bugs, tell me.

    Thanks!
     
    Last edited: Jan 24, 2018
    Deleted User likes this.
  9. Jeff_CoderDads

    Jeff_CoderDads

    Joined:
    Mar 25, 2017
    Posts:
    11
    Is it possible to adjust the generator to produce non-spherical planetoid like objects? Asteroid's for example?
     
  10. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    You would have to slightly edit the code in the current version, as the heightmap generator always generates an ocean. Otherwise a low frequency and high height scale yields good results, you could maybe add craters with an image editor:
    Capture.PNG
    The node editor that will be released in the next update also makes editing the code unnecessary.
     
    Deleted User likes this.
  11. Jeff_CoderDads

    Jeff_CoderDads

    Joined:
    Mar 25, 2017
    Posts:
    11
    That doesn't look too bad. Maybe a little smoother. You're saying edit the heightmap in an image editor? Don't think it'd be easier to update the heightmap generator to sporadically insert craters if set to?

    And I can set up to 4 textures+normals for heights? Do they blend?

    What's your planned time frame for the next update?

    Are these generated in the editor? Or at runtime? I'd like to build structures on them and have them be loaded/saved.

    Thanks for the example/info.
     
  12. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    As heightmaps are generated with 3D noise creating craters with it is not very straightforward, though doable.

    You can currently assign the textures based on height and they blend.

    Heightmaps are generated in the editor, but there is also a noise generation mode for planets, where you can set some parameters and then everything is generated at runtime. If you want to save the created meshes, you can easily write a script to do that. I might include one in the update.

    I will release the update within the next two weeks.
     
  13. Jeff_CoderDads

    Jeff_CoderDads

    Joined:
    Mar 25, 2017
    Posts:
    11
    Outstanding, I'll be keeping an eye out then, as those features sound a lot like what I could use for my project. Thanks!
     
  14. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    You can have craters using dot product around a vector direction
     
  15. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    The screenshots do not show cracks in the mesh. Has that been resolved? What about colliders, can I collide with the surface?
    Do you have a video showing from orbit to landing?
    The planet radius shown above is very small. Do you have an example showing things work at a more realistic planetary scale?
     
  16. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    Cracks were never present in any release, there is just a picture in the documentation to show how it looked when they weren't fixed. Colliders can be generated. Here is a video of going from orbit to the ground. It also includes a planet the size of Mercury, in the current release there is a demo scene with a planet the size of Earth.
     
  17. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    Thanks for the quick reply! I've now taken a look at the demo exe's and am quite impressed. Can't wait to try this
     
    Last edited: Feb 9, 2018
  18. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    My planets look nice from orbit, and i'm quickly getting the hang of the major generation parameters, but when I get down close to the surface no matter what I've tried it appears very smooth and flat, and the textures blurry. Or my framerate drops to a slideshow.
    Is it possible to use different textures based on the LOD level, and can I introduce more noise in the really detailed meshes? I didn't find the documentation to be of much help to be honest, and have just been using trial and error so far :)
     
  19. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    What generation mode are you using? If you use a heightmap, try switching to hybrid mode and adding some high frequency noise (frequency depends on planet size). If you use noise, increase octaves, and maybe frequency.
    The parameter Texture Scale of PlanetSurfaceShader is responsible for tiling, the normal texture tiling does nothing. You currently cannot use different textures based on LOD, only the scaled space copy has its own texture if you're using it.
     
  20. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    Sneak peek at the update:

    Rotating planets:
    giphy.gif
    (Might not work well with very large planets because of floating point inaccuracies)

    Noise Node Editor:
    Capture.PNG

    Foliage:
    screenshot foilage.PNG
     
    Last edited: Jun 6, 2020
  21. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    how large is very large?
     
  22. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    I don't have a huge sample size, but small gaps appear between the quads when I tried using it with an earth sized planet with subdivision level 14 (vertex distance of ~25m). I might be able to fix it with double precision Vectors and Quaternions or something else, but not in this update.
     
  23. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    Awesome stuff, can't wait for this!
     
  24. Baconation4

    Baconation4

    Joined:
    Oct 7, 2016
    Posts:
    27
    Just grabbed this the other day, so far it seems very smooth and well put together.

    I've got the older version of this that became deprecated on the store and tweaked it a lot to my own needs.

    Do you ever plan to put in generation that doesn't exclusively happen in run time? Where the planets can be generated without having to press play?

    I'm also having a little difficulty getting the floating origin to work with some objects for the scene as well, hoping you may have a quick rundown on that. Trying to get a basis for having large station like objects orbiting the planets, but with its own localized gravity, which also leads me to ask if the spherical gravity script is just for the surface of the planet? As the float radius seems to be based on the radius of the planet in the code.

    I've got all the scripts and such for the older module of planetary terrain if you ever want to take a look since it is deprecated. Some of the features I am currently looking for are scattered throughout that project.

    I like your scaled space workings as well, but I cannot for the life of me get a scaled space planet that looks like its parent planet. In fact, I still haven't been able to get a planet from heightmap, or even hybrid for that matter to look like anything but a flattish surface, as it for some reason doesn't let me alter the height scale away from .02. All of this while trying to follow the PDF instructions to the T, and even copying the desert planet game object and just switching out the heightmaps/generation details of my own planet, which didn't work either.

    So far, some of the scripts have been much more useful than the actual project itself. As I have spent the better part of a day now trying to get a planet generated with the floating origin working for objects such as stations and stationary ships to find on the ground of the planet, while also adhering to the gravity of the planet itself and the scene in general.

    Hoping you are able to address some of these questions for me,
    Thanks

    Edit: So I am tweaking with the node editor and having more success with the correct module for generation, that may have been my issue there.
     
    Last edited: Feb 17, 2018
  25. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    I should be able to implement planets generated in scene view.

    There is really not much I can say about floating origin, when objects are added to the array, they use it, otherwise the player is always moved back to them when over the threshold, as they stay in the same place and aren't shifted.

    Spherical gravity works everywhere, not just near the surface. It needs the radius to calculate the force because the gravitational acceleration at the surface is set in the inspector, and the distance of the surface to the center changes with (is) the radius. Just make sure to turn off the built-in gravity (I forgot to do that in the earth-sized example scene).

    I just tested it myself and there seems to be a weird Unity bug with the desert planet scene and prefab where you can't change the height scale. Just create a fresh planet, then it should work.

    If you are planning to have space stations in orbit, it might be better to not use Unity's built-in physics, but an "on rails" approach. I highly recommend this talk from the Kerbal Space Program devs if you haven't seen it yet. It has also been a great help for this project.

    What is not working when generating a scaled space texture? Are the land masses offset? It should work fine when you just copy all texture height and id values from your planet.
     
  26. Baconation4

    Baconation4

    Joined:
    Oct 7, 2016
    Posts:
    27
    Thanks for the reply. I've had more time to toy around with things and have gotten the scaled space texture working. I think I'm just having a fuzzy brain day to be honest.

    I see what you mean about the gravity as well. And yeah I think you're right about the bug. I noticed that it occurs when you have a prefab already in the scene, and doesn't let you alter the saved prefab, but a new empty object with the planet script worked.

    I'm a big fan of the heightmap generator so far too now that I have gotten the hang of it.

    Bigger stations in orbit will definitely be on rails. It isn't going to be necessarily similar to KSP in the launching physics of today, but there may be some aspects, and that video has helped a lot so far, so thank you for making me feel better knowing that it is a great resource.

    I'm going to continue toying around with floating origin. I've got some object assets I am trying to get working, such as a station prefab currently just sitting in orbit but not using gravity so it is static. Just need to piece it out I think.

    Thanks again!
     
  27. Baconation4

    Baconation4

    Joined:
    Oct 7, 2016
    Posts:
    27
    Actually two more questions for now.

    Is there a way within the asset right now to have travel from one surface to the other or will there need to be some script tweaking? If I set up the planets in regular space with scaled copies, will they align in scaled space as well?
     
  28. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    There are some bugs with the node editor. If I leave the node editor and go back to it again, all the cables have disappeared, and the operator nodes no longer have any input connectors, nor can they be deleted (without first duplicating, then deleting the dupe, then deleting the original).
     
  29. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    You can travel from one planet to another, the only thing you'll need to tweak is the position of the scaled space copy.
     
  30. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    I couldn't reproduce the bug. Do you know exact steps to always reproduce it?
     
  31. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    Create two generators. Create an operator. Change operator to Add. Connect the wires from generators to operator, and operator to output. Serialize. Close editor, open editor.
     
  32. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    Sorry, still can't get the connections to disappear. Are any errors thrown? If so, can you send me the log?
     
  33. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    I think the problem is limited to a particular canvas, since I can't reproduce it on a new one. That, or it disappeared when I switched canvas. If it comes up again I'll let you know.
     
  34. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    There's an array out of bounds error if the width and height of the heightmap given in the planet script do not match the actual heightmap dimensions. Hopefully you can protect against that somehow, it seems risky to require manually specifying the w and h manually.
     
    Last edited: Feb 22, 2018
  35. Baconation4

    Baconation4

    Joined:
    Oct 7, 2016
    Posts:
    27

    Where am I able to adjust the parameters for the scaled space copy? It only generates at run time, so any changes made during play mode will not stay was my understanding.
     
  36. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    Yes, that is correct. You can edit the CreateScaledSpaceCopy() function of the Planet MonoBehaviour to create the copy somewhere else (Edit the Instantiate() call). You'll also need to add the offset to the scaled space camera position in the ScaledSpace MonoBehaviour.
     
  37. Baconation4

    Baconation4

    Joined:
    Oct 7, 2016
    Posts:
    27

    Hmmm, I will definitely take a look at the scripts today then for sure, thanks for the quick reply.

    I see many possible uses for this asset, so I am excited to see its continued development and improvement. In the meantime I'm just trying to become a little more fluent with it so I can pose some better questions and hopefully make some possible feature requests in the future.
     
  38. Baconation4

    Baconation4

    Joined:
    Oct 7, 2016
    Posts:
    27
    Does this mean I will need to make script copies of the planet script for each planet object that I want in the scene?

    How does the scripting handle the camera and floating point changes from body to body with nearly all the scripts requiring a specific parent body?

    Or am I choosing one parent body for essentially everything and then generating other planets based on the slightly modified scripts but named planet1, planet2, etc, to reflect the position of the scaledspace copy for each respective body?

    I have a procedural system script that I am thinking of using, which would generate a system using the scaledspace prefabs of each planet essentially (I plan to make a lot of prefabs), and then base the larger normal scale system based on those locations.

    Maybe a detailed guide in the next update on how to achieve interplanetary travel? I know I would definitely be appreciative of that.
     
  39. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    You can just use variables, you don't have to copy the script. I will work on interplanetary travel for the next update, I have decided against implementing planets generated in scene view though. Saving all quads with meshes would take up at least another 100MB of space for a small planet, probably more. It's way simpler to just add a loading screen and wait a few seconds.
     
  40. Fortitude3D

    Fortitude3D

    Joined:
    Sep 7, 2017
    Posts:
    155
    Interesting man, thankyou :)
     
  41. Baconation4

    Baconation4

    Joined:
    Oct 7, 2016
    Posts:
    27

    Awesome, thank you
     
  42. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    Any advice on how to get the planet material to look good with the scaled space material?
     
  43. Stykm

    Stykm

    Joined:
    Jun 1, 2016
    Posts:
    2
    Hi, I have just bought the asset and I was wondering, how can I do to have several planets on the same scene ? Thank you in advance !
     
  44. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    You can just copy your planet GameObject and move them far apart. As we've discussed I will implement some features to make that work with scaled space, you currently cannot use that.
     
  45. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    Calculate the average color of your textures with the utility, then apply that in the generator. Alpha is smoothness, so you'll will probably want that at zero for everything except the oceans. Also make sure to use the highest texture resolution for the scaled space texture and the heightmap, which you can use as a normalmap with Unity's converter.
     
  46. oznogon

    oznogon

    Joined:
    May 9, 2016
    Posts:
    2
    HeadClot88 likes this.
  47. Baconation4

    Baconation4

    Joined:
    Oct 7, 2016
    Posts:
    27
    I have both of these assets so I am glad to see the compatibility, definitely going to play with them now
     
  48. Doctor06

    Doctor06

    Joined:
    Nov 1, 2014
    Posts:
    31
    Still Active?
    Is there a roadmap you have available?
    Im kind of nervous to buy and then have it be abandoned just like the last one. I know its not same developer but still makes me nervous.
     
  49. Baconation4

    Baconation4

    Joined:
    Oct 7, 2016
    Posts:
    27
    The last update came out somewhat recently, it's current with the current version of unity. The creator has said that he is working at the moment on the next update, but haven't heard anything in a few weeks. Hopefully just finishing it up
     
  50. simitro

    simitro

    Joined:
    Feb 13, 2015
    Posts:
    123
    Yeah, still active. New update (mostly bugfixes) has just been approved by Unity. I'm open for feature suggestions!
     
    Baconation4 likes this.