Hard Light Productions Forums

General FreeSpace => FreeSpace Discussion => Topic started by: Bob-san on June 24, 2007, 03:08:20 pm

Title: Full 3D planet-models
Post by: Bob-san on June 24, 2007, 03:08:20 pm
Just for kicks, I am making a 3D model of the Earth. I have a few questions...

Ok now--where can I find good textures for 3D planet models? Using various descriptions of the size and dimensions of the Earth, I wanted to create a full-scale 3D model (no real surface detail). Now, I know of some of the limitations of creating a smooth sphere that is approximately 12800km wide, but what of getting some good textures of it? How hard would putting a texture onto a sphere be? What is the maximum texture size on the current engine (is it 2048x2048 like I seem to remember)? Finally, could you really place an object over 6500km away? Is it possible to have invisible "layers" around the planet to separate the various parts of the atmosphere?

If i can get the information on getting textures, it would be helpful.

EDIT: Distance edited
Title: Re: Full 3D planet-models
Post by: Polpolion on June 24, 2007, 04:30:01 pm
If it was going to be 6500km away, then why not just use a background image?
Title: Re: Full 3D planet-models
Post by: Bob-san on June 24, 2007, 04:43:19 pm
I have some ideas on it... incorporate a spin, a shadow-area (such as have a sun on the far side so that you can travel to the dark-side of a planet), and a number of other cool visual effects.
Title: Re: Full 3D planet-models
Post by: blackhole on June 24, 2007, 04:46:37 pm
If you were going to do that, why not just use a big hunking ball and give it an earth texture? you can't tell the difference at 6500 km away.
Title: Re: Full 3D planet-models
Post by: Bob-san on June 24, 2007, 04:49:41 pm
That's the idea, but I don't have a realistic noon-time picture of the entire planet... it's basically a gigantic ball that is spinning at somehting like 400m/s.
Title: Re: Full 3D planet-models
Post by: Shadow0000 on June 24, 2007, 05:16:46 pm
Quote
I have some ideas on it... incorporate a spin, a shadow-area (such as have a sun on the far side so that you can travel to the dark-side of a planet), and a number of other cool visual effects.

Have you tried traveling that far, as much as I try my ship explodes when I get about 700000 m / 700 km from my starting point ?, the whole "You have deserted.....DIEEEE!!!!" and your commander kills you, even if you don't have one.

As for the shadow-area, set the ambient_factor to 0. So if you make your planet rotate around it's own axis, it will be day/night dynamic.

Earth is more complex because you can see the lights in the night side, which also uses a map, and I believe that can't be done. See Celestia for an example.
Title: Re: Full 3D planet-models
Post by: Bob-san on June 24, 2007, 07:37:35 pm
How about a glow map? I think it could work well without one--have some explanation of the lack of city-light. I was thinking of a cool mission that takes place during the shift from light-to-darkness and another from darkness-to-light.

I don't want the ships to be able to get close to the planet--the Thermosphere starts at 85km and ends at 690km. I wanted the missions to take place at about 690km out, though I'd go so far as 10,000km out. I've not seen any animated planet-maps--I think 3D planets could possibly make for more-realistic lighting. Any chance I could make a 3D sun?
Title: Re: Full 3D planet-models
Post by: Unknown Target on June 24, 2007, 07:44:34 pm
You could probably make lights on the night side by using a dim glowmap. The effect shouldn't be noticable on the light side, but with an ambient factor of 0 on the night side, it should show up well.
Title: Re: Full 3D planet-models
Post by: Vasudan Commander on June 24, 2007, 07:59:12 pm
If it was going to be 6500km away, then why not just use a background image?

Maybe it could be used for mission purposes, like have a shivan fleet bombard  and actually destroy it.
Title: Re: Full 3D planet-models
Post by: Shadow0000 on June 24, 2007, 08:04:25 pm
Quote
You could probably make lights on the night side by using a dim glowmap. The effect shouldn't be noticable on the light side, but with an ambient factor of 0 on the night side, it should show up well.

Yes, that's the way it's done, however as you say the lights can be seen even in the light side, and it's not simply a light map, the surface on night is different, the glow map for the lights is ok, but's it's not the whole night surface map. Plus the water reflection needs an Specular map applied as an Alpha, however not only the light of the sun get reflected, but also the stars, I am not sure if this is related to the starfield.pof, but any background would be reflected.

