Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Topgun on January 21, 2011, 09:58:07 pm

Title: Why do starboxes look good?
Post by: Topgun on January 21, 2011, 09:58:07 pm
Why do starboxes look better than just throwing images up in fred? What's the difference?
Title: Re: Why do starboxes look good?
Post by: General Battuta on January 21, 2011, 10:12:18 pm
Um do you mean skyboxes?

Background bitmaps can sometimes work okay but you generally need impractically high resolutions in order to pull off something like this (http://www.diaspora-game.com/images/screens/screen_003_colonial_one.jpg), which means skyboxes are required. For other purposes background bitmaps can be more flexible and still nearly as pretty.
Title: Re: Why do starboxes look good?
Post by: Herra Tohtori on January 21, 2011, 10:14:30 pm
Less generic. We've all seen the same nebulas everywhere. Also, skyboxes have the opportunity to add all sorts of cool stuff on it that you can't have with the default starfield and nebulas placed over it Such as stars interacting with nebula, parts of nebulas being more opaque, parts being absorption nebulas instead of all emission nebulas... that sort of stuff. Basic nebulas use additive blending, and although you probably COULD use BitmapX for alpha blended nebulas the eventual generic nebula syndrome would affect that system too.


Those are things that come in mind immediately.
Title: Re: Why do starboxes look good?
Post by: FUBAR-BDHR on January 22, 2011, 03:35:49 pm
You can achieve the same effect with regular bitmaps that you can with skyboxes.  The only exception is the background starfield.  Now that does mean adding the textures used in the skyboxes to stars.tbl.  A 2048x2048 planet looks just as good as a bitmap or bitmapx as it does as part of a skybox.
Title: Re: Why do starboxes look good?
Post by: Herra Tohtori on January 22, 2011, 04:19:37 pm
You can achieve the same effect with regular bitmaps that you can with skyboxes.  The only exception is the background starfield.  Now that does mean adding the textures used in the skyboxes to stars.tbl.  A 2048x2048 planet looks just as good as a bitmap or bitmapx as it does as part of a skybox.

Except the part where it's almost impossible to set the geometry of the planet correctly.

Refer to this:

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


Any image of any planet is only correct at certain apparent diameter. You can't just freely scale an image of planet up or down and say it looks "just as good" as a skyboxed render of the planet.

In other words, as the apparent diameter of a sphere changes, the amount of surface visible to the viewer is defined by the angle of the view angle tangents. As the distance from surface approaches zero, the view angle approaches 180 degrees and the percentage of area visible to the view point approaches zero.

As the distance approaches infinity, the view angle approaches zero asymptotically and the visible surface area approaches 50%, again asymptotically.

An image of a planet that has 49% of its surface visible would be about correct for the view from Moon.

That would give the Earth an angular diameter of... almost two degrees which is pathetically small when displayed on computer screen, but would be a rather big object on Lunarian sky as seen by human eye.

An image of a planet at 2 degrees angular diameter would be vastly different from an image of a planet at 90 degrees angular diameter.


Of course, if one does not care for such things as basic geometry, one can safely ignore this. Just saying that just scaling up and down planet images for "what looks good" is not technically the most correct way of doing it, despite the good results that can be achieved with this method<. But my views on the matters of realism vs "what looks good" are known. :p
Title: Re: Why do starboxes look good?
Post by: Snail on January 22, 2011, 04:26:43 pm
brain asplode
Title: Re: Why do starboxes look good?
Post by: FUBAR-BDHR on January 22, 2011, 05:39:59 pm
Except we scale planets in skyboxes the same way.  It works just fine.  Maybe it's because they are skysphers and not skycubes.  The only real benifit for skyboxes is they are quick to setup in mission and always stay the same. 
Title: Re: Why do starboxes look good?
Post by: Herra Tohtori on January 22, 2011, 05:45:30 pm
Except we scale planets in skyboxes the same way.  It works just fine.  Maybe it's because they are skysphers and not skycubes.  The only real benifit for skyboxes is they are quick to setup in mission and always stay the same.

I know, that's why Blue Planet skyboxes (apart an old Delta Serpentis planet in AoA) are true skyboxes (cubes) instead of spheres that have a disk inside that the planet is plastered on. The reason why this type of skybox was used in the first place was its simplicity and the fact that cubical skyboxes used to have seams on the edges. The latter problem having been resolved, there is no longer need to use spherical skyboxes for complex scenarios. For a simple generic starfield, however, spherical skybox mapped with same starfield from six directions is still the best option.

Although not exactly correct, even this simple sphere+plane method is better than the background bitmap method of showing planets, since the background system will distort the images when it is scaled up very much. But you are right, the ideal method is to use six textures mapped on six sides of a cube.
Title: Re: Why do starboxes look good?
Post by: rscaper1070 on January 22, 2011, 06:03:15 pm
I'm currently trying to figure out how to make an animated asteroids skybox. The wiki makes a brief notice that this is possible but it doesn't elaborate. I've been up and down the internet but I haven't found any tutorials on the subject. Any insight into how it would work in game would be appreciated.

(http://thumbnails11.imagebam.com/11617/1e3557116164918.jpg) (http://www.imagebam.com/image/1e3557116164918)
Title: Re: Why do starboxes look good?
Post by: FUBAR-BDHR on January 22, 2011, 06:31:30 pm
I don't think the animated skybox thing works quite right.  It might if the asteroids never get close but if they do there are alpha issues when looking in certain directions.  Otherwise I believe it is just a matter of using dumb rotate.
Title: Re: Why do starboxes look good?
Post by: Herra Tohtori on January 22, 2011, 07:02:03 pm
I'm currently trying to figure out how to make an animated asteroids skybox. The wiki makes a brief notice that this is possible but it doesn't elaborate. I've been up and down the internet but I haven't found any tutorials on the subject. Any insight into how it would work in game would be appreciated.

(http://thumbnails11.imagebam.com/11617/1e3557116164918.jpg) (http://www.imagebam.com/image/1e3557116164918)

Texture animations on skyboxes would be very, very, very large files. It would not be quite ideal for most people's hard drive space consumption or transfer time through internet, even less for peopel whose download bandwidth is capped to certain amount per month.

There is a way to animate skyboxes through model rotation, however. This is how the subspace skybox worked in retail, even. The BTRL had an interesting asteroid belt skybox that achieved pretty good results, but personally I feel the best way to simulate asteroid belt is just getting a big asteroid model and maybe a few smaller rocks set on slow orbit around the big one. That'd be about right, as asteroid thickets are somewhat ridiculous.

Unless you're talking about the rings of a planet. That'd actually be more in the line of "asteroid fields" depicted in FreeSpace universe...