overridetagnameset_t;
struct md3vertex_s;
-struct trivertex_s;
+struct trivertx_s;
+typedef struct texvecvertex_s
+{
+ signed char svec[3];
+ signed char tvec[3];
+}
+texvecvertex_t;
// used for mesh lists in q1bsp/q3bsp map models
// (the surfaces reference portions of these meshes)
int num_morphframes;
struct md3vertex_s *data_morphmd3vertex;
struct trivertx_s *data_morphmdlvertex;
+ struct texvecvertex_s *data_morphtexvecvertex;
float *data_morphmd2framesize6f;
float num_morphmdlframescale[3];
float num_morphmdlframetranslate[3];
int clampmap;
float framerate;
int numframes;
- char texturename[TEXTURE_MAXFRAMES][Q3PATHLENGTH];
+ int texflags;
+ char** texturename;
int blendfunc[2];
q3shaderinfo_layer_rgbgen_t rgbgen;
q3shaderinfo_layer_alphagen_t alphagen;
qboolean lighting;
qboolean vertexalpha;
qboolean textureblendalpha;
- q3shaderinfo_layer_t *primarylayer, *backgroundlayer;
+ int primarylayer, backgroundlayer;
q3shaderinfo_layer_t layers[Q3SHADER_MAXLAYERS];
char skyboxname[Q3PATHLENGTH];
q3shaderinfo_deform_t deforms[Q3MAXDEFORMS];
+ // reflection
float reflectmin; // when refraction is used, minimum amount of reflection (when looking straight down)
float reflectmax; // when refraction is used, maximum amount of reflection (when looking parallel to water)
float refractfactor; // amount of refraction distort (1.0 = like the cvar specifies)
vec4_t refractcolor4f; // color tint of refraction (including alpha factor)
float reflectfactor; // amount of reflection distort (1.0 = like the cvar specifies)
vec4_t reflectcolor4f; // color tint of reflection (including alpha factor)
+ float r_water_wateralpha; // additional wateralpha to apply when r_water is active
}
q3shaderinfo_t;
// current material flags (updated each bmodel render)
int currentmaterialflags;
- // current PolygonOffset values for rendering this material
- float currentpolygonfactor;
- float currentpolygonoffset;
- float basepolygonfactor;
- float basepolygonoffset;
+ // PolygonOffset values for rendering this material
+ // (these are added to the r_refdef values and submodel values)
+ float biaspolygonfactor;
+ float biaspolygonoffset;
// textures to use when rendering this material
skinframe_t *currentskinframe;
float specularpower;
// color tint (colormod * currentalpha) used for rtlighting this material
float dlightcolor[3];
+ // color tint (colormod * 2) used for lightmapped lighting on this material
+ // includes alpha as 4th component
+ // replaces role of gl_Color in GLSL shader
+ float lightmapcolor[4];
// from q3 shaders
int customblendfunc[2];
vec4_t refractcolor4f; // color tint of refraction (including alpha factor)
float reflectfactor; // amount of reflection distort (1.0 = like the cvar specifies)
vec4_t reflectcolor4f; // color tint of reflection (including alpha factor)
+ float r_water_wateralpha; // additional wateralpha to apply when r_water is active
}
texture_t;
{
// texture mapping properties used by this surface
mtexinfo_t *texinfo; // q1bsp
- // index into r_refdef.lightstylevalue array, 255 means not used (black)
+ // index into r_refdef.scene.lightstylevalue array, 255 means not used (black)
unsigned char styles[MAXLIGHTMAPS]; // q1bsp
// RGB lighting data [numstyles][height][width][3]
unsigned char *samples; // q1bsp
struct trace_s;
+typedef struct model_brush_lightstyleinfo_s
+{
+ int style;
+ int value;
+ int numsurfaces;
+ int *surfacelist;
+}
+model_brush_lightstyleinfo_t;
+
typedef struct model_brush_s
{
// true if this model is a HalfLife .bsp file
qboolean ishlbsp;
- // true if this model is a Martial Concert .bsp file
- qboolean ismcbsp;
// string of entity definitions (.map format)
char *entities;
typedef struct model_brushq1_s
{
- // lightmap format, set to r_lightmaprgba when model is loaded
- int lightmaprgba;
-
dmodel_t *submodels;
int numvertexes;
int numclipnodes;
mclipnode_t *clipnodes;
- int numhulls; // this variable is only used by MCBSP, other formats know it intuitively
hull_t hulls[MAX_MAP_HULLS];
int num_compressedpvs;
unsigned char *nmaplightdata; // deluxemap file
// lightmap update chains for light styles
- int light_styles;
- unsigned char *light_style;
- int *light_stylevalue;
- msurface_t ***light_styleupdatechains;
- msurface_t **light_styleupdatechainsbuffer;
+ int num_lightstyles;
+ model_brush_lightstyleinfo_t *data_lightstyleinfo;
}
model_brushq1_t;
void(*DrawLight)(struct entity_render_s *ent, int numsurfaces, const int *surfacelist, const unsigned char *trispvs);
// trace a box against this model
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);
+ // find the supercontents value at a point in this model
+ int (*PointSuperContents)(struct model_s *model, int frame, const vec3_t point);
// fields belonging to some types of model
model_sprite_t sprite;
model_brush_t brush;
void Mod_LoadQ3Shaders(void);
q3shaderinfo_t *Mod_LookupQ3Shader(const char *name);
-qboolean Mod_LoadTextureFromQ3Shader(texture_t *texture, const char *name, qboolean q1bsp, qboolean q3bsp, qboolean md3);
+qboolean Mod_LoadTextureFromQ3Shader(texture_t *texture, const char *name, qboolean warnmissing, qboolean fallback, int defaulttexflags);
extern cvar_t r_mipskins;