Title: Re: Full 3D planet-models
Post by: Getter Robo G on June 24, 2007, 08:56:09 pm
Haven't tried it out in 3.6.9 but AFAIK the distance wasn't changed, correct me if I am wrong. (I requested it though, knowing someone would want it eventually)...
Title: Re: Full 3D planet-models
Post by: Shadow0000 on June 24, 2007, 09:25:03 pm
If you mean the traveling distance, I tried with 3.6.9 and is 700000 m, that's only enough to travel around Mars's moons probabily.

There is also some problem with either model sizes or high distances, but it doesn't happens always, is like the coordinates somewhat start acting erraticaly, and the camera jumps, or if you change the directions the camera starts jumping instead of changing smoothly, I have seen this mostly with exterior views.
Title: Re: Full 3D planet-models
Post by: blackhole on June 25, 2007, 02:44:46 am
That's floating point inaccuracy goodness  :D
Title: Re: Full 3D planet-models
Post by: Tolwyn on June 25, 2007, 02:52:06 am
I've already built an earth model for Saga, but wasn't satisfied with the results. The greatest problem is that lack of atmospheric glow. Without it it does not look like a planet at all. :)
Title: Re: Full 3D planet-models
Post by: Herra Tohtori on June 25, 2007, 03:01:15 am
Just for kicks, I am making a 3D model of the Earth. I have a few questions...

Ok now--where can I find good textures for 3D planet models?

Celestia Motherlode may be a good place to check.


Quote
Using various descriptions of the size and dimensions of the Earth, I wanted to create a full-scale 3D model (no real surface detail). Now, I know of some of the limitations of creating a smooth sphere that is approximately 12800km wide, but what of getting some good textures of it?

Save yourself some problems and make it significantly smaller. I briefly tried experimenting with real-sized planets when I was putting them together for Cardinal Spear, and they had some rendering issues. The polygons were flickering in and out of sight and so forth, and trying to place the planets around in FRED was like hell so I ended up typing numbers in notepad.

Incidentally, there is an Earth model (amongst others) in re-released Cardinal Spear, so you might want to take a look at that as well... it has a texture taken from Celesti Motherlode with some small edits, a shinemap and a glowmap for night time city lights.

Quote
How hard would putting a texture onto a sphere be? What is the maximum texture size on the current engine (is it 2048x2048 like I seem to remember)?

Well aside from TrueSpace's hideous user interface it wasn't actually difficult, as soon as I figured it out and found the correct panels and settings... More difficult was to get PCS to convert the COB to POF without complaining about huge amount of normals.

Maximum "safe" texture size for the engine is 2048x2048 (if I recall correctly) but AFAIK it also depends on the graphics card. I can pretty safely use 4096x4096 textures at least for planets and/or skyboxes, never had any problems with them... At any rate, don't use square texture for a sphere if you can avoid it. It doesn't look good - a better solution is to use a 2:1 ratio like, for example, 2048x1024. Or if you have no problem using textures up to 4096 res, you can use 4096x2048 resolution textures.


Quote
Finally, could you really place an object over 6500km away? Is it possible to have invisible "layers" around the planet to separate the various parts of the atmosphere?

As I said, extreme distances tend to generate problems with rendering, at least according to my limited experience. You *can* do it but what it looks like is a different thing altogether.

What comes to atmosphere layers... yes, it's possible, but the advantages wouldn't likely be worth it. Essentially you would need to meddle with alpha transparency for the texture.

Also you would need to make the outermost "shell" the actualy body of the object, then the inner ones would be subobjects and the actual surface would be the last subobject on the list, so it would be rendered last... And it doesn't even look very realistic or good - you would need dozens of shells to make the atmosphere look even remotely realistic. I tried it with one shell and ditched it. I can find a screenie if you want to judge by yourself, though.
Title: Re: Full 3D planet-models
Post by: blackhole on June 25, 2007, 03:15:09 am
Newer graphics cards safely handle textures of up to 4096x4096 without a problem. Older ones only go up to 2048x2048, however, so using anything more then 2048x2048 really isn't recommended.
Title: Re: Full 3D planet-models
Post by: Tolwyn on June 25, 2007, 03:20:23 am
Newer graphics cards safely handle textures of up to 4096x4096 without a problem. Older ones only go up to 2048x2048, however, so using anything more then 2048x2048 really isn't recommended.

Yep. One could "split" a 4096 map into four 2048 maps though.
Title: Re: Full 3D planet-models
Post by: Bob-san on June 25, 2007, 11:43:11 am
I was playing around with how smoothly the model comes out. At the scale I want to implement it, I had to go to about 100 horizontal and 100 vertical, making approximately 9500 vertexes and faces. It looks smooth from what I've seen, though TrueSpace won't rendering it and Blender doesn't want to import it properly. I'll keep looking around... is there a link to the campaign so I can get it?

Another thing--does anyone know of a good place to get smooth, realistic, fake surfaces for other bodies? I'm thinking about surfaces such as far-off planets in this solar system and to put them into others.

Final thing--is there a way to make a 3D sun?
Title: Re: Full 3D planet-models
Post by: Shadow0000 on June 25, 2007, 12:05:02 pm
Quote
That's floating point inaccuracy goodness

I am afraid it was that...

Quote
I've already built an earth model for Saga, but wasn't satisfied with the results. The greatest problem is that lack of atmospheric glow. Without it it does not look like a planet at all.

http://i29.photobucket.com/albums/c254/Shadow0000/screen0920.png
http://i29.photobucket.com/albums/c254/Shadow0000/screen0923.png
http://i29.photobucket.com/albums/c254/Shadow0000/screen0928.png
http://i29.photobucket.com/albums/c254/Shadow0000/screen0929.png
http://i29.photobucket.com/albums/c254/Shadow0000/screen0930.png

Notice how the Specular (Alpha) map for the water makes the earth reflect the starfield, this doesn't happen if you don't use an Skybox, but that's not a solution. The other problem is that normally the atmospheric glow should look orange when you get right before the sun usually seeing the sun from night side of the earth.
Title: Re: Full 3D planet-models
Post by: Grizzly on June 25, 2007, 12:11:26 pm
 :eek2:

That's an truly awesome thing!
Title: Re: Full 3D planet-models
Post by: haloboy100 on June 25, 2007, 12:17:08 pm
expect too see this in the next few campaign releases! ;7
Title: Re: Full 3D planet-models
Post by: Shadow0000 on June 25, 2007, 12:24:02 pm
It gives all problems the same problems that people has been reported about 3D planets even when it's a scaled down version of the earth. It's not that accurate real colours seem to dimer, see Celestia for example:

http://i29.photobucket.com/albums/c254/Shadow0000/Earthasitshouldbe.jpg

However I tried to get something like this:

http://i29.photobucket.com/albums/c254/Shadow0000/Earth_Hi-Res-BackGrounds.jpg (1 and 2 specifically)

is Celestia really accurate in terms of looks ?
Title: Re: Full 3D planet-models
Post by: haloboy100 on June 25, 2007, 12:26:13 pm
I don't see the point of rotation-glow-map thingy, since you won't make a mission that lasts long enough to see any difference if you have a planet rotating on it's axis.
Title: Re: Full 3D planet-models
Post by: Shadow0000 on June 25, 2007, 12:56:04 pm
If you would travel high distances it would be useful, like using either autopilot or timedrive, at 64x and 100 m/s it takes you like 128 min. (2 real min.) to travel about just 700 km, which in terms of planets is not a great distance.

The problem is that you would need to cut maps for the earth in half and half, for day and night in different time sets, and you could make as muchs as you want to use, you can later use the texture change option in FRED2, that's ok between missions, but in mission it would need to be dynamic.

The clouds also rotate at different speed than the earth itself, the one I posted above is modeled to do so, since surface and cloud maps should be separated models/maps and each one with it's own axis rotation speed.
Title: Re: Full 3D planet-models
Post by: Bob-san on June 25, 2007, 01:56:18 pm
One of the points I want to implement is the ability to show a battle based on location. Saying that the battle took place at a certain point above orbit makes some storytelling more accurate... I was thinking of adding a number of the unconfirmed planets.

Anyways... how "impossible" is setting a planet 900km away? I was thinking of having some major battle take place between the Thermosphere and Exosphere... is it possible to have variable ship-speeds based on distance from an object? I would like to simulate more-accurate physics by having some cool stuff like a space-station moving in orbit. I'll figure out the exact numbers to use for rotation, if it is at all possible.