UFO: Alien Invasion
Loading...
Searching...
No Matches
r_material.h File Reference

Header file for the render material subsystem. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dirt_t
struct  rotate_t
struct  blendmode_t
struct  pulse_t
struct  stretch_t
struct  scroll_t
struct  scale_t
struct  terrain_t
struct  tape_t
struct  anim_t
struct  materialStage_t
struct  material_t

Macros

#define STAGE_TEXTURE   (1 << 0)
#define STAGE_ENVMAP   (1 << 1)
#define STAGE_BLEND   (1 << 2)
#define STAGE_COLOR   (1 << 3)
#define STAGE_PULSE   (1 << 4)
#define STAGE_STRETCH   (1 << 5)
#define STAGE_ROTATE   (1 << 6)
#define STAGE_SCROLL_S   (1 << 7)
#define STAGE_SCROLL_T   (1 << 8)
#define STAGE_SCALE_S   (1 << 9)
#define STAGE_SCALE_T   (1 << 10)
#define STAGE_TERRAIN   (1 << 11)
#define STAGE_TAPE   (1 << 12)
#define STAGE_LIGHTMAP   (1 << 13)
#define STAGE_ANIM   (1 << 14)
#define STAGE_DIRTMAP   (1 << 15)
#define STAGE_FLARE   (1 << 16)
#define STAGE_GLOWMAPLINK   (1 << 17)
#define STAGE_LIGHTING   (1 << 30)
#define STAGE_RENDER   (1 << 31)
#define STAGE_TEXTURE_MATRIX
#define MAX_ANIM_FRAMES   16
#define UPDATE_THRESHOLD   0.02
#define DEFAULT_BUMP   1.0f
#define DEFAULT_PARALLAX   1.0f
#define DEFAULT_SPECULAR   0.2f
#define DEFAULT_HARDNESS   0.2f
#define DEFAULT_GLOWSCALE   1.0f

Enumerations

enum  animLoop_t {
  ANIM_NORMAL , ANIM_ALTERNATE , ANIM_BACKWARDS , ANIM_RANDOM ,
  ANIM_RANDOMFORCE
}

Functions

void R_LoadMaterials (const char *map)
 Load material definitions for each map that has one.
void R_UpdateDefaultMaterial (const char *cvarName, const char *oldValue, const char *newValue, void *data)
 Change listener callback for material value cvars.

Variables

material_t defaultMaterial

Detailed Description

Header file for the render material subsystem.

Definition in file r_material.h.

Macro Definition Documentation

◆ DEFAULT_BUMP

#define DEFAULT_BUMP   1.0f

Definition at line 150 of file r_material.h.

◆ DEFAULT_GLOWSCALE

#define DEFAULT_GLOWSCALE   1.0f

Definition at line 154 of file r_material.h.

◆ DEFAULT_HARDNESS

#define DEFAULT_HARDNESS   0.2f

Definition at line 153 of file r_material.h.

◆ DEFAULT_PARALLAX

#define DEFAULT_PARALLAX   1.0f

Definition at line 151 of file r_material.h.

◆ DEFAULT_SPECULAR

#define DEFAULT_SPECULAR   0.2f

Definition at line 152 of file r_material.h.

◆ MAX_ANIM_FRAMES

#define MAX_ANIM_FRAMES   16

Definition at line 64 of file r_material.h.

Referenced by R_ParseStage().

◆ STAGE_ANIM

#define STAGE_ANIM   (1 << 14)

Definition at line 46 of file r_material.h.

Referenced by R_LoadMaterials(), R_ParseStage(), and R_UpdateMaterial().

◆ STAGE_BLEND

#define STAGE_BLEND   (1 << 2)

Definition at line 34 of file r_material.h.

Referenced by R_ParseStage(), and R_SetSurfaceStageState().

◆ STAGE_COLOR

#define STAGE_COLOR   (1 << 3)

◆ STAGE_DIRTMAP

#define STAGE_DIRTMAP   (1 << 15)

◆ STAGE_ENVMAP

#define STAGE_ENVMAP   (1 << 1)

◆ STAGE_FLARE

#define STAGE_FLARE   (1 << 16)

Definition at line 48 of file r_material.h.

Referenced by R_CreateSurfaceFlare(), R_LoadSurfacesArrays_(), and R_ParseStage().

◆ STAGE_GLOWMAPLINK

#define STAGE_GLOWMAPLINK   (1 << 17)

Definition at line 49 of file r_material.h.

Referenced by R_ParseStage(), and R_StageGlow().

◆ STAGE_LIGHTING

#define STAGE_LIGHTING   (1 << 30)

Definition at line 52 of file r_material.h.

Referenced by R_ParseStage(), R_StageLighting(), and UI_MaterialEditorChangeValue_f().

◆ STAGE_LIGHTMAP

#define STAGE_LIGHTMAP   (1 << 13)

Definition at line 45 of file r_material.h.

Referenced by R_ParseStage(), and R_StageLighting().

◆ STAGE_PULSE

#define STAGE_PULSE   (1 << 4)

Definition at line 36 of file r_material.h.

Referenced by R_ParseStage(), R_SetSurfaceStageState(), and R_UpdateMaterial().

◆ STAGE_RENDER

#define STAGE_RENDER   (1 << 31)

◆ STAGE_ROTATE

#define STAGE_ROTATE   (1 << 6)

Definition at line 38 of file r_material.h.

Referenced by R_ParseStage(), R_StageTextureMatrix(), and R_UpdateMaterial().

◆ STAGE_SCALE_S

#define STAGE_SCALE_S   (1 << 9)

Definition at line 41 of file r_material.h.

Referenced by R_CreateSurfaceFlare(), R_ParseStage(), and R_StageTextureMatrix().

◆ STAGE_SCALE_T

#define STAGE_SCALE_T   (1 << 10)

Definition at line 42 of file r_material.h.

Referenced by R_CreateSurfaceFlare(), R_ParseStage(), and R_StageTextureMatrix().

◆ STAGE_SCROLL_S

#define STAGE_SCROLL_S   (1 << 7)

Definition at line 39 of file r_material.h.

Referenced by R_ParseStage(), R_StageTextureMatrix(), and R_UpdateMaterial().

◆ STAGE_SCROLL_T

#define STAGE_SCROLL_T   (1 << 8)

Definition at line 40 of file r_material.h.

Referenced by R_ParseStage(), R_StageTextureMatrix(), and R_UpdateMaterial().

◆ STAGE_STRETCH

#define STAGE_STRETCH   (1 << 5)

Definition at line 37 of file r_material.h.

Referenced by R_ParseStage(), R_StageTextureMatrix(), and R_UpdateMaterial().

◆ STAGE_TAPE

#define STAGE_TAPE   (1 << 12)

◆ STAGE_TERRAIN

#define STAGE_TERRAIN   (1 << 11)

◆ STAGE_TEXTURE

#define STAGE_TEXTURE   (1 << 0)

Definition at line 32 of file r_material.h.

Referenced by R_ParseStage(), and UI_MaterialEditorChangeValue_f().

◆ STAGE_TEXTURE_MATRIX

#define STAGE_TEXTURE_MATRIX
Value:
( \
)
#define STAGE_SCROLL_S
Definition r_material.h:39
#define STAGE_SCROLL_T
Definition r_material.h:40
#define STAGE_STRETCH
Definition r_material.h:37
#define STAGE_SCALE_T
Definition r_material.h:42
#define STAGE_SCALE_S
Definition r_material.h:41
#define STAGE_ROTATE
Definition r_material.h:38

Definition at line 58 of file r_material.h.

Referenced by R_StageTextureMatrix().

◆ UPDATE_THRESHOLD

#define UPDATE_THRESHOLD   0.02

Definition at line 66 of file r_material.h.

Enumeration Type Documentation

◆ animLoop_t

enum animLoop_t
Enumerator
ANIM_NORMAL 

loops the animation from frame [0, n-1]

ANIM_ALTERNATE 

amount of frames should be uneven [0, n-1, 1]

ANIM_BACKWARDS 

plays the animation in reverse order. Loops from [n-1, 0]

ANIM_RANDOM 

plays the animation in random order.

ANIM_RANDOMFORCE 

plays the animation in random order, but enforces that the following frame is not the same as the current one.

Definition at line 114 of file r_material.h.

Function Documentation

◆ R_LoadMaterials()

◆ R_UpdateDefaultMaterial()

void R_UpdateDefaultMaterial ( const char * cvarName,
const char * oldValue,
const char * newValue,
void * data )

Change listener callback for material value cvars.

Definition at line 1092 of file r_material.cpp.

References data, defaultMaterial, r_default_hardness, and r_default_specular.

Referenced by R_Init(), R_RegisterSystemVars(), and R_ReinitOpenglContext().

Variable Documentation

◆ defaultMaterial

material_t defaultMaterial
extern