User Tools

Site Tools


Sidebar

hpl2:tutorials:level_editor:tutorial_7

This is an old revision of the document!


Level Editor - Skyboxes [Needs Fixing]

Hello! With the current update, this isn't working. It seems there is an issue with Skyboxes in Amnesia's 1.3.1 version - as instead of showing the skybox in whole, it only shows one side. The same results are returned when making a Skybox with a different type of base (Vertical Cross, instead of a vertical strip, for example).
I'll remove this, and fix any methods or required steps when appropriate.
- Romulator (17 May 2015)

As of Amnesia's 1.3.1 release, the method in which the game reads Skyboxes has changed slightly, breaking them. Should the Skybox issues be fixed, this will be rewritten.
The guide below applies to Amnesia: The Dark Descent's 1.3 version or below.
Skyboxes may show incorrectly depending on which Amnesia version you choose.

What is a Skybox?

A Skybox is a type of cubemap which is seemingly placed at the furthest drawing point accessible within a game's map. It is essentially the sky, horizon and ground which is used to show where the setting is in relation to the surroundings. For example, a skybox which comprises of planets, stars and asteroids will give the illusion of the player in space, even if the map looks like you're in a castle (though it won't look very good…).

Skyboxes are a must have in outdoor or scenic based environments. Not only can it give a sense of light, location and assistance otherwise in developing, it is incredibly useful in immersing the player into the finer details which make up the level.

So let's get started. For this tutorial, I used:

* Adobe Photoshop ( or for a free alternative, you may use GIMP, and may make use of this video tutorial).
*.DDS plugin for your appropriate image editor (nVidia for Photoshop or GIMP)
* A raw collection of images which will make up your skybox1 .
* The HPL2 Level Editor.
1 I made use of this website to retrieve my images. You will need something to open .zip files if you are using that site.

How do I make a Skybox?

I used Adobe Photoshop to make the skybox. I also used the Mountains skybox from the above page.

Step 0: Understanding the construction of a Skybox

In order to construct the skybox, you need to know how one is laid out. Here is the layout as read properly by Amnesia 1.3 and below. Top is at an angle because the new orientation of that raw image does not match up to the Left. Once you place Top onto the canvas, rotate it 90 degrees clockwise.

Please note that this may apply only to the images on the webpage above. If there are issues and you're using the above layout, please shoot me a Personal Message on the forums. I placed a link at the bottom of this wiki page.

Step 1: Setting Up

The Skybox you'll be making if you are using the above website will likely be constructed using five raw images of 512×512 dimensions. This isn't much of a dilemma, since while there are five images, the 'missing' section is Bottom, which you can simply make a 512×512 square of a color (I tend to use Grey, but it is completely optional).

Another option is to double the dimensions of your images (so in this case, 1024×1024, making a 6144×1024 sized skybox). It's completely optional, and won't too greatly affect your end result, because the skybox will be scaled down appropriately to suit the engine's capability.

Download your skybox and extract it if you're using the link above.

If you're using Windows 7, roll over one of your extracted images with your mouse. In most cases, the dimensions of the image will be displayed in the tooltip. In my case, it is 512×512, which I will be using for the rest of the tutorial.

8e45008788.jpg

If such an option is unavailable, open the image in Paint. The dimensions will be on the bottom of the window.

Step 2: New Project

1. Start a new Project in Photoshop (File > New…)
2. Set the Height to the vertical dimensions in which your images are (512 in this case).
3. Set your Width to your Height multiplied by 6. In my case, 512 x 6 = 3072.
4. Make sure both Height and Width are in Pixels, then you're all good to press OK.

To make this process easier on how you set out the images, and to assist with snapping, we can make use of the grid features in Photoshop.

1. Navigate to Edit > Preferences > Guides, Grid & Slices.
2. Under the 'Grid' box, set the Gridline to 512 pixels (or the vertical size of your images), and make the subdivision 1, 2 or 4 (any higher is unnecessary).
3. If your grid is not visible, navigate to View > Show > Grid. This will give you six sections of your image. (If the grid, at any point begins to annoy you or need to check if the images are correctly aligned against their 'partner', pressing Ctrl+H will hide/show the grid).

Step 3: Import

Import your images. There are many ways to do this, but for the sake of simplicity, just select the five images and drag them onto the canvas. Then, comparing them to the filenames (if the layers do not have their respective filenames), lay them out within the grid in the correct format. Don't forget to rotate Top 90 degrees clockwise!

43fad4f6c7.jpg

Now create a new layer (the paper icon in the Layers window, which in my case, is the second last option, or second from the right)

Use the Paint bucket on this layer to make it any color you want, but not one which will be the same as the sides of your Top or Right images.

2b1f805c67.jpg

If the Gradient tool appears in the tools pane, just click and hold and select the Paint Bucket Tool. To change the color, click on the foreground color in the bottom of your tools pane (mine was black), then select a color using the Color Picker. As stated earlier, I just made mine RGB 128, 128, 128 (or #808080 in Hex).

If your specified color covers the other images, move your layer as low as possible below the other layers, but higher than background, as that will cover your layer.

Now just hide the text, if you're like me and have it there. I grouped mine, so I can just select the eye on the folder, and that will hide all of them. Each eye can be clicked individually however to hide them all just the same way.

Which gives us our raw six images which will become our skybox.

77a79c4c52.jpg

Step 4: Saving for use in the Level Editor

First of all, if you didn't download the nVidia tools as I mentioned in the “What is a Skybox?” for .dds saving, then save your skybox as a .psd, close Photoshop, then download and install the nVidia tools.

1. Navigate to File > Save As…
2. Change the save format from .psd to D3D/DDS (.dds)
3. Save the file somewhere. You can put it wherever you want in the Amnesia files (provided resources.cfg can find it) or somewhere and move it there later.
4. Click “Save” and the following dialog box will come up.

5. Make sure your settings match mine. Chances are, all you'll need to change is 2D Texture to Cubemap (which will be in the smaller drop menu on the left side).
6. Click “Save”. You may need to wait a bit, depending on your computer.

Step 5: Importing into the Level Editor

If the Skybox is not already somewhere in your Amnesia folders, move it somewhere there so it can be found in a directory specified by the resources.cfg file. For the sake of custom story exporting, let's assume I placed it here: custom_stories/test/skybox/mountains.dds

Now we just open the Level Editor, load up your map (if necessary), then navigate to Edit > Level Settings. Tick “Active” and set the texture to your skybox directory.

Done, at least, with the Photoshop tutorial. I'll look into alternative methods.

HELP! SOMETHING WENT WRONG!

First of all...

Are you using an Amnesia version greater than 1.3? If so, Skyboxes currently appear to be broken. As of now (17 May 2015), the only solution is to downgrade. This is not recommended for Steam users.

Otherwise...

Skyboxes can be a real pain sometimes. If your orientation is screwed up, try tweaking it yourself and see if you can get it fixed. But if that is really getting to you, or you encounter other issues, drop me a PM using this link, or make a thread about your issue in the Development Support subforum.

hpl2/tutorials/level_editor/tutorial_7.1431834749.txt.gz · Last modified: 2015/05/17 03:52 by romulator