3 | | This tutorial will show you how to create a simple Skybox for Orxonox. 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 [http://www.orxonox.net/attachment/wiki/SkyboxCreation/skybox.blend?format=raw skybox.blend], [http://www.orxonox.net/attachment/wiki/SkyboxCreation/venusmap3.jpg?format=raw venusmap3.jpg], |
4 | | [http://www.orxonox.net/attachment/wiki/SkyboxCreation/venusbump2.jpg?format=raw venusbump2.jpg] and [http://www.orxonox.net/attachment/wiki/SkyboxCreation/rename.sh?format=raw rename.sh] 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. |
| 3 | 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 ''[http://www.orxonox.net/attachment/wiki/SkyboxCreation/skybox.blend?format=raw skybox.blend]'', ''[http://www.orxonox.net/attachment/wiki/SkyboxCreation/venusmap3.jpg?format=raw venusmap3.jpg]'', |
| 4 | ''[http://www.orxonox.net/attachment/wiki/SkyboxCreation/venusbump2.jpg?format=raw venusbump2.jpg]'' and ''[http://www.orxonox.net/attachment/wiki/SkyboxCreation/rename.sh?format=raw rename.sh]'' 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. |
6 | | || 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. [[BR]][[BR]] Make sure you don't touch the camera or its animation.||[[Image(camera.png)]]|| |
7 | | || 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.||[[Image(output.png)]]|| |
8 | | || 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 render 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.||[[Image(anim.png)]]|| |
| 6 | || 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. [[BR]][[BR]] Make sure you don't touch the camera or its animation.||[[Image(camera.png)]]|| |
| 7 | || 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.||[[Image(output.png)]]|| |
| 8 | || 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.||[[Image(anim.png)]]|| |
10 | | Open a shell and cd to the directory, where you saved the 4 files at the beginning. There should be a folder 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 folder containing the frames. |
| 10 | 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: |
| 11 | {{{ |
| 12 | user@linux:[dir_of_skybox_files]> ./rename.sh myskybox box |
| 13 | }}} |
| 14 | 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: |
| 15 | {{{ |
| 16 | material Orxonox/myskybox |
| 17 | { |
| 18 | technique |
| 19 | { |
| 20 | pass |
| 21 | { |
| 22 | lighting off |
| 23 | depth_write off |
| 24 | texture_unit |
| 25 | { |
| 26 | cubic_texture myskybox.jpg separateUV |
| 27 | tex_address_mode clamp |
| 28 | } |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | }}} |
| 34 | 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. |
| 35 | |
| 36 | Now add the the six renamed images to the archive ''[media_directory]/packs/skybox.zip'', for example by unpacking, copying and repacking afterwards. |
| 37 | |
| 38 | Finished. You have created your own Skybox. You can load into your ''level.oxw'' with: |
| 39 | {{{ |
| 40 | <Skybox src="Orxonox/myskybox" /> |
| 41 | }}} |