Environment Maps

From Mod Wiki
Revision as of 16:50, 15 October 2007 by (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Environment maps are made up of 6 images that form a cube (also known as cube maps) to create a fake reflection used on windows, scopes, and any other material that uses environment maps.

Using Environment Maps

There are a few ways you can use an environment map:

  • specify it inside a material
  • used with a light_ambient
  • used by info_envbounds

We'll go over how to setup an environment map with a light_ambient and an info_envbounds.

Placing info_envmaps

Setting one up with a light_ambient is fairly straight forward. What you'll need to do first is place an info_envmap in the area you want to reflect, you'll will need to specify two keys and values env_size which tells the entity what size you want the images to be, so give that a value of 128 then you need to set the name of your environment map env_name and give it a value of my_env_map.

Compile your map, after it's done load it, and bring down the console and type makeenvmaps this will locate all info_envmaps and make the environment maps.

Adding it to light_ambients

Bring down the console still open, type in editambient, this will bring up a new window, at the bottom of the window it will have Env. Cubemap with a dialogue and button next to it, click that button and go to the base/env folder where your new environment map is stored and click ok, you may need to reload the engine for it take effect.

Using info_envbounds

Repeat the process of placing an info_envmap.

To add them to areas that don't use portals like building interiors, that would be too difficult to portal off you can use an info_envbounds brush entity, which means when a player walks into this brush volume it'll switch to the environment map that you specified in the info_envbounds.

To do this, you'll need to drag a brush out over the area you want to have the info_envounds (they can consist of multiple brushes) and with the brush/es still selected right click and navigate to info_envbounds.

You'll then need to add one key and value to this entity which is env_name and for example env/my_env_map so it knows what environment map to use.

Compile your map, after it's completed compiling, load it up and check out your new environment inside the info_envbounds.

NOTE: Try to avoid having the origin of your info_envbound inside other brushes, as this will stop it from working.