Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: General Battuta on July 17, 2010, 01:39:20 pm

Title: Skyboxes
Post by: General Battuta on July 17, 2010, 01:39:20 pm
Zane, where'd you get that background bitmap? By the way, that pic showing the Hatshepsut is my new desktop wallpaper. After months, the Ouranosaurus nigeriensis got replaced...[/color]

It's the Earth skybox from the Age of Aquarius director's cut.
Title: Skyboxes
Post by: Mobius on July 17, 2010, 01:45:21 pm
Who made that pic?
Title: Skyboxes
Post by: General Battuta on July 17, 2010, 01:51:09 pm
Commander Zane took the screenshots.

The skybox itself is not a 'picture', it's a skybox by HerraTohtori. Skyboxes are very different from background bitmaps, and involve 3D rendering.
Title: Skyboxes
Post by: Mobius on July 17, 2010, 02:02:43 pm
I know, I know... but who actually created the Earth texture for the skybox? Herra Tohtori himself?
Title: Skyboxes
Post by: General Battuta on July 17, 2010, 02:26:43 pm
I believe Herra created it from NASA imagery.
Title: Skyboxes
Post by: Herra Tohtori on July 17, 2010, 02:41:18 pm
I believe Herra created it from NASA imagery.

Correct. The texture is a slightly edited version of NASA's Blue Marble imagery (September image from here (http://earthobservatory.nasa.gov/Features/BlueMarble/BlueMarble_monthlies.php). The main change was re-colouring the seas so that they blended more or less seamlessly to the photographed areas near the coastlines.

The height- and specular maps are likewise found from NASA.

Night time city light map is an enhanced version of a map likewise found from NASA (I wasn't too worried about accuracy as it's the future... basically I enlarged the map, applied it to a noise layer as a mask and then adjusted brightness and contrast as I desired to create individual pixels of light as opposed to huge blobs of illuminated areas.

If you want to know more, go here (http://www.chamberlinproductions.org/earth.html), that's the tutorial I used to re-build the photo-realistic Earth.

By the way, anyone know how to easily map an icosphere to use eight textures instead of a single spherical texture? Basically so that the main texture would be divided into a 2x4 array of eight square textures. If I could adjust the model that way, I could potentially use even higher resolution textures which would of course result in even better skyboxes...

Is there no other way than UVmapping it? :nervous:
Title: Skyboxes
Post by: Mobius on July 17, 2010, 02:52:49 pm
Thanks for the detailled explanation. :)

About your request: a new thread in FreeSpace Modding will be enough, IMHO. If there's a lot of potential, things will come to fruition. ;)
Title: Skyboxes
Post by: Snail on July 17, 2010, 02:59:21 pm
TBH I really dont like the Earth skybox...
Title: Skyboxes
Post by: General Battuta on July 17, 2010, 03:04:08 pm
I'm actually not a huge fan of it either, but according to Herra this is a consequence of the realistic techniques employed.
Title: Skyboxes
Post by: TopAce on July 17, 2010, 03:06:00 pm
I find it pretty good. Of course that's only part of the skybox that I can see.
Title: Skyboxes
Post by: Mobius on July 17, 2010, 03:20:48 pm
The only real problem I have with planet skyboxes is that you have to stick with fixed dimensions without any chances of altering. Well, the fact that you can't use nebulae (they end up covering the planet) is also discouraging.
Title: Skyboxes
Post by: Droid803 on July 17, 2010, 03:27:16 pm
I'm actually not a huge fan of it either, but according to Herra this is a consequence of the realistic techniques employed.
If real doesn't look as good as fake, then I'll go with fake.

The only real problem I have with planet skyboxes is that you have to stick with fixed dimensions without any chances of altering. Well, the fact that you can't use nebulae (they end up covering the planet) is also discouraging.

You can use nebulae, just make sure you're not placing them too close to the planet.
Title: Skyboxes
Post by: Herra Tohtori on July 17, 2010, 03:30:54 pm
Here's how it is: The Earth from TBP got used up, so I built a new one.

Anyway, the old Earth skybox (which was privateered from TBP - can't remember who its original creator was) had a lot of flaws. Basically it was just an image/render of Earth that was plastered on a very, very large plane on the skybox, and the apparent diameter of the planet was grossly larger than what the actual surface features visible suggested.

For those interested in the geometric problem, basically the issue was that as you view a sphere from a distance you see very much of the surface facing you, but when you get closer, the amount of surface visible will drastically decrease while the apparent diameter approaches 90 degrees asymptotically as the view angle tangents the planet's surface, defining the visible circular area of the surface...


However, as the new skybox was basically purpose-built for a single scene in AoA - namely the Lucifer cutscene - it needed to match the apparent diameter of the old skybox Earth for cinematic purposes.

As a result, I was required to position the camera close (too close in my opinion) to the surface so that the planet would correctly fill the required amount of apparent diameter out of the 3D scene.

Now, this would not have actually been an issue since technically NASA's Blue Marble textures stretch all the way to insane 86400x43200 resolution. This would have been more than sufficient to offer 1:1 or lesser scaling factor on the visible portion of the surface, which is always desireable in renders like this (results in crisp, sharp rendered image). However, software and hardware limitations forced me to only use puny 21600x10800 resolution textures on the planet, and this of course reduced the quality of the final skybox renders.

Fortunately, in it's intended use in AoA, the camera never really looks very much at the area immediately below the camera, which is worst affected by texture stretching. As a result I and the rest of the team deemed the quality of the skybox sufficient for its intended use, although I have to agree that it is barely passable for other uses.

Ideally I would have mapped the planet sphere so that it would be divided into eight sections, each using a single 21600^2 texture as required. Unfortunately, my practical skills with Blender are not so hot and I don't know if there's a feature to simply do this or if it requires UVmapping, which I know even less of.

In fact, I'm going to post a request for an icosphere model with subdivision 5 or greater mapped in a described fashion.

Anyway, now you know the most likely reason as to why the AoA Earth skybox has sort of blurry textures on some parts.
Title: Skyboxes
Post by: Mobius on July 17, 2010, 03:42:14 pm
Very special thanks to whoever made the Earth bitmap for TBP, but I noticed some of the flaws Herra's just mentioned here. :(

You can use nebulae, just make sure you're not placing them too close to the planet.

A serious problem in large backgrounds featuring dozens and dozens of nebulae... :nervous:
Title: Skyboxes
Post by: General Battuta on July 17, 2010, 03:45:38 pm
Very special thanks to whoever made the Earth bitmap for TBP, but I noticed some of the flaws Herra's just mentioned here. :(

I'm pretty sure TBP uses a skybox, not a bitmap.

A serious problem in large backgrounds featuring dozens and dozens of nebulae... :nervous:

Take the Blue Planet approach and put the nebula in the skybox itself. Have you seen the skybox in the Director's Cut Vishnan missions? It has a nebula backdrop that simply couldn't be done with the normal FS2 nebula system.
Title: Skyboxes
Post by: Droid803 on July 17, 2010, 03:46:21 pm
Wouldn't using the Jupiter skybox from TBP with the bulging planet solve some of this?
Title: Skyboxes
Post by: The E on July 17, 2010, 03:52:57 pm
Except that using TBP assets outside of TBP is impossible.
Title: Skyboxes
Post by: Mobius on July 17, 2010, 04:03:35 pm
What do you mean?
Title: Skyboxes
Post by: Dragon on July 17, 2010, 04:04:28 pm
TBP team members don't like if somebody uses their assets outside TBP.
Also, BP Jupiter will be much better than TBP one.
Title: Skyboxes
Post by: General Battuta on July 17, 2010, 04:04:44 pm
You cannot legally or morally use TBP assets outside of TBP. The team has forbidden it.
Title: Skyboxes
Post by: Mobius on July 17, 2010, 04:07:50 pm
By "team" you mean IPAndrews?
Title: Skyboxes
Post by: General Battuta on July 17, 2010, 04:13:08 pm
By "team" you mean IPAndrews?

Actually IPAndrews requested that the whole mod be taken down. I believe the team (for obvious reasons) rejected this but settled on the compromise that TBP assets cannot be used outside the mod without specific permission of the asset creator, which in many cases is or includes IPA.
Title: Skyboxes
Post by: Dragon on July 17, 2010, 04:13:29 pm
Not that you'd like to use most of their assets anyway, their models are of inferior quality compared to most fan made stuff (not to mention buggy) and pretty much everything is replaceable.
Project Zatharas is going to work on improving and fixing some of TBP assets, thankfully they didn't forbid use of their stuff.
Title: Skyboxes
Post by: Mobius on July 17, 2010, 04:26:35 pm
If it was IPAndrews who made that pic then I shouldn't have any problems getting the permission to use it. The method suggested by Herra Tohtori a few posts ago seems more interesting, though: it may be the case of giving it a try. :)
Title: Skyboxes
Post by: General Battuta on July 17, 2010, 04:30:32 pm
If it was IPAndrews who made that pic then I shouldn't have any problems getting the permission to use it. The method suggested by Herra Tohtori a few posts ago seems more interesting, though: it may be the case of giving it a try. :)

Made what pic? We're discussing skyboxes.

If you're referring to the Earth skybox in Commander Zane's post, no, HerraTohtori made it, and I assume you are free to use it as all Blue Planet assets are generally up for grabs.
Title: Skyboxes
Post by: Mobius on July 17, 2010, 04:33:48 pm
I got TBP's Earth, but not as a skybox texture: I tested it as an actual background bitmap. I don't know wheter or not the original was for a skybox, but... it shouldn't be that hard to pick up planet textures from skyboxes and turn them into bitmaps.
Title: Skyboxes
Post by: Dragon on July 17, 2010, 04:37:11 pm
I've done this once, it worked quite well.
That could be usefull if you want to make a few missions which take place in one system, so you could use skybox for close ups and bitmap version of the planet when it needs to be visible in the background.
Title: Skyboxes
Post by: Woolie Wool on July 17, 2010, 04:38:18 pm
By "team" you mean IPAndrews?

Actually IPAndrews requested that the whole mod be taken down. I believe the team (for obvious reasons) rejected this but settled on the compromise that TBP assets cannot be used outside the mod without specific permission of the asset creator, which in many cases is or includes IPA.

Consider that I actually asked IPA before his meltdown for permission to use TBP assets in ToF, do I still get protection via grandfather clause?
Title: Skyboxes
Post by: General Battuta on July 17, 2010, 04:42:23 pm
I got TBP's Earth, but not as a skybox texture: I tested it as an actual background bitmap. I don't know wheter or not the original was for a skybox, but... it shouldn't be that hard to pick up planet textures from skyboxes and turn them into bitmaps.

If you can figure out who created it and get their permission, it shouldn't be a problem, so long as you're aware that that image is apparently really technically ****ed up.
Title: Skyboxes
Post by: Dragon on July 17, 2010, 04:46:23 pm
Consider that I actually asked IPA before his meltdown for permission to use TBP assets in ToF, do I still get protection via grandfather clause?
I think that you should, he gave you a premission, so it shouldn't be a problem.
If he changes his mind, he can tell you about it, so if he didn't did it yet, you should be free to use those assets.
Title: Skyboxes
Post by: Mobius on July 17, 2010, 04:47:53 pm
Yeah. Pretty much underlines why I'm not a big fan of planet skyboxes... they pose too many limits. :(
Title: Skyboxes
Post by: General Battuta on July 17, 2010, 04:53:37 pm
Yeah. Pretty much underlines why I'm not a big fan of planet skyboxes... they pose too many limits. :(

I think you've got something backwards. The issues we're discussing here have to do with a badly made skybox (the TBP one) that is effectively a bitmap pasted on a plane.

Ideally all FS2 background bitmaps would be removed and replaced by skyboxes, as they can look and behave a lot better. The only disadvantage they have so far as I know is that they require more work to set up.
Title: Skyboxes
Post by: The E on July 17, 2010, 05:06:19 pm
And if you take into account the fact that skyboxes are better in terms of performance, there isn't really much to be said in favour of traditional background bitmaps.
Title: Skyboxes
Post by: Dragon on July 17, 2010, 05:16:03 pm
You can move them around and rescale, which is a plus for me.
Title: Skyboxes
Post by: Herra Tohtori on July 17, 2010, 06:05:05 pm
Yeah. Pretty much underlines why I'm not a big fan of planet skyboxes... they pose too many limits. :(


Skyboxes have no limitations. The imitate reality as closely as you make the 3D scene to be.

Background bitmap planets have exploits. They enable you to show egregiously falsified views of planets.

Let me elaborate:


(http://img228.imageshack.us/img228/6900/planetvisibility.png)


Here is a planet as it is seen from four points (P1-P4). P1 is the furthest, P4 the closest point.

The apparent diameter of the planet varies depending on the distance.


As you draw tangents to the planet to determine the apparent diameter, you notice that the lines obviously also limit the area that is visible to the view point. Player in P1 is able to see nearly full hemisphere. The line crossing the area visible to P3 is about 1/3rd of the planet's circumference, for P2 it is one quarter of the circumference, and for P4, the line through the visible area is only about 1/8th of the planet's circumference.

Now if you consider that when you change the apparent diameter of a planet bitmap, you're doing nothing at all to change how much area of the planet's surface is visible. It's still a static image of the planet as seen from the original rendering distance.

Skyboxes automatically take care of this. Not so with re-scaleable planet bitmaps. This is my main issue with skyboxes that essentially take any high-resolution planet image available and just scale it to high apparent diameter in the game. Essentially it's like taking a photo of a car, resizing it and then saying that because the photo is larger it was taken from closer.

Now, regarding the seemingly insane texture resolutions, let's take a look at what sort of area of surface is visible in a single skybox render which has 90 degrees field of view:


(http://img411.imageshack.us/img411/2286/planetcameraview.png)


The red area is the actual area visible in the "down" render which is the most critical one regarding texture stretching. It's easy to see from here that the visible area is only approximately 1/24th or so from the entire circumference of the planet from edge to edge.

Practically, this means if you have equatorial resolution of 21600 pixels in the texture, you will have 900 pixels to stretch from one edge to another. If you use 4096^2 resolution, that means the texture is stretched by factor of four. That's a rather heavy amount of blur you get to that texture there.

This is basically the reason why such large textures are needed and useful. For skyboxes where the planet is further from the player (and, subsequently, has lesser apparent radius) much smaller textures are sufficient.
Title: Re: Skyboxes
Post by: Woolie Wool on July 17, 2010, 06:45:18 pm
I think the "limits" he's talking about are that skyboxes only work for a single scene. A planet bitmap sacrifices accuracy to allow you to reuse it for many different scenes. Most people will probably not notice anything wrong with them (except for distortion caused by FOV).
Title: Re: Skyboxes
Post by: General Battuta on July 17, 2010, 06:48:06 pm
I think the "limits" he's talking about are that skyboxes only work for a single scene. A planet bitmap sacrifices accuracy to allow you to reuse it for many different scenes. Most people will probably not notice anything wrong with them (except for distortion caused by FOV).

Yeah but he's explaining why they're basically just faking it. You'd get a better result by just moving the camera and rendering a new skybox.
Title: Re: Skyboxes
Post by: Woolie Wool on July 17, 2010, 06:56:04 pm
Not everyone has the skills or resources to do that.
Title: Re: Skyboxes
Post by: Droid803 on July 17, 2010, 10:15:03 pm
Nor the processing power to handle such huge textures.
Title: Re: Skyboxes
Post by: FUBAR-BDHR on July 17, 2010, 11:14:44 pm
You cannot legally or morally use TBP assets outside of TBP. The team has forbidden it.

Actually you can if you can find out who actually made them.  In the case of the Earth Skybox I have an idea and if so then they can give permission.  I'll ask tonight if they are online.    The whole issue is he claimed everything and since there are no records of who did what unless the person that did it is around and gives permission we can't prove otherwise. 
Title: Re: Skyboxes
Post by: Lt.Cannonfodder on July 18, 2010, 04:23:11 am
Anyway, the old Earth skybox (which was privateered from TBP - can't remember who its original creator was) had a lot of flaws. Basically it was just an image/render of Earth that was plastered on a very, very large plane on the skybox, and the apparent diameter of the planet was grossly larger than what the actual surface features visible suggested.

For those interested in the geometric problem, basically the issue was that as you view a sphere from a distance you see very much of the surface facing you, but when you get closer, the amount of surface visible will drastically decrease while the apparent diameter approaches 90 degrees asymptotically as the view angle tangents the planet's surface, defining the visible circular area of the surface...


To be fair, the TBP Earth was created when skyboxes were completely new (back in 2005 or 2006 I think) and no one quite knew how to make best use of them. Honestly, I'm rather shocked anyone is still using the damn thing, it's badly outdated and outclassed by what can be done today.
TBP assets cannot be used outside the mod without specific permission of the asset creator, which in many cases is or includes IPA.
Hasn't stopped the TBP Earth appearing here and there though. I wouldn't mind otherwise but I would like to be given credit.

Title: Re: Skyboxes
Post by: Mobius on July 18, 2010, 06:53:57 am
Battuta was confusing.

TBP should be credited for that

Yeah. Pretty much underlines why I'm not a big fan of planet skyboxes... they pose too many limits. :(


Skyboxes have no limitations. The imitate reality as closely as you make the 3D scene to be.

Background bitmap planets have exploits. They enable you to show egregiously falsified views of planets.

Let me elaborate:


(http://img228.imageshack.us/img228/6900/planetvisibility.png)


Here is a planet as it is seen from four points (P1-P4). P1 is the furthest, P4 the closest point.

The apparent diameter of the planet varies depending on the distance.


As you draw tangents to the planet to determine the apparent diameter, you notice that the lines obviously also limit the area that is visible to the view point. Player in P1 is able to see nearly full hemisphere. The line crossing the area visible to P3 is about 1/3rd of the planet's circumference, for P2 it is one quarter of the circumference, and for P4, the line through the visible area is only about 1/8th of the planet's circumference.

Now if you consider that when you change the apparent diameter of a planet bitmap, you're doing nothing at all to change how much area of the planet's surface is visible. It's still a static image of the planet as seen from the original rendering distance.

Skyboxes automatically take care of this. Not so with re-scaleable planet bitmaps. This is my main issue with skyboxes that essentially take any high-resolution planet image available and just scale it to high apparent diameter in the game. Essentially it's like taking a photo of a car, resizing it and then saying that because the photo is larger it was taken from closer.

Now, regarding the seemingly insane texture resolutions, let's take a look at what sort of area of surface is visible in a single skybox render which has 90 degrees field of view:


(http://img411.imageshack.us/img411/2286/planetcameraview.png)


The red area is the actual area visible in the "down" render which is the most critical one regarding texture stretching. It's easy to see from here that the visible area is only approximately 1/24th or so from the entire circumference of the planet from edge to edge.

Practically, this means if you have equatorial resolution of 21600 pixels in the texture, you will have 900 pixels to stretch from one edge to another. If you use 4096^2 resolution, that means the texture is stretched by factor of four. That's a rather heavy amount of blur you get to that texture there.

This is basically the reason why such large textures are needed and useful. For skyboxes where the planet is further from the player (and, subsequently, has lesser apparent radius) much smaller textures are sufficient.

Yeah, I know what you mean (I have experience with such pics :nervous:) but, as Woolie Wool stated, skyboxes don't really like flexibility. No doubt they're much more realistic and handy when it comes to perspectives, though.

Do we have any skyboxes featuring a huge planet texture? I'd like to know if there's a perfect skybox for missions which take place right above a planet's atmosphere. (In poor words, with P4 in Herra's second pic being even closer to the planet.)
Title: Re: Skyboxes
Post by: Herra Tohtori on July 18, 2010, 09:17:23 am
Yeah, I know what you mean (I have experience with such pics :nervous:) but, as Woolie Wool stated, skyboxes don't really like flexibility. No doubt they're much more realistic and handy when it comes to perspectives, though.

Do we have any skyboxes featuring a huge planet texture? I'd like to know if there's a perfect skybox for missions which take place right above a planet's atmosphere. (In poor words, with P4 in Herra's second pic being even closer to the planet.)

Not yet, but I hope that with assistance there will be progress in this area during next fall.

The immense benefit of building a full planet scene is that you can then freely move the camera around it to practically any location. The other option is modeling just the portion of the planet's surface that is visible, but when you have the full Earth in the 3D scene, it's easier to navigate and pick the view point for the renders.

With octet-mapped sphere, I could then easily enough use lower resolution textures for most of the parts of the surface, locate a good render spot and then switch to full detail textures for the locations visible from the view point, so that would be perhaps the ideal solution.