typedef enum texturelayertype_e
{
TEXTURELAYERTYPE_INVALID,
- TEXTURELAYERTYPE_SKY,
TEXTURELAYERTYPE_LITTEXTURE_COMBINE,
TEXTURELAYERTYPE_LITTEXTURE_MULTIPASS,
TEXTURELAYERTYPE_LITTEXTURE_VERTEX,
// current texture transform matrix (used for water scrolling)
matrix4x4_t currenttexmatrix;
+ qboolean colormapping;
+ rtexture_t *basetexture;
+ rtexture_t *glosstexture;
+ float specularscale;
+ float specularpower;
+
int currentnumlayers;
texturelayer_t currentlayers[16];
unsigned char styles[MAXLIGHTMAPS]; // q1bsp
// RGB lighting data [numstyles][height][width][3]
unsigned char *samples; // q1bsp
+ // RGB normalmap data [numstyles][height][width][3]
+ unsigned char *nmapsamples; // q1bsp
// stain to apply on lightmap (soot/dirt/blood/whatever)
unsigned char *stainsamples; // q1bsp
- // the stride when building lightmaps to comply with fragment update
- int lightmaptexturestride; // q1bsp
int texturemins[2]; // q1bsp
int extents[2]; // q1bsp
+ int lightmaporigin[2]; // q1bsp
}
msurface_lightmapinfo_t;
texture_t *texture;
// the lightmap texture fragment to use on the rendering mesh
rtexture_t *lightmaptexture;
+ // the lighting direction texture fragment to use on the rendering mesh
+ rtexture_t *deluxemaptexture;
// this surface is part of this mesh
surfmesh_t *groupmesh;
void (*AmbientSoundLevelsForPoint)(struct model_s *model, const vec3_t p, unsigned char *out, int outsize);
void (*RoundUpToHullSize)(struct model_s *cmodel, const vec3_t inmins, const vec3_t inmaxs, vec3_t outmins, vec3_t outmaxs);
- char skybox[64];
+ char skybox[MAX_QPATH];
rtexture_t *solidskytexture;
rtexture_t *alphaskytexture;
+
+ // QuakeWorld
+ int qw_md4sum;
+ int qw_md4sum2;
}
model_brush_t;
int num_lightdata;
unsigned char *lightdata;
-
- int numlights;
- mlight_t *lights;
+ unsigned char *nmaplightdata; // deluxemap file
// lightmap update chains for light styles
int light_styles;
int num_lightgrid_dimensions[3];
// transform modelspace coordinates to lightgrid index
matrix4x4_t num_lightgrid_indexfromworld;
+
+ // true if this q3bsp file has been detected as using deluxemapping
+ // (lightmap texture pairs, every odd one is never directly refernced,
+ // and contains lighting normals, not colors)
+ qboolean deluxemapping;
+ // true if the detected deluxemaps are the modelspace kind, rather than
+ // the faster tangentspace kind
+ qboolean deluxemapping_modelspace;
}
model_brushq3_t;
// draw the lighting on a model (through stencil)
void(*DrawLight)(struct entity_render_s *ent, int numsurfaces, const int *surfacelist);
// trace a box against this model
- void (*TraceBox)(struct model_s *model, int frame, struct trace_s *trace, const vec3_t boxstartmins, const vec3_t boxstartmaxs, const vec3_t boxendmins, const vec3_t boxendmaxs, int hitsupercontentsmask);
+ void (*TraceBox)(struct model_s *model, int frame, struct trace_s *trace, const vec3_t start, const vec3_t boxmins, const vec3_t boxmaxs, const vec3_t end, int hitsupercontentsmask);
// fields belonging to some types of model
model_sprite_t sprite;
model_brush_t brush;
void Mod_Init (void);
model_t *Mod_LoadModel(model_t *mod, qboolean crash, qboolean checkdisk, qboolean isworldmodel);
-void Mod_ClearAll (void);
model_t *Mod_FindName (const char *name);
model_t *Mod_ForName (const char *name, qboolean crash, qboolean checkdisk, qboolean isworldmodel);
void Mod_UnloadModel (model_t *mod);
int Mod_BuildVertexRemapTableFromElements(int numelements, const int *elements, int numvertices, int *remapvertices);
void Mod_BuildTriangleNeighbors(int *neighbors, const int *elements, int numtriangles);
-void Mod_ValidateElements(int *elements, int numtriangles, int numverts, const char *filename, int fileline);
+void Mod_ValidateElements(int *elements, int numtriangles, int firstvertex, int numverts, const char *filename, int fileline);
void Mod_BuildNormals(int firstvertex, int numvertices, int numtriangles, const float *vertex3f, const int *elements, float *normal3f, qboolean areaweighting);
void Mod_BuildTextureVectorsAndNormals(int firstvertex, int numvertices, int numtriangles, const float *vertex, const float *texcoord, const int *elements, float *svectors, float *tvectors, float *normals, qboolean areaweighting);