Light

Description: Handles lightmaps, dynamic light, fog, etc

Source file: ...\genesis3d\OpenSource\Source\World\LIGHT.h

Contents:

Functions: EngineInit, EngineShutdown, WorldInit, WorldShutdown, SetEngine, SetWorld, SetGBSP, WorldAddLight, WorldRemoveLight, SetupLights, SetAttributes, WorldSetLTypeTable, WorldGetLTypeCurrent, SetupLightmap, GetLightmapRGB, GetLightmapRGBBlended, FogVerts

Types: Light_DLight, Light_LightInfo

Constants: view

Additions for Genesis3D v1.6: Type: light, also types float converted to geFloat

Constants:

#define MAX_DYNAMIC_LIGHTS         32       // Maximum number of moving lights in map
#define MAX_LTYPES                             12       // Max number of ltypes
//  #define MAX_LMAP_SIZE                  128
//  #define MAX_LMAP_SIZE                  18
#define MAX_LMAP_SIZE                      18
Return to Contents

Types:

Light_DLight
typedef struct {
     geBoolean      Active;      // Is this light in use?
     GE_RGBA    Color;       // Color of light (0...255.0f)
     geVec3d        Pos;          // Position of this light
     float               Radius;      // Intensity of this light (Radius)
      // Fixed point color
      uint32           FColorR;
      uint32           FColorG;
      uint32           FColorB;
      geBoolean CastShadow;
} Light_DLight;
Return to Contents

 

Light_LightInfo

typedef struct Light_LightInfo {
 // Intensity tables, for animated styles
      BOOL                 LTypeDynamic[MAX_LTYPES];
      int32                    LTypeIntensities[MAX_LTYPES];
      uint8                    LTypeIntensities2[MAX_LTYPES];
 
      char                     LTypeTable[MAX_LTYPES][70];
      int32                    IPos[MAX_LTYPES]; // Ref position in ltype table
 
      Light_DLight       DynamicLights[MAX_DYNAMIC_LIGHTS];
      int32                   NumDynamicLights;
} Light_LightInfo;
Return to Contents
 
light
Note: This is available on in Genesis3D v1.6
typedef struct tag_light {
int light;
GE_RGBA color;
int style;
geVec3d origin;
} light;
Return to Contents
 

Functions:

geBoolean Light_EngineInit(geEngine* Engine);

 
Return to Contents

void  Light_EngineShutdown(geEngine* Engine);

 
Return to Contents

geBoolean Light_WorldInit(geWorld* World);

 
Return to Contents

void  Light_WorldShutdown(geWorld* World);

 
Return to Contents

geBoolean Light_SetEngine(geEngine* Engine);

 
Return to Contents

geBoolean Light_SetWorld(geWorld* World);

 
Return to Contents

geBoolean Light_SetGBSP(World_BSP* BSP);

  

Return to Contents

Light_DLight* Light_WorldAddLight(geWorld* World);

 
Return to Contents

void  Light_WorldRemoveLight(geWorld* World, Light_DLight* DLight);

 
Return to Contents

geBoolean  Light_SetupLights(geWorld* World);

 
Return to Contents

geBoolean Light_SetAttributesLight_DLight* Light, const geVec3d* Pos, const GE_RGBA* RGBA, float Radius, geBoolean CastShadow);

 
Return to Contents

geBoolean Light_WorldSetLTypeTable(geWorld* World, int32 LType, const char * Table);

 
Return to Contents

char  Light_WorldGetLTypeCurrent(geWorld* World, int32 LType);

 
Return to Contents

void  Light_SetupLightmap(DRV_LInfo* LInfo, BOOL* Dynamic);

 
Return to Contents

geBoolean Light_GetLightmapRGB(Surf_SurfInfo* Surf, geVec3d* Pos, GE_RGBA* RGBA);

 
Return to Contents

geBoolean Light_GetLightmapRGBBlended(Surf_SurfInfo* Surf, geVec3d* Pos, GE_RGBA* RGBA);

 
Return to Contents

void  Light_FogVerts(const geFog* Fog, const geVec3d* POV, const geVec3d* Verts, Surf_TexVert* TexVerts, int32 NumVerts);

 
Return to Contents