Call of Duty 5: Custom Skyboxes

From COD Modding & Mapping Wiki
Revision as of 08:14, 12 March 2012 by CoDEmanX (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This page describes how to configure a Skybox in CoDWaW, and how to get it into the game.

What Makes Up A Skybox?

The original IW engine supports a cube mapped Skybox that's built as part of the map. Our skybox is a bit different - in that it's simply an arbitrary artist-designed model from Maya. And just like any other Maya-exported xmodel, it can contain multiple pieces of geometry (including the sky dome itself), and may reference multiple materials.

Once you've exported your model from Maya, launch AssetManager, open the model_export/skybox.gdt file, and add your skybox's xmodel and materials.


Skybox Material Settings

In AssetManager, special care should be taken when adding skybox geometry materials.

materialType
skybox geometry materials must have their materialType set to "sky noncubemap"
sort
use one of the sky* settings. This determines the render order of the associated geometry. For example, the base skydome geometry should be rendered first(before the clouds), so set it to Sky, the very first sky sort.
blendFunc
for the base skydome geometry material, set this to Replace, so that it replaces any existing color. For anything that's on top of the base skydome(such as cloud layers), set it to Blend(if you want alpha blending)
alphaTest
set this to Always*(effectively turning alpha test off).
depthTest
should be set to LessEqual*.
depthWrite
make sure this is off.
Enabling UV Texture Animation
this is controlled by the uScroll and vScroll settings.

Setting a skybox for your map

Load up the map in CoD5Radiant, and add a key/value pair on the worldspawn. The key must be skyboxmodel, the value must be the name of one of the xmodels defined in model_export/skybox.gdt:


Seeing The Skybox In Game

Once you have set the worldspawn key/value pair in your map, save it and compile it. Then build the level fastfile. After this is done, you can run your map and should see the skybox.


Sources: Treyarch's Wiki