<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://osirion.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Creating_skyboxes</id>
	<title>Creating skyboxes - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://osirion.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Creating_skyboxes"/>
	<link rel="alternate" type="text/html" href="http://osirion.org/wiki/index.php?title=Creating_skyboxes&amp;action=history"/>
	<updated>2026-06-16T10:56:25Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>http://osirion.org/wiki/index.php?title=Creating_skyboxes&amp;diff=9&amp;oldid=prev</id>
		<title>Ingar: Import from backup</title>
		<link rel="alternate" type="text/html" href="http://osirion.org/wiki/index.php?title=Creating_skyboxes&amp;diff=9&amp;oldid=prev"/>
		<updated>2014-08-24T18:08:10Z</updated>

		<summary type="html">&lt;p&gt;Import from backup&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;A skybox is a set of six seamless images which are rendered on the inside of a large cube surrounding the player, and is sometimes referred to as environment map. In first-person shooters they're uduslly images of far away hills, forest and buildings, in spacegames they will display stars, nebulas and far away galaxies.&lt;br /&gt;
&lt;br /&gt;
== Installing Spacescape ==&lt;br /&gt;
&lt;br /&gt;
Alex Peterson's Spacescape is a tool for creating space skyboxes with stars and nebulas. A windows versions is readily available from its website, if you want to use it on linux you will have to compile it yourself.&lt;br /&gt;
&lt;br /&gt;
* [http://alexcpeterson.com/spacescape Spacescape homepage]&lt;br /&gt;
* [http://sourceforge.net/apps/mediawiki/spacescape/index.php?title=The_Spacescape_Manual Spacescape manual]&lt;br /&gt;
* [http://sourceforge.net/projects/spacescape/ Download Spacescape for windows]&lt;br /&gt;
* [http://osirion.org/files/env-osirion-sky.zip Download Project::OSiRiON flare textures and sky sources]&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
&lt;br /&gt;
Download [http://sourceforge.net/projects/spacescape/files/latest/download the latest windows version]. This is &lt;br /&gt;
a ZIP file you have to unpack to a suitable location. You can use ''C:\Program Files (x86)\Spacescape'' or, &lt;br /&gt;
if you have a 32bit system, ''C:\Program Files\Spacescape''.&lt;br /&gt;
&lt;br /&gt;
You should end up with a folder ''C:\Program Files (x86)\Spacescape'' containing ''Spacescape.exe'' and several subfolders.&lt;br /&gt;
The Spacescape installation comes with a number of billboard star textures. Copy the flare textures for Project::OSiRiON to&lt;br /&gt;
the folder ''C:\Program Files (x86)\Spacescape\media\materials\textures''. You can also copy your own flare textures here.&lt;br /&gt;
&lt;br /&gt;
[[File:Spacescape-flares.png]]&lt;br /&gt;
&lt;br /&gt;
=== Linux ===&lt;br /&gt;
&lt;br /&gt;
To build Spacescape on linux, you will need a working C++ compiler, cmake, the Qt library (4.8.x), the NVIDIA Cg libraries and the OGRE library.&lt;br /&gt;
&lt;br /&gt;
==== Building ====&lt;br /&gt;
&lt;br /&gt;
You need a subversion or git client to download the source code.&lt;br /&gt;
&lt;br /&gt;
  svn co https://spacescape.svn.sourceforge.net/svnroot/spacescape/trunk spacescape&lt;br /&gt;
  cd spacescape&lt;br /&gt;
&lt;br /&gt;
Apply a required patch to fix image size selection in the export file dialog.&lt;br /&gt;
&lt;br /&gt;
  wget http://osirion.org/files/spacescape/spacescape-svn-r15-export_file_dialog.patch&lt;br /&gt;
  patch -Np0 -i spacescape-svn-r15-export_file_dialog.patch&lt;br /&gt;
&lt;br /&gt;
Create a build directory, enter it and run cmake to create the Makefiles.&lt;br /&gt;
&lt;br /&gt;
  mkdir build&lt;br /&gt;
  cd build&lt;br /&gt;
  cmake -D QtPropertyBrowser_Library_DBG:BOOL=0 ..&lt;br /&gt;
&lt;br /&gt;
Build the binaries.&lt;br /&gt;
&lt;br /&gt;
  make&lt;br /&gt;
&lt;br /&gt;
On my system, the build fails with the following error:&lt;br /&gt;
&lt;br /&gt;
  undefined reference to symbol '_ZN5boost6system15system_categoryEv'&lt;br /&gt;
&lt;br /&gt;
To correct this error edit the following file inside the build/ directory:&lt;br /&gt;
&lt;br /&gt;
  Spacescape/CMakeFiles/Spacescape.dir/link.txt&lt;br /&gt;
&lt;br /&gt;
This file contains a single, long line. Find the part that looks like this:&lt;br /&gt;
&lt;br /&gt;
  ../../Spacescape/app/linux/bin/Plugin_Spacescape.so -lOgreMain -lQtGui -lQtCore&lt;br /&gt;
&lt;br /&gt;
Add -lboost_system in front of -lOgreMain&lt;br /&gt;
&lt;br /&gt;
  ../../Spacescape/app/linux/bin/Plugin_Spacescape.so '''-lboost_system''' -lOgreMain -lQtGui -lQtCore&lt;br /&gt;
&lt;br /&gt;
Run make again&lt;br /&gt;
&lt;br /&gt;
  make&lt;br /&gt;
&lt;br /&gt;
Leave the build/ directory, the resulting binary will be in Spacescape/app/linux/bin/&lt;br /&gt;
Copy the necessary libraries.&lt;br /&gt;
&lt;br /&gt;
  cd ..&lt;br /&gt;
  cd Spacescape/app/linux/bin/&lt;br /&gt;
  cp -a ../../../external/QtPropertyBrowser/lib/libQtSolutions_PropertyBrowser-2.5.so* ./&lt;br /&gt;
&lt;br /&gt;
==== Installing the OGRE Spacescape plugin ====&lt;br /&gt;
&lt;br /&gt;
Part of spacescape is a plugin for the OGRE library. The file Plugin_Spacescape.so must be installed as root in the OGRE plugin directory.&lt;br /&gt;
&lt;br /&gt;
  sudo install Plugin_Spacescape.so /usr/lib/OGRE/&lt;br /&gt;
&lt;br /&gt;
==== Running ====&lt;br /&gt;
&lt;br /&gt;
Run the program:&lt;br /&gt;
&lt;br /&gt;
  LD_LIBRARY_PATH=./ ./Spacescape.bin&lt;br /&gt;
&lt;br /&gt;
=== Installing media ===&lt;br /&gt;
&lt;br /&gt;
You need to install the flare textures for For Project::OSiRiON. Copy the PNG images in ''sky/flares'' to the Spacescape media folder ''spacescape/Spacescape/media/materials/textures''.&lt;br /&gt;
&lt;br /&gt;
== Spacescape Tutorial ==&lt;br /&gt;
&lt;br /&gt;
Like many graphical design programs, Spacescape uses layers drawn on top of each other to create the final image. Each layer has its own set of settings&lt;br /&gt;
which can be tweaked to achieve a pleasing result. Skyboxes are saved as XML files, you can load any of the Project::OSiRiON sky files  as example.&lt;br /&gt;
&lt;br /&gt;
The user interface of the application is reasonably simple: the left side of the screen contains a list of layers. Each layer can be expanded to show its settings. The right side of the screen is the preview window. You can rotate the skybox preview by dragging the image while holding the mouse button.&lt;br /&gt;
&lt;br /&gt;
[[File:spacescape-tutorial-00.png]]&lt;br /&gt;
&lt;br /&gt;
In this tutorial we'll create a new skybox from scratch. Select ''File -&amp;gt; New'' from the menu.&lt;br /&gt;
&lt;br /&gt;
Don't forget to consult the [http://sourceforge.net/apps/mediawiki/spacescape/index.php?title=The_Spacescape_Manual Spacescape manual] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Point star layers ===&lt;br /&gt;
&lt;br /&gt;
We start by creating a  basic starfield. We'll add several star layers in different colors. Use the ''Add Layer'' button at the bottom to add a new layer. Expand the layer to edit its settings.&lt;br /&gt;
&lt;br /&gt;
; Layer Name : Give the layer a descriptive name like ''point stars white''.&lt;br /&gt;
; Layer Type : For point stars, the layer type should be ''points''.&lt;br /&gt;
; Layer Visible : Disable this option to hide a layer, leave the layer visible.&lt;br /&gt;
; Random Seed : Changing the seed will alter the distribution of the stars, always change the seed for point star layers.&lt;br /&gt;
; Dest Blend Factor : Leave on ''one'' for point star layers, see Blending&lt;br /&gt;
; Far Color : The color of far away stars, leave it on black (0, 0, 0)&lt;br /&gt;
&lt;br /&gt;
At this time, we won't use the Mask settings.&lt;br /&gt;
&lt;br /&gt;
; Near Color : The color of nearby stars, set to white (255, 255, 255)&lt;br /&gt;
; Number of Points : Set to 10000.&lt;br /&gt;
; Point Size : Number of pixels used to draw the star, leave it on 1.&lt;br /&gt;
; Source Blend Factor : Leave on ''one'' for point star layers, see Blending&lt;br /&gt;
&lt;br /&gt;
Use the ''Copy Layer'' button at the bottom to duplicate the layer two or three times. &lt;br /&gt;
On each copy, change the ''Random Seed'' and the ''Near Color''. You should end op with several layers of point stars in different colors.&lt;br /&gt;
&lt;br /&gt;
You can improve the starfield by tweaking the colors even more. Expand the ''Far Color'' and  set it to a non-black color. Set the alpha to 0.&lt;br /&gt;
Enable alpha blending by setting the ''Source Blend Factor'' to ''src_alpha''. This will a create a color gradient between far away and nearby stars, while blending far away stars into the dark background.&lt;br /&gt;
&lt;br /&gt;
[[File:Spacescape-tutorial-01.png]]&lt;br /&gt;
&lt;br /&gt;
Next, we create a a large version for each star layer. Duplicate each point star layer and change the ''Number of Points'' to 2500. Change the ''Point Size'' to 2. Don't forget to change the ''Random Seed'' too! You should end op with six to eight point star layers, with half of the layers having Point Size 2. The result should be a reasonably rich starfield with stars in multiple colors.&lt;br /&gt;
&lt;br /&gt;
[[File:Spacescape-tutorial-02.png]]&lt;br /&gt;
&lt;br /&gt;
=== Billboard star layers ===&lt;br /&gt;
&lt;br /&gt;
Point star layers are a good base, but they remain simple dots on a black background. We'll introduce some variation by adding billboard star layers. Billboards are similar to points but use flare textures instead of dots. You can use any image in the folder ''C:\Program Files (x86)\Spacescape\media\materials\textures''.&lt;br /&gt;
&lt;br /&gt;
Create a  new layer and call it ''billboard stars white'', set the ''Layer Type'' to ''billboards''. Most of the settings are the same as in point layers before: set the ''Random Seed'', ''Near Color'' and ''Far Color''. Next, apply the following settings:&lt;br /&gt;
&lt;br /&gt;
; Number of Points : Set to 250.&lt;br /&gt;
; Near Billboard Size : Size of nearby stars, set to 0.012.&lt;br /&gt;
; Far Billboard Size : Size of far away stars, set to 0.005.&lt;br /&gt;
; Billboard Texture : Filename of the flare texture to use, you can leave the default or change it to ''osirion-flare-07.png'' or any other installed texture.&lt;br /&gt;
&lt;br /&gt;
Like point star layers, copy the layer a few times, change the ''Layer Name'', ''Random Seed'', ''Far Color'', ''Near Color'' and the ''Billboard Texture'' as desired. You should end up with around 3 layeres of billboard stars in different colors.&lt;br /&gt;
&lt;br /&gt;
[[File:Spacescape-tutorial-03.png]]&lt;br /&gt;
&lt;br /&gt;
All these layers combine into a base background starfield:&lt;br /&gt;
&lt;br /&gt;
[[File:Spacescape-tutorial-03-preview.png]]&lt;br /&gt;
&lt;br /&gt;
=== Background dust layers ===&lt;br /&gt;
&lt;br /&gt;
So far, the starfield is rather uniform in appearance. We add a layer of background dust to create the impression of darker and lighter areas in the sky. Add a new layer and name it ''background dust''. Set the ''Layer Type'' to ''noise'' and set a ''Random Seed''. Leave the ''Inner Color'' and ''Outer Color'' on default for now. We want a black dust layer and if you set the color now it will be very hard to see the dust while manipulating its shape.&lt;br /&gt;
&lt;br /&gt;
You can manipulate the shape with the following parameters, it takes some experimenting to get the result you want:&lt;br /&gt;
&lt;br /&gt;
; Lacunarity : The cloudyness of the dust layer: low lacunarity will create more uniform dust, high lacunarity will give a more cloudy appearance. Set it to 4 for the background dust layer.&lt;br /&gt;
; Octaves : Setting this parameter higher will result in more fine-detailed dust. Set it to 4 for the background dust layer.&lt;br /&gt;
; Power: A higher power setting will result in brighter colors.&lt;br /&gt;
; Threshold: A cutoff value below which the dust will not be rendered. It creates a more cloud-like appearance but can introduce hard edges. Set it to 0.25 for the background dust layer.&lt;br /&gt;
&lt;br /&gt;
Finally, set ''Dest Blend Factor'' to ''one_minus_src_alpha'' and ''Source Blend Factor'' to ''srC_alpha''. Set both ''Inner Color'' and ''Outer Color'' to black (0, 0, 0). By toggling the ''Layer Visible'' setting you can easily see the difference with and without dust layer. We can tweak the result even further by trying to move backgorund dust layer and/or the billboard star layers around. If we move the ''billboard stars red'' layer above the ''background dust layer'', the red stars will be unobstructed by the dust and give a more red impression to the sky in general.&lt;br /&gt;
&lt;br /&gt;
[[Image:Spacescape-tutorial-04.png]]&lt;br /&gt;
&lt;br /&gt;
The result is a more tempered background starfield:&lt;br /&gt;
&lt;br /&gt;
[[Image:Spacescape-tutorial-04-preview.png]]&lt;br /&gt;
&lt;br /&gt;
=== Foreground nebula layers ===&lt;br /&gt;
&lt;br /&gt;
==== Nebula layer ====&lt;br /&gt;
&lt;br /&gt;
With the background starfield completed, we can start adding nebulae. Add a new layer and set the ''Layer Name'' to ''nebula brown'' and set&lt;br /&gt;
the ''Layer Type'' to ''noise''. We'll set a color gradient and make it transparent by using conventional alpha blending:&lt;br /&gt;
&lt;br /&gt;
; Random Seed : changing the random seed alters the shape of the nebula&lt;br /&gt;
; Dest Blend Factor : set to ''one_minus_src_alpha''&lt;br /&gt;
; Source Blend Factor : set to ''src_alpha''&lt;br /&gt;
; Inner Color : Select a dominant, bright color&lt;br /&gt;
; Outer Color : Select a darker shade ad set alpha to 0&lt;br /&gt;
&lt;br /&gt;
Change the appearance;&lt;br /&gt;
&lt;br /&gt;
; Lacunarity : Set to 2.5 or experiment&lt;br /&gt;
; Octaves : Set to 8 or experiment&lt;br /&gt;
; Threshold : Give it a low value in the 0.00 to 0.25 range&lt;br /&gt;
&lt;br /&gt;
[[File:Spacescape-tutorial-05.png]]&lt;br /&gt;
&lt;br /&gt;
==== Nebula highlights layer ====&lt;br /&gt;
&lt;br /&gt;
To make the nebula more interesting, we add a highlights layer. Make a copy of the ''nebula brown'' layer: select&lt;br /&gt;
its node in the layer tree structure and clicke the ''Copy Layer'' button at the buttom. Set the ''Layer Name'' of the copy&lt;br /&gt;
to ''nebula highlights''. The highlights layer should have the same parameters and random seed as the original.&lt;br /&gt;
&lt;br /&gt;
; Inner Color : Set to a bright color, alpha to 255&lt;br /&gt;
; Outer Color : Set to a bright color, alpha to 255&lt;br /&gt;
; Threshold : Give it a higher value, around 0.5&lt;br /&gt;
; Power : Make the highlights more subtle by decreasing power&lt;br /&gt;
; Gain : Make the highlights sharper by increasing gain&lt;br /&gt;
&lt;br /&gt;
[[File:Spacescape-tutorial-06.png]]&lt;br /&gt;
&lt;br /&gt;
[[File:Spacescape-tutorial-06-preview.png]]&lt;br /&gt;
&lt;br /&gt;
==== Nebula ridges layer ====&lt;br /&gt;
&lt;br /&gt;
We improve the appearance of the nebula by adding a layer of dark ridges: add a new layer&lt;br /&gt;
and set the ''Layer Name'' to ''nebula ridges'', set the ''Layer Type'' to ''noise''.&lt;br /&gt;
Set the ''Noise Type'' to ''ridged''.&lt;br /&gt;
&lt;br /&gt;
; Random Seed : I used the same random seed as the nebula and nebula highlights layers, this isn't required here but happened to look good&lt;br /&gt;
; Dest Blend Factor : set to ''one_minus_src_alpha''&lt;br /&gt;
; Gain : increase to 0.750&lt;br /&gt;
; Inner Color : set to black (0, 0, 0), set alpha to 255&lt;br /&gt;
; Lacunarity : set to 2.5&lt;br /&gt;
; Octaves : set to 8&lt;br /&gt;
; Outer Color : set to black (0, 0, 0), set alpha to 0&lt;br /&gt;
; Power : set to 0.250&lt;br /&gt;
; Threshold : set to 0.500&lt;br /&gt;
; Source Blend Factor : set to ''src_alpha''&lt;br /&gt;
&lt;br /&gt;
[[File:Spacescape-tutorial-07.png]]&lt;br /&gt;
&lt;br /&gt;
The result is a far more realistic looking nebula:&lt;br /&gt;
&lt;br /&gt;
[[File:Spacescape-tutorial-07-preview.png]]&lt;br /&gt;
&lt;br /&gt;
==== Nebula streaks layer ====&lt;br /&gt;
&lt;br /&gt;
We add the final touch by creating a ''nebula streaks'' layer. Set the ''Layer Type'' to ''noise'' and the ''Noise Type'' to ''ridged''.&lt;br /&gt;
&lt;br /&gt;
; Random Seed : don't forget to set the random seed&lt;br /&gt;
; Inner Color : pick an approriate streak color, I've chosen a somewhat darker red tint.&lt;br /&gt;
; Lacunarity : set to 3 to create a more sparse nebula&lt;br /&gt;
; Octaves : set to 6&lt;br /&gt;
; Outer Color : set to black (0, 0, 0), set alpha to 0&lt;br /&gt;
; Power : set to 0.25&lt;br /&gt;
; Threshold : set to 0.5&lt;br /&gt;
&lt;br /&gt;
[[File:Spacescape-tutorial-08.png]]&lt;br /&gt;
&lt;br /&gt;
Moving the ''nebula streaks'' layer below the ''nebula brown'' layer makes it blend better&lt;br /&gt;
with the other nebula layers:&lt;br /&gt;
&lt;br /&gt;
[[File:Spacescape-tutorial-08-preview.png]]&lt;br /&gt;
&lt;br /&gt;
=== Blending ===&lt;br /&gt;
&lt;br /&gt;
* TODO: explain the blending modes.&lt;br /&gt;
&lt;br /&gt;
These are standard OpenGL blending functions. See &lt;br /&gt;
[http://toolz.nexuizninjaz.com/shader/ section 6.2.2 Explicit blend functions] of the Quake 3 shader manual.&lt;br /&gt;
&lt;br /&gt;
=== Exporting ===&lt;br /&gt;
&lt;br /&gt;
To export the skybox to 6 environment map images, select the the ''Export Skybox'' option in the ''File'' menu. This will save the skybox as 6 PNG or JPG images.&lt;br /&gt;
&lt;br /&gt;
[[File:Spacescape-tutorial-export.png]]&lt;br /&gt;
&lt;br /&gt;
Select the desired resolution at the bottom. Use 2048 for Project::OSiRiON, use 1024 for Quake 3 based games. Tremulous and Unvanquished crash with skyboxes larger than 1024, Xonotic is reported to work with 2048 skyboxes.&lt;br /&gt;
&lt;br /&gt;
For Project::OSiRiON, export to PNG and rename the images as follows:&lt;br /&gt;
&lt;br /&gt;
 tutorial_back6.png   -&amp;gt; tutorial_back.png&lt;br /&gt;
 tutorial_bottom4.png -&amp;gt; tutorial_bottom.png&lt;br /&gt;
 tutorial_front5.png  -&amp;gt; tutorial_front.png&lt;br /&gt;
 tutorial_left2.png   -&amp;gt; tutorial_left.png&lt;br /&gt;
 tutorial_right1.png  -&amp;gt; tutorial_right.png&lt;br /&gt;
 tutorial_top3.png    -&amp;gt; tutorial_top.png&lt;br /&gt;
&lt;br /&gt;
For Quake 3 compatible games, export to JPG or PNG. Rename the images as follows. Note that the right and left images are swapped.&lt;br /&gt;
&lt;br /&gt;
 tutorial_back6.png   -&amp;gt; tutorial_bk.png&lt;br /&gt;
 tutorial_bottom4.png -&amp;gt; tutorial_dn.png&lt;br /&gt;
 tutorial_front5.png  -&amp;gt; tutorial_ft.png&lt;br /&gt;
 tutorial_left2.png   -&amp;gt; tutorial_rt.png&lt;br /&gt;
 tutorial_right1.png  -&amp;gt; tutorial_lf.png&lt;br /&gt;
 tutorial_top3.png    -&amp;gt; tutorial_up.png&lt;br /&gt;
&lt;br /&gt;
Transform the images as follows:&lt;br /&gt;
&lt;br /&gt;
* Rotate the top/up image 90 degrees counter-clockwise&lt;br /&gt;
* Rotate the bottom/down image 90 degrees clockwise&lt;br /&gt;
&lt;br /&gt;
You might have to write a shader file:&lt;br /&gt;
&lt;br /&gt;
 textures/spacescape/tutorial&lt;br /&gt;
 {&lt;br /&gt;
    qer_editorimage env/spacescape/tutorial_ft.png&lt;br /&gt;
    surfaceparm noimpact&lt;br /&gt;
    surfaceparm nolightmap&lt;br /&gt;
    surfaceparm sky &lt;br /&gt;
    skyparms env/spacescape/tutorial - -&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
The images should be copied to the ''env/spacescape'' folder inside your game data folder.&lt;br /&gt;
&lt;br /&gt;
=== Remarks ===&lt;br /&gt;
&lt;br /&gt;
* The settings in this tutorial are intended to export skyboxes to 2048x2048 image files. If you intend to export to a different resolution, you will have to alter the size and number of stars settings.&lt;br /&gt;
&lt;br /&gt;
== Discussion ==&lt;br /&gt;
&lt;br /&gt;
* [http://unvanquished.net/forum/showthread.php/523-Mapping-assets-20-space-skyboxes Unvanquished forum]&lt;br /&gt;
* [http://forums.xonotic.org/showthread.php?tid=3755 Xonotic forum]&lt;/div&gt;</summary>
		<author><name>Ingar</name></author>
		
	</entry>
</feed>