TexGen (Material stage keyword)

From modwiki

Jump to: navigation, search

Description

The texgen stage keyword modifies the texture coordinates of the associated map as required by certain effects, such as skyboxes.

Usage

texGen <type>

Parameters

The type parameter can be any of the following values:

normal
Unknown effect.
skybox
Set the appropriate texture coordinates for a skybox. The associated stage should be a cameraCubeMap.
wobblesky <x> <y> <z>
Same as skybox, but rotate the coordinates according to the axis given. There are some inconsistencies in the usage of the x, y, and z components so please see the notes below.
reflect
Use the defined stage map for environment mapping.

Example

The following is a typical skybox map stage.

{
  blend add
  cameraCubeMap env/someskymap
  texgen skybox
}

Notes

Wobblesky

Setting the "z" component to a positive value causes the skybox to rotate continuously around the vertical axis. This is used in Doom 3 in some of the Hell levels.

The "x" and "y" components only apply a transformation once upon initial map load much like the way the rotate keyword works. In order to rotate continuously you need to pass an expression like so ...

texgen wobblesky (time * .15) .00 .00 

See also

How to add a sky


Personal tools
Main
id Tech 5