Mapping & SDK

KF2 SDK: Edit the Default Skybox for Daytime Maps

By default Killing Floor 2 SDK maps get a night sky. This May 2015 tutorial shows how to build your own sky material instance so that a custom map can be set in daylight. It assumes that you already know how to build a map. Save your map before starting.

Setting it up

  1. Open the Content Browser, select the KFGame package and search for "Sky" with the Static Meshes filter. Drag ENV_Basic_Sky into the map.

ENV_Basic_Sky in the Content Browser Search for ENV_Basic_Sky and drop it into the level.

  1. Switch the filter to All, right-click in the Content Browser and choose New MaterialInstanceConstant.

New MaterialInstanceConstant menu Create a MaterialInstanceConstant from the context menu.

  1. In the dialog pick your map name as the Package. The Group is a folder name for your custom texture (the author used Customtexture) and the Name is free (the author used Sky_day). Click OK.

Package, group and name dialog Package, group and name for the new instance.

  1. In the Material Editor, scroll to Parent. Select the material M_Procedural_Sky_MASTER02 in the Content Browser, then click the green arrow beside Parent to load it. You can also import a custom texture.

Setting the parent material Use the green arrow to assign the selected material as the parent.

  1. Close the editor, right-click the sky mesh you placed and choose StaticMeshActor Properties (or press F4).

StaticMeshActor properties Open the actor properties.

  1. Search for "material". Under Rendering, find Materials (0), click Add a new item, select your MaterialInstance in the Content Browser and press the green arrow (Use selected object). Doing it this way lets you see edits in real time.

Adding the material to the mesh Assign the new material instance to the sky mesh.

  1. Close the window, right-click the sky material and choose Edit Using Material Instance Editor.

Edit using Material Instance Editor Open the instance editor.

Editing the sky material

Go to Parameter Groups, where you will find several submenus.

  • Custom sky texture: open Texture Parameter Values. Tick Tex2D_Clouds_Diff and choose your imported texture. Tick Tex2d_Cloud_Norm to set custom normals. For importing textures see custom textures and materials with the SDK.

Texture parameter values Texture parameters for a custom sky.

  • Stock texture: edit Vector Parameter Values and Scalar Parameter Values instead.

Vector parameter values Vector parameters.

Scalar parameter values Scalar parameters.

Most settings are self-explanatory, so change them to taste. When you close the Material Editor the changes save automatically, and you can see them in the viewport and in the Content Browser.

Sky result in the viewport The edited sky in the rendered viewport.

Add a Skylight to match

Add a Skylight actor if you have not already. Its position does not matter, so place it anywhere easy to find. Choose Lit in the bottom-left viewport mode to see the lighting.

Skylight actor Placing a Skylight and previewing with Lit.

Then open Light, Light Component in its properties and adjust color and brightness. The author only changed those two, though more options exist.

Light component settings Light component settings.

Finishing up

Build your map and then Publish. If you get an error dialog like the one below, click Yes. It will still work.

Publish error dialog The publish warning that you can accept.

Finally, launch the game to check the result.

Result in game The daytime sky in game.

For more mapping material see the SDK mapping guide.

FAQ

Which mesh and material does the tutorial use?
The static mesh ENV_Basic_Sky from the KFGame package and the parent material M_Procedural_Sky_MASTER02, wrapped in a new MaterialInstanceConstant stored in your own map package.
Why add a Skylight?
So the lighting of the map matches the sky you built. The Skylight color and brightness are changed in its Light Component properties, and you should switch the viewport to Lit to preview.
What if publishing shows an error?
The guide says to click Yes in the error dialog. The map will still work.