[TUT] How to create custom Skyboxes (09/2013)
Vetinari
Join Date: 2013-07-23 Member: 186325Members, Squad Five Blue, Reinforced - Shadow, WC 2013 - Silver
in Mapping
This thread shows the need for an up-to-date Skybox-how-to tutorial, and as the only existing one is pretty outdated (and hard to understand), I figured I'd make one on my own.
I tried to make a foolproof step-by-step guide. Have fun.
1. Create images
Create 6 images covering the inner side of a cube. The old tutorial recommends a resolution of 1024x1024 with a dpi of 72, and as the official skyboxes use this resolution, too, I think this works best.
Make sure to give those files unambiguous names (e.g. custom_skybox_up, custom_skybox_down, etc.), and that they match at the edges.
I also recommend to take a look at the pretty neat tool Terragen (thank you @Balmark for that one).
2. Convert to .dds
Once you have your images, you have to convert them into .dds files. There are several ways to do that:
Your Natural Selection 2 folder is probably in Program Files/Steam/SteamApps/common.
3. Create .material files
Once you have done that, open an editor and create a file with the following content:
Create six of these. Alter the emissiveMap path in each to represent each of your .dds files.
Give them a name; Best you give them the name of the .dds file and change the file extension to .material.
You should have now 6 .material files, each pointing at one .dds file.
4. Create a skybox cinematic
Now open the cinematic editor (CinematicEditor.exe, located in your NS2 folder).
Select Scene>Create Sky Box.
This will create a box in the scene. Click it. At the top-right of the screen you see the properties. Use them to assign the .material files to the skybox. If you assigned all of them, save the cinematic (for example in ns2/cinematics). As of b257, you have to restart the editor to see your changes. Exit the cinematic editor, re-open it and open your cinematic file. You should now see your skybox.
If not, you probably messed up some paths in the .material files, or your .dds files aren't working.
Your skybox is now ready to be used in the Spark Editor.
5. Use the skybox in the spark editor
Create a skybox entity. In the properties, assign your .cinematic file from step 4 to the skybox.
Voilá. You successfully created a skybox!
I tried to make a foolproof step-by-step guide. Have fun.
1. Create images
Create 6 images covering the inner side of a cube. The old tutorial recommends a resolution of 1024x1024 with a dpi of 72, and as the official skyboxes use this resolution, too, I think this works best.
Make sure to give those files unambiguous names (e.g. custom_skybox_up, custom_skybox_down, etc.), and that they match at the edges.
I also recommend to take a look at the pretty neat tool Terragen (thank you @Balmark for that one).
2. Convert to .dds
Once you have your images, you have to convert them into .dds files. There are several ways to do that:
- Use Nvidia's photoshop plugin. I couldn't get it running, though; Probably because of Win7/64bit.
- Use a gimp plugin for .dds. While others use this successfully, for me those .dds files produced some errors later on.
- Use paint.NET. It natively supports .dds. Who would've thought that? Worked fine for me.
Your Natural Selection 2 folder is probably in Program Files/Steam/SteamApps/common.
3. Create .material files
Once you have done that, open an editor and create a file with the following content:
shader = "shaders/SkyBox.surface_shader" emissiveMap = "materials/skybox/[your .dds file].dds"
Create six of these. Alter the emissiveMap path in each to represent each of your .dds files.
Give them a name; Best you give them the name of the .dds file and change the file extension to .material.
You should have now 6 .material files, each pointing at one .dds file.
4. Create a skybox cinematic
Now open the cinematic editor (CinematicEditor.exe, located in your NS2 folder).
Select Scene>Create Sky Box.
This will create a box in the scene. Click it. At the top-right of the screen you see the properties. Use them to assign the .material files to the skybox. If you assigned all of them, save the cinematic (for example in ns2/cinematics). As of b257, you have to restart the editor to see your changes. Exit the cinematic editor, re-open it and open your cinematic file. You should now see your skybox.
If not, you probably messed up some paths in the .material files, or your .dds files aren't working.
Your skybox is now ready to be used in the Spark Editor.
5. Use the skybox in the spark editor
Create a skybox entity. In the properties, assign your .cinematic file from step 4 to the skybox.
Voilá. You successfully created a skybox!
Comments