navi homePPSaboutscreenshotsdownloaddevelopmentforum

Version 6 (modified by landauf, 3 years ago) (diff)

Creating a Simple Skybox

This tutorial will show you how to create a simple Skybox for Orxonox. A Skybox is a large cube with textures on the inside, representing the sky in a level. You will mainly use Blender for creating the actual Skybox and a small shell script for integrating it into Orxonox. You will probably need to run Linux for that. First, please download skybox.blend, venusmap3.jpg, venusbump2.jpg and that are attached to this page. Put them all in the same folder. This is important, since the paths to the textures are stored in the .blend file. Otherwise, you will probably not see any textures in the sample scene.

Open the sample scene skybox.blend with Blender. In this Blender scene, you can create your Skybox. Later, the Skybox will look as if you were sitting in the origin of the Blender scene. You can see the camera at the origin now already. Feel free to create planets, suns or whatever entities you would like. A basic star background will be rendered automatically.

Make sure you don't touch the camera or its animation.
If your scene is finished, it will be only a few minutes until the skybox is integrated into the game. Press F10 to switch to the Scene menu. Choose an appropriate output folder on the Output tab. In the picture, I chose box, which is also the default setting in the sample scene.
In the same menu, on the Anim tab, you can click ANIM now. This will render 6 frames and store them in the output directory you selected. In each frame, the camera will look in one of the six directions in 3d-space. These six frames will become the six sides of your Skybox cube. Save your work and quit Blender now.

Now open a shell and cd to the directory, where you saved the 4 files at the beginning. There should be a directory containing the 6 frames you rendered before (0001.jpg-0006.jpg). Run the shell script with the first parameter being the desired name of your Skybox and the second being the name of the directory containing the frames. For example, if you chose box as output dir and would like your Skybox to be called myskybox, then you would run:

user@linux:[dir_of_skybox_files]> ./ myskybox box

This command will rename the frames according to conventions imposed by Ogre. You will find the six renamed files of the form "myskybox_XX.jpg" in the input dir. The command also produces a material script like this:

material Orxonox/myskybox
                        lighting off
                        depth_write off
                                cubic_texture myskybox.jpg separateUV
                                tex_address_mode clamp

Insert this into a .material file so it will be loaded when Ogre starts. [media_directory]/materials/scripts/OrxonoxSky.material is suggested, since it already contains the definitions of all other Orxonox Skyboxes. Save and exit.

Now add the the six renamed images to the archive [media_directory]/packs/, for example by unpacking, copying and repacking afterwards.

Finished. You have created your own Skybox. You can load into your level.oxw with:

<Skybox src="Orxonox/myskybox" />

Attachments (8)

Download all attachments as: .zip