- Home /
How to make terrain spherical?
Ive just been messing around with unity and I thought that a game with seamless space to planet travel would be pretty neat. I kind of thought that it would be simple so that all I would do is make unity terrain into a sphere, add a center of gravity, put a layer of "fog" that would act as an atmosphere and filter the space skybox to a different color and make the illusion of a sky and then finally have them rotate on a axis and revolve around a certain point (the star). But it seems that Unity wants to be hard to deal with and I cannot find anyway possible to make terrain spherical. The reason I would rather have terrain than just some sphere is because I could use assets that make terrain editing really easy and detailed such as Gaia. So does anyone know a way to make terrain spherical so that I can do this?
If commercial assets are an option, check out "Curved World":
Answer by tanoshimi · Oct 16, 2016 at 09:33 PM
You can't make a spherical terrain. But if you just want to create the illusion of spherical falloff you can do this by bending far vertices away from the camera in the shader, as in https://alastaira.wordpress.com/2013/10/25/animal-crossing-curved-world-shader/
Ok so how do people make planetary terrain for games that has seamless travel from space to planet? Ive seen it done but have not seen how to do it. This asset can do it https://www.assetstore.unity3d.com/en/#!/content/30263 but I dont feel like paying 225$
Are you talking about games made in Unity or not? Because most professional developers and studios make their own graphic engine before making a game, so it is very easy to them to make a planet.
As Double$$anonymous$$ax said, you could buy an Asset in the Asset Store. Some people don't need to buy any asset because they are professional programmers, and work with other programmers to make very complicated scripts that can make almost anything.
The tricky thing about the Terrain is that it is too detailed to make simple things such as rotating and changing it's mass. (I am talking about real mass, not physics). That's why Unity doesn't have such a tool. Now why they don't make a tool that can do this? Well, i think it's because almost every terrain is different than the other and make a tool that would do such thing would make most terrains appear very bug and all.
Answer by FluffyFreak · Nov 01, 2016 at 10:18 PM
I don't think that you can use unity's built in terrain system for a true spherical terrain/planet.
However one way that it is usually dealt with a "Quadrilateralized spherical cube" where each cube face is a quad-tree. There's a really nice explanation here: https://britonia.wordpress.com/2010/05/20/planet-geometry/ and another here https://acko.net/blog/making-worlds-1-of-spheres-and-cubes/
There's also another discussion here already http://answers.unity3d.com/questions/7870/spherical-terrain-object.html
There is no way to use the built-in Unity terrain tool for any of this so you will need to generate your own meshes, deform them, implement a LOD (Level-Of-Detail) system, create collision and handle gravity etc for yourself.
nano1778 but it was late and I clicked on the wrong Add Comment :(
Answer by Mr_Perlful · Aug 01, 2018 at 07:21 PM
@FluffyFreak, actually in regards to your answer, while i agree there are ways around this, i mean i wouldnt recommend what im going to say for an rpg personally, but an rts or something low poly, it doesnt work to badly,
take a sphere object, and then on your character scripts basically have to get the characters rotation and transform and adjust as they make their way around the "world".
i dont have code with me at work unfortunately, but i converted a portion of a building placement script i made for an rts game, took the code that followed an objects curvature and everything looked rightish.
when it comes to buildings i made "foundations" so that the buildings corners were not just "floating".
when it comes to terrain foliage i used the same thing as i did with the characters and buildings, and then wrapped the sphere in a mesh with a meshcollider i made to wrap the terrain mesh. and then used mountain models and what not to create the "terrain".
hardest part was probably pathfinding to be honest.
it was a bit of a bitch to make work, and i didnt ever truly achieve the look i wanted(i am not a graphics/visuals person, i do logic), but it worked!
ill try to hop on later and post some code.
Answer by rykonvolta · Jan 14 at 05:19 PM
A lot of 3D design can't be done well with Unity but Blender is a free and open source tool that can create .obj files in 3D. If you want to take the time to learn that tool, you can download it here: https://www.blender.org/. I would love to see a planetary terrain update to the Unity Engine I guess.
Unity is good for implementing 3D objects in a game but alot of design work is best done with Blender
Your answer
Follow this Question
Related Questions
Random Spheres appearing on my terrain trees 2 Answers
What Space Partitioning is used for Sphere Collider Triggers? 1 Answer
Vector math problem 2 Answers
How to create a spherical skybox??? 1 Answer
Rigidbody gravity between planets 1 Answer