General Concepts 102: Lesson 6
Shaders and Skies

Now that you have a basic understanding of all the architecturally necessary aspects of a map, it's time to learn about a few things to make your map feel like part of a bigger place.

The key to this, and all other flashy graphical aspects of JK2, are shaders.  We've already dealt with a few shaders, like caulk and clip, but they are much more powerful than that.

A shader is nothing more complicated than a simple script that gives information to the JK2 engine on what to display on any given surface.  These scripts can consist of only surfaceparms (parameters determining the physical qualities of a given surface - such as "nonsolid" or "water") or of different textures blended together.  A prime example of this is a sky.

Sky shaders basically tell the engine to create a leak in your map - but in addition to that, they draw a gigantic box around your map called a skybox.  A skybox consists of six textures (up, down, front, back, left, right) drawn extremely far away from the player.  You can see a good example of a skybox in any outdoor environment in Raven's SP levels - try "devmap bespin_undercity" at the console and look around.

To utilize a sky shader, all you need to do is apply the sky shader from the Texture Browser to any given surface.  Many people have a preconception that you need to actually draw a huge box around your map.  This is incorrect.  By doing that, you will increase your compile time by astronomical amounts as well as prevent the engine from catching any leaks you might create.  While that last part might sound like a good thing, believe me, you want to know where every leak in your map is so that you can fix it - you don't want to just cover them up.

For the sake of our example, apply the skies/stars shader to the empty wall and ceiling of this map.  Remember, just apply the shader to the surface of the brushes - leave the rest of the brush as caulk.  In the editor, after you apply the shader to the surfaces, it will appear as a blue and black checkerboard.  Don't worry, it'll still appear in the game.  This is because in the shader's script, the shader's writer must specify what texture to show you in the editor.  Some shaders simply don't have that line, so they appear as that checkerboard.

Compile, and you're done.

Try out all the shaders in the skies directory just to see what they look like.  Perhaps you'll be inspired to make something.

Back to Home