# Procedural Planet

Can the GE handle a Procedural Planet, and if so has anyone done a tutorial on how to build one?

Yes if you know what your doing. and No on the tutorial.

Well I don’t know what I am doing as far as that goes and hope that tutorial will come along to teach me…

Does this help?

Very nice but that is not exactly what I am working on think of being in space and then comming into the atmosphere and down to the surface as it gets larger and larger until you land.

There is no tutorial, but I think something along the lines of what you are describing could be done with the BGE (it won’t be as good as it’s commercial counterpart, but a “scrap up” version could be done IMO)

It would all revolve mostly around the LOD system. Writing one in python should not be all that difficult, (actually I think that there is one posted on the blender GE documentation page already, look it up). Basically you would slowly start adding simple geometry as you kept getting closer, then you would reaplace that with geometry of a greater detail, and then finally when you get close to the “on-ground” level you would load up your high poly geometry and other relevant objects. It all works in levels (hence LOD).

Or:

You could use a transitional layer to cross between “space” and lower environment. The transitional layer is just a temporary environment that you put the player in to block his view of the outside geometry, while you switch one environment for the other.

For your “planet” situation, I would use clouds as a transitional layer. It would make things look quite seamless. You would have the planet coming in closer and then slowly you would start creating cloud particles around the player, then slowly decrease the alpha (have the clouds fade in slowly), when the player is engulfed in clouds, you remove the space scenery around him and add the ground level. Then just have the clouds fade back out and ta-da, a seamless transition. To go back into space you do the same thing, only in reverse.

I think using the combination of a transitional layer and a good LOD system would make for good performance. However you can probably get decent results with just using one technique (in which case I would definitelly go with a transition layer)

PS: I don’t know if “transition layer” is an actuall game dev term, but that’s what I have always called it, so take it for what it’s worth.

Well I’m not to sure about this method as I am just learning python.

But

You could use a transitional layer to cross between “space” and lower environment. The transitional layer is just a temporary environment that you put the player in to block his view of the outside geometry, while you switch one environment for the other.

For your “planet” situation, I would use clouds as a transitional layer. It would make things look quite seamless. You would have the planet coming in closer and then slowly you would start creating cloud particles around the player, then slowly decrease the alpha (have the clouds fade in slowly), when the player is engulfed in clouds, you remove the space scenery around him and add the ground level. Then just have the clouds fade back out and ta-da, a seamless transition. To go back into space you do the same thing, only in reverse.

I think using the combination of a transitional layer and a good LOD system would make for good performance. However you can probably get decent results with just using one technique (in which case I would definitelly go with a transition layer)

PS: I don’t know if “transition layer” is an actuall game dev term, but that’s what I have always called it, so take it for what it’s worth.

This sounds like something that I could do.

As you come in from space you would see the planet and its alpha of the clouds, you pass through that layer and on to the next of the planet surface pass through that and then on to the actual surface to scale.

If that works with all the normals flipped out, from the ground all you would see is space, oh and if you do another alpha with the normals flipped in you should see the clouds when you look up. That is if I understood you correctly.

Thx Social I will give this a try.

I can’t tell if you did. It seems to me like you are trying to have both earth and space enviroments existing in game at the same time, and in my view that’s a no-no for performance.

Let me try to explain clearly:

You are in space. You have a space theemed skybox around you and the earth is simply an icosphere with a subdivision of 4, uv mapped with a texture of the planet earth.

As you get closer and closer (to the point where the earth texture starts to get blurry), you start creating a cloud particle field around the player. Adding an alpha channel to your cloud particle texture will allow you to slowly fade the cloud particles in, giving an illusion of “atmosphere insertion”. Once the player is completelly engulfed in the cloud particle stream, you remove the “planet” (icosphere) and “space” (the space theemed skybox), then you add the “sky” (regular skybox) and the ground level below (like your buildings, houses mountains etc). Then you fade out the cloud particles, and just like that the player is in a new environment.

I think the clouds area is where you misunderstood me. When I talk about clouds, im not talking about a cloud texture mapped to the planet, I’m actually talking about a cloud particle field that is to be created around the player.

The transition clouds are meant “only” to aid in blocking the players view, so that the environment can be replaced seamlessly. The transition clouds are not there to be the overall environment clouds, for that you use a skybox.

I hope that cleared it up.

How bout you dont have a transition layer at all.

This is what im currently planning on doing.
Have a large radial mesh that is sub-divided in such a way that its vertex density is a nice gradient from very dense at the center to not so dense on its outer edge.

So now you pretty much have a disk. Given that you have already specified the average radius of your planet you wrap the mesh to the shape of a sphere. You do not make the disk become entirely spherical but you just stretch it out over “the sphere” depending upon the viewing camera’s elevation from the surface of the planet (how far until you see the planets horizon). If you consider the outer edge of your disk to be the horizon than its easy to warp it to just show the parts of the planet that are visible to the viewer.

This is also a very nice LOD system because the higher your elevation the less detail you should see and because you are stretching the disk your vertex density will become less. And by wrapping the disk in this way when you view the planet from an elevation large enough you would see the entire planet as a whole because the disk has wrapped it self to almost a half sphere at that point.

The next step is to then displace each vertex using whatever algorithm you see fit.

This is just how you could generate the topology of the planet. So weather and the objects you populate the planet with is another deal.

Hmm…a little messy, but interesting nonetheless.

I still think a “clean break” between environments does a little more for efficiency. It would also make things more manageable in many respects, due to the distinct seperation of earth and space environments.

However, the method you are describing would definitely provide a better illusion of continuity.

All I can say I can’t wait to see how this turns out and have the chance to learn it.