How-To Create Static Skyboxes in Lumberyard

Setup

Naming Conventions

Skyboxes in
Lumberyard are 5 sided. Sides 1 through 4
are the sides of the box and side 5 is the top. These sides are represented by 3 textures with a specific naming
convention. The suffix tells Lumberyard
which sides of the box the texture contains:

  1. skybox_12.tif
  2. skybox_34.tif
  3. skybox_5.tif
    Note: Skyboxes in Lumberyard currently do not have
    a bottom.

Creation and Setup in Photoshop

This texture
represents our source sky image and it is 8192x1024. It was created in Photoshop using 16bits
per channel
. This will help preserve
smooth gradients in the sky. For illustration
purposes, it has been divided up into 4 sections that are each 2048x1024. The numbers represent each side of the skybox
that this texture will get mapped to. Side 1 and 2 will become skybox_12.tif and side 3 and 4 will
become skybox_34.tif.

The top of our sky
is a separate texture. The numbers here
represent which edge of the texture is mapped to which side. This is important
to know so that texture seams can be managed. This texture must be named skybox_5.tif and it is 2048x2048.

4810-skybox-002.jpg

When sides 1 and 2
are combined into one texture to create skybox_12.tif, side 2 must be
flipped horizontally. The same pattern
is repeated for sides 3 and 4 when they are combined to create skybox_34.tif. Side 4 must be flipped horizontally. Combining these sides to create skybox_12.tif
and skybox_34.tif will result in two textures that are each 2048x2048.

On the left is skybox_12.tif and on the right is skybox_34.tif.

4872-skybox-003.jpg

At this point we
have 3 textures that are each 2048x2048. Before moving into Lumberyard right-click on each image and choose RC
Open Image
. In the dialogue window
that opens, chose the SkyboxHDR preset and hit ok. This will create a text file (**imagename.exportsettings) for each
image that contains information Lumberyard will use to compile the image
correctly. If you are using source
control, do not forget to check these files in!

Note: If you do not have the option RC Compile
Image, you need to install the RC Shell Commands using the SetupAssistant.exe.

Lumberyard

Create a skybox material and apply it to the skybox

  1.  Open
    

the Material Editor , create a new material, and set its Shader parameter
to Sky.

  1. The Diffuse texture must be set to any
    of the three skybox textures that will be used.
  2.  In the
    

RollupBar, go to the Terrain Editing tab and click Environment.

  1.  Scroll
    

down to the SkyBox group
and select a new material for the parameter Material by clicking
on the browse () button.

  1.  In the
    

Material Editor , select a
material that is using the Sky Shader.

  1.  Return
    

to the SkyBox settings in the RollupBar and click the assign (<)
button to apply the selected material to the skybox.
Skybox Parameters

  • ** Material
    low spec** – Select the skybox material that will display at low specs.
  • Angle
    – Specify the angle to rotate the skybox.
  • Stretching
    – Specify the amount to stretch the sky box texture to reduce the horizon
    line.

@BigMonet, thank you for tutorial.

Could you tell is it possible to use transparent skybox?

I mean that with default skybox, depending on time of day the color of sky changes and at the night stars become visible. But according to this tutorial skybox is static and don’t changes depending on time of day.

And what is my way if i don’t want to change default skybox but want to add some static elements on it, for example a planet (so I need only a part of sky to have a picture and the other was transparent)?

@geotype

I will do some experimenting soon and see what happens when I add transparency to the skybox. You are correct, following this tutorial the skybox will be static. It will not update with the time of day changes. If you want to add static elements to the sky, like a planet, I would suggest making an awesome planet texture with opacity and put it on a flat piece of geometry. This can be placed out on the horizon. I’ll create a sample and find out if there is a good workflow for this.

@BigMonet
Thank you for your advice, it really seems to be an easy way for my purpose. My result:

It will be great If you are create a sample with best practice.

@geotype

That looks great, thanks for sharing! What shader did you use for the moon texture?

@BigMonet

I used Illum Shader.