DarkPlaces
Game engine based on the Quake 1 engine by id Software, developed by LadyHavoc
 
model_shared.h
Go to the documentation of this file.
1/*
2Copyright (C) 1996-1997 Id Software, Inc.
3
4This program is free software; you can redistribute it and/or
5modify it under the terms of the GNU General Public License
6as published by the Free Software Foundation; either version 2
7of the License, or (at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
13See the GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program; if not, write to the Free Software
17Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19*/
20
21#ifndef MODEL_SHARED_H
22#define MODEL_SHARED_H
23
24#include <stddef.h>
25#include "qdefs.h"
26#include "bspfile.h"
27#include "r_qshader.h"
28#include "matrixlib.h"
29struct rtexture_s;
30struct mempool_s;
31struct skeleton_s;
32struct skinframe_s;
33
34typedef enum synctype_e {ST_SYNC=0, ST_RAND } synctype_t;
35
36/*
37
38d*_t structures are on-disk representations
39m*_t structures are in-memory
40
41*/
42
44
45typedef struct animscene_s
46{
47 char name[32]; // for viewthing support
50 int loop; // true or false
51 float framerate;
52}
54
55struct md3vertex_s;
56struct trivertx_s;
57typedef struct texvecvertex_s
58{
59 signed char svec[3];
60 signed char tvec[3];
61}
63
64typedef struct blendweights_s
65{
66 unsigned char index[4];
67 unsigned char influence[4];
68}
70
71typedef struct r_meshbuffer_s
72{
73 int bufferobject; // OpenGL
74 void *devicebuffer; // Direct3D
75 size_t size;
81}
83
84// used for mesh lists in q1bsp/q3bsp map models
85// (the surfaces reference portions of these meshes)
86typedef struct surfmesh_s
87{
88 // triangle data in system memory
89 int num_triangles; // number of triangles in the mesh
90 int *data_element3i; // int[tris*3] triangles of the mesh, 3 indices into vertex arrays for each
91
92 // vertex data in system memory
93 int num_vertices; // number of vertices in the mesh
94 float *data_vertex3f; // float[verts*3] vertex locations
95 float *data_svector3f; // float[verts*3] direction of 'S' (right) texture axis for each vertex
96 float *data_tvector3f; // float[verts*3] direction of 'T' (down) texture axis for each vertex
97 float *data_normal3f; // float[verts*3] direction of 'R' (out) texture axis for each vertex
98 float *data_texcoordtexture2f; // float[verts*2] texcoords for surface texture
99 float *data_texcoordlightmap2f; // float[verts*2] texcoords for lightmap texture
101 unsigned char *data_skeletalindex4ub;
103 int *data_lightmapoffsets; // index into surface's lightmap samples for vertex lighting
104 // index buffer - only one of these will be non-NULL
107 unsigned short *data_element3s; // unsigned short[tris*3] triangles of the mesh in unsigned short format (NULL if num_vertices > 65536)
110 // vertex buffers
129 // morph blending, these are zero if model is skeletal or static
131 struct md3vertex_s *data_morphmd3vertex;
132 struct trivertx_s *data_morphmdlvertex;
133 struct texvecvertex_s *data_morphtexvecvertex;
135 float num_morphmdlframescale[3];
136 float num_morphmdlframetranslate[3];
137 // skeletal blending, these are NULL if model is morph or static
138 struct blendweights_s *data_blendweights;
140 unsigned short *blends;
141 // set if there is some kind of animation on this model
143
144 // dynamic mesh building support (Mod_Mesh_*)
145 int num_vertexhashsize; // always pow2 for simple masking
146 int *data_vertexhash; // hash table - wrapping buffer for storing index of similar vertex with -1 as terminator
147 int max_vertices; // preallocated size of data_vertex3f and friends (always >= num_vertices)
148 int max_triangles; // preallocated size of data_element3i
149}
151
152#define SHADOWMESHVERTEXHASH 1024
153typedef struct shadowmeshvertexhash_s
154{
155 struct shadowmeshvertexhash_s *next;
156}
158
159typedef struct shadowmesh_s
160{
161 struct mempool_s *mempool;
162
165 float *vertex3f;
168
174 unsigned short *element3s;
177
178 // used for shadow mapping cubemap side partitioning
179 int sideoffsets[6], sidetotals[6];
180
181 // these are NULL after Mod_ShadowMesh_Finish is performed, only used
182 // while building meshes
184}
186
187typedef struct texture_s
188{
189 // name
190 char name[64];
191
192 // q1bsp
193 // size
194 unsigned int width, height;
195 // SURF_ flags
196 //unsigned int flags;
197
198 // base material flags
200 // current material flags (updated each bmodel render)
202 // base material alpha (used for Q2 materials)
204
205 // PolygonOffset values for rendering this material
206 // (these are added to the r_refdef values and submodel values)
209
210 // textures to use when rendering this material (derived from materialshaderpass)
211 struct skinframe_s *currentskinframe;
212 // textures to use for terrain texture blending (derived from backgroundshaderpass)
213 struct skinframe_s *backgroundcurrentskinframe;
214
215 // total frames in sequence and alternate sequence
216 int anim_total[2];
217 // direct pointers to each of the frames in the sequences
218 // (indexed as [alternate][frame])
219 struct texture_s *anim_frames[2][10];
220 // 1 = q1bsp animation with anim_total[0] >= 2 (animated) or anim_total[1] >= 1 (alternate frame set)
221 // 2 = q2bsp animation with anim_total[0] >= 2 (uses self.frame)
223
224 // renderer checks if this texture needs updating...
227 // the current alpha of this texture (may be affected by r_wateralpha, also basealpha, and ent->alpha)
229 // current value of blendfunc - one of:
230 // {GL_SRC_ALPHA, GL_ONE}
231 // {GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}
232 // {customblendfunc[0], customblendfunc[1]}
233 // {GL_ONE, GL_ZERO}
234 int currentblendfunc[2];
235 // the current texture frame in animation
236 struct texture_s *currentframe;
237 // current texture transform matrix (used for water scrolling)
240
241 // various q3 shader features
243 texture_shaderpass_t *shaderpasses[Q3SHADER_MAXLAYERS]; // all shader passes in one array
244 texture_shaderpass_t *materialshaderpass; // equal to one of shaderpasses[] or NULL
245 texture_shaderpass_t *backgroundshaderpass; // equal to one of shaderpasses[] or NULL
246 unsigned char startpreshaderpass; // range within shaderpasses[]
247 unsigned char endpreshaderpass; // number of preshaderpasses
248 unsigned char startpostshaderpass; // range within shaderpasses[]
249 unsigned char endpostshaderpass; // number of postshaderpasses
250
252 struct rtexture_s *basetexture; // original texture without pants/shirt/glow
253 struct rtexture_s *pantstexture; // pants only (in greyscale)
254 struct rtexture_s *shirttexture; // shirt only (in greyscale)
255 struct rtexture_s *nmaptexture; // normalmap (bumpmap for dot3)
256 struct rtexture_s *glosstexture; // glossmap (for dot3)
257 struct rtexture_s *glowtexture; // glow only (fullbrights)
258 struct rtexture_s *fogtexture; // alpha of the base texture (if not opaque)
259 struct rtexture_s *reflectmasktexture; // mask for fake reflections
260 struct rtexture_s *reflectcubetexture; // fake reflections cubemap
261 struct rtexture_s *backgroundbasetexture; // original texture without pants/shirt/glow
262 struct rtexture_s *backgroundnmaptexture; // normalmap (bumpmap for dot3)
263 struct rtexture_s *backgroundglosstexture; // glossmap (for dot3)
264 struct rtexture_s *backgroundglowtexture; // glow only (fullbrights)
266
267 // rendering parameters - updated by R_GetCurrentTexture using rsurface.render_* fields
268 // (almost) all map textures are lightmap (no MATERIALFLAG_MODELLIGHT set),
269 // (almost) all model textures are MATERIALFLAG_MODELLIGHT,
270 // MATERIALFLAG_FULLBRIGHT is rendered as a forced MATERIALFLAG_MODELLIGHT with rtlights disabled
271 float render_glowmod[3];
272 // MATERIALFLAG_MODELLIGHT uses these parameters
273 float render_modellight_ambient[3];
274 float render_modellight_diffuse[3];
275 float render_modellight_lightdir_world[3];
276 float render_modellight_lightdir_local[3];
277 float render_modellight_specular[3];
278 // lightmap rendering (not MATERIALFLAG_MODELLIGHT)
279 float render_lightmap_ambient[3];
280 float render_lightmap_diffuse[3];
281 float render_lightmap_specular[3];
282 // rtlights use these colors for the materials on this entity
283 float render_rtlight_diffuse[3];
284 float render_rtlight_specular[3];
285 // tint applied on top of render_*_diffuse for pants layer
286 float render_colormap_pants[3];
287 // tint applied on top of render_*_diffuse for shirt layer
288 float render_colormap_shirt[3];
289
290 // from q3 shaders
291 int customblendfunc[2];
292
293 // q3bsp
296
297 // q2bsp
298 // we have to load the texture multiple times when Q2SURF_ flags differ,
299 // though it still shares the skinframe
303
304 // q1qsp
306 struct texture_s *skynoshadowtexture;
307
308 // reflection
309 float reflectmin; // when refraction is used, minimum amount of reflection (when looking straight down)
310 float reflectmax; // when refraction is used, maximum amount of reflection (when looking parallel to water)
311 float refractfactor; // amount of refraction distort (1.0 = like the cvar specifies)
312 vec4_t refractcolor4f; // color tint of refraction (including alpha factor)
313 float reflectfactor; // amount of reflection distort (1.0 = like the cvar specifies)
314 vec4_t reflectcolor4f; // color tint of reflection (including alpha factor)
315 float r_water_wateralpha; // additional wateralpha to apply when r_water is active
316 float r_water_waterscroll[2]; // scale and speed
317 float refractive_index; // used by r_shadow_bouncegrid for bending photons for refracted light
318 int camera_entity; // entity number for use by cameras
319
320 // offsetmapping
324
325 // transparent sort category
327
328 // gloss
331
332 // diffuse and ambient
334
335 // used by Mod_Mesh_GetTexture for drawflag and materialflag overrides, to disambiguate the same texture with different hints
339}
340 texture_t;
341
342typedef struct mtexinfo_s
343{
344 float vecs[2][4]; // [s/t][xyz offset]
347 int q2flags; // miptex flags + overrides
348 int q2value; // light emission, etc
349 char q2texture[32]; // texture name (textures/*.wal)
350 int q2nexttexinfo; // for animations, -1 = end of chain
351}
353
354typedef struct msurface_lightmapinfo_s
355{
356 // texture mapping properties used by this surface
358 // index into r_refdef.scene.lightstylevalue array, 255 means not used (black)
359 unsigned char styles[MAXLIGHTMAPS]; // q1bsp
360 // RGB lighting data [numstyles][height][width][3]
361 unsigned char *samples; // q1bsp
362 // RGB normalmap data [numstyles][height][width][3]
363 unsigned char *nmapsamples; // q1bsp
364 // stain to apply on lightmap (soot/dirt/blood/whatever)
365 unsigned char *stainsamples; // q1bsp
366 int texturemins[2]; // q1bsp
367 int extents[2]; // q1bsp
368 int lightmaporigin[2]; // q1bsp
369}
371
372struct q3deffect_s;
373
377typedef struct msurface_s
378{
380 int num_triangles; // triangles
381 int num_firsttriangle; // first element is this *3
382 int num_vertices; // length of the range referenced by elements
383 int num_firstvertex; // min vertex referenced by elements
384
388 struct rtexture_s *lightmaptexture;
390 struct rtexture_s *deluxemaptexture;
391
392 // the following fields are used situationally and are not part of rendering in typical usage
393
397
401 struct q3deffect_s* effect; // q3bsp
402
404 int num_firstcollisiontriangle; // q3bsp only
405 int num_collisiontriangles; // number of triangles (if surface has collisions enabled)
406 int num_collisionvertices; // number of vertices referenced by collision triangles (if surface has collisions enabled)
407
408 // used by Mod_Mesh_Finalize when building sortedmodelsurfaces
410}
412
413#include "bih.h"
414
415#include "model_brush.h"
416#include "model_q1bsp.h"
417#include "model_q2bsp.h"
418#include "model_q3bsp.h"
419#include "model_vbsp.h"
420#include "model_sprite.h"
421#include "model_alias.h"
422
423struct trace_s;
424
425struct frameblend_s;
426struct skeleton_s;
427
428typedef struct model_s
429{
430 // name and path of model, for example "progs/player.mdl"
432 // model needs to be loaded if this is false
434 // set if the model is used in current map, models which are not, are purged
436 // CRC of the file this model was loaded from, to reload if changed
437 unsigned int crc;
438 // mod_brush, mod_alias, mod_sprite
440 // memory pool for allocations
441 struct mempool_s *mempool;
442 // all models use textures...
444 // EF_* flags (translated from the model file's different flags layout)
445 unsigned effects;
446 // number of QC accessible frame(group)s in the model
448 // number of QC accessible skin(group)s in the model
450 // whether to randomize animated framegroups
452 // bounding box at angles '0 0 0'
453 vec3_t normalmins, normalmaxs;
454 // bounding box if yaw angle is not 0, but pitch and roll are
455 vec3_t yawmins, yawmaxs;
456 // bounding box if pitch or roll are used
457 vec3_t rotatedmins, rotatedmaxs;
458 // sphere radius, usable at any angles
459 float radius;
460 // squared sphere radius for easier comparisons
461 float radius2;
462 // skin animation info
463 animscene_t *skinscenes; // [numskins]
464 // skin animation info
465 animscene_t *animscenes; // [numframes]
466 // range of surface numbers in this model
470 int *modelsurfaces_sorted; // same size as num_surfaces
471 // range of collision brush numbers in this (sub)model
474 // BIH (Bounding Interval Hierarchy) for this (sub)model
476 bih_t render_bih; // if not set, use collision_bih instead for rendering purposes too
477 // for md3 models
481 // for skeletal models
484 float num_posescale; // scaling factor from origin in poses7s format (includes divide by 32767)
485 float num_poseinvscale; // scaling factor to origin in poses7s format (includes multiply by 32767)
487 short *data_poses7s; // origin xyz, quat xyzw, unit length, values normalized to +/-32767 range
489 // textures of this model
491 int max_textures; // preallocated for expansion (Mod_Mesh_*)
496 // surfaces of this model
498 int max_surfaces; // preallocated for expansion (Mod_Mesh_*)
500 // optional lightmapinfo data for surface lightmap updates
502 // all surfaces belong to this mesh
504 // data type of model
506 // generates vertex data for a given frameblend
507 void(*AnimateVertices)(const struct model_s * RESTRICT model, const struct frameblend_s * RESTRICT frameblend, const struct skeleton_s *skeleton, float * RESTRICT vertex3f, float * RESTRICT normal3f, float * RESTRICT svector3f, float * RESTRICT tvector3f);
508 // draw the model's sky polygons
509 void(*DrawSky)(struct entity_render_s *ent);
510 // draw refraction/reflection textures for the model's water polygons
511 void(*DrawAddWaterPlanes)(struct entity_render_s *ent);
512 // draw the model using lightmap/dlight shading
513 void(*Draw)(struct entity_render_s *ent);
514 // draw the model to the depth buffer (no color rendering at all)
515 void(*DrawDepth)(struct entity_render_s *ent);
516 // draw any enabled debugging effects on this model (such as showing triangles, normals, collision brushes...)
517 void(*DrawDebug)(struct entity_render_s *ent);
518 // draw geometry textures for deferred rendering
519 void(*DrawPrepass)(struct entity_render_s *ent);
520 // compile an optimized shadowmap mesh for the model based on light source
521 void(*CompileShadowMap)(struct entity_render_s *ent, vec3_t relativelightorigin, vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist);
522 // draw depth into a shadowmap
523 void(*DrawShadowMap)(int side, struct entity_render_s *ent, const vec3_t relativelightorigin, const vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist, const unsigned char *surfacesides, const vec3_t lightmins, const vec3_t lightmaxs);
524 // gathers info on which clusters and surfaces are lit by light, as well as calculating a bounding box
525 void(*GetLightInfo)(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius, vec3_t outmins, vec3_t outmaxs, int *outleaflist, unsigned char *outleafpvs, int *outnumleafspointer, int *outsurfacelist, unsigned char *outsurfacepvs, int *outnumsurfacespointer, unsigned char *outshadowtrispvs, unsigned char *outlighttrispvs, unsigned char *visitingleafpvs, int numfrustumplanes, const mplane_t *frustumplanes, qbool noocclusion);
526 // draw the lighting on a model (through stencil)
527 void(*DrawLight)(struct entity_render_s *ent, int numsurfaces, const int *surfacelist, const unsigned char *trispvs);
528 // trace a box against this model
529 void (*TraceBox)(struct model_s *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, const vec3_t boxmins, const vec3_t boxmaxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask);
530 void (*TraceBrush)(struct model_s *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, struct colbrushf_s *start, struct colbrushf_s *end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask);
531 // trace a box against this model
532 void (*TraceLine)(struct model_s *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask);
533 // trace a point against this model (like PointSuperContents)
534 void (*TracePoint)(struct model_s *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask);
535 // find the supercontents value at a point in this model
536 int (*PointSuperContents)(struct model_s *model, int frame, const vec3_t point);
537 // trace a line against geometry in this model and report correct texture (used by r_shadow_bouncegrid)
538 void (*TraceLineAgainstSurfaces)(struct model_s *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask);
539 // fields belonging to some types of model
544 // flags this model for offseting sounds to the model center (used by brush models)
546
547 // if set, the model contains light information (lightmap, or vertexlight)
550
552}
553model_t;
554
555//============================================================================
556
557// model loading
558extern model_t *loadmodel;
559extern unsigned char *mod_base;
560
561typedef struct modloader_s
562{
563 const char *extension;
564 const char *header;
565 size_t headersize; // The header might not be NULL terminated
566 void (*Load)(model_t *, void *, void *);
568
569// sky/water subdivision
570//extern struct cvar_s gl_subdivide_size;
571// texture fullbrights
572extern struct cvar_s r_fullbrights;
573
574extern struct cvar_s mod_noshader_default_offsetmapping;
575extern struct cvar_s mod_q3shader_default_offsetmapping;
577extern struct cvar_s mod_q3shader_default_offsetmapping_bias;
578extern struct cvar_s mod_q3shader_default_polygonoffset;
579extern struct cvar_s mod_q3shader_default_polygonfactor;
580extern struct cvar_s mod_q3shader_default_refractive_index;
581extern struct cvar_s mod_q3shader_force_addalpha;
582extern struct cvar_s mod_q3shader_force_terrain_alphaflag;
583extern struct cvar_s mod_q3bsp_lightgrid_texture;
584extern struct cvar_s mod_q3bsp_lightgrid_world_surfaces;
585extern struct cvar_s mod_q3bsp_lightgrid_bsp_surfaces;
586
587void Mod_Init (void);
588void Mod_Reload (void);
590model_t *Mod_FindName (const char *name, const char *parentname);
591model_t *Mod_ForName (const char *name, qbool crash, qbool checkdisk, const char *parentname);
593
594void Mod_ClearUsed(void);
595void Mod_PurgeUnused(void);
596void Mod_RemoveStaleWorldModels(model_t *skip); // only used during loading!
597
599extern char loadname[32]; // for hunk tags
600
601int Mod_BuildVertexRemapTableFromElements(int numelements, const int *elements, int numvertices, int *remapvertices);
602void Mod_BuildNormals(int firstvertex, int numvertices, int numtriangles, const float *vertex3f, const int *elements, float *normal3f, qbool areaweighting);
603void Mod_BuildTextureVectorsFromNormals(int firstvertex, int numvertices, int numtriangles, const float *vertex3f, const float *texcoord2f, const float *normal3f, const int *elements, float *svector3f, float *tvector3f, qbool areaweighting);
604
605qbool Mod_ValidateElements(int *element3i, unsigned short *element3s, int numtriangles, int firstvertex, int numvertices, const char *filename, int fileline);
606void Mod_AllocSurfMesh(struct mempool_s *mempool, int numvertices, int numtriangles, qbool lightmapoffsets, qbool vertexcolors);
608
609// called specially by brush model loaders before generating submodels
610// automatically called after model loader returns
611void Mod_BuildVBOs(void);
612
617
618shadowmesh_t *Mod_ShadowMesh_Alloc(struct mempool_s *mempool, int maxverts, int maxtriangles);
619int Mod_ShadowMesh_AddVertex(shadowmesh_t *mesh, const float *vertex3f);
620void Mod_ShadowMesh_AddMesh(shadowmesh_t *mesh, const float *vertex3f, int numtris, const int *element3i);
621shadowmesh_t *Mod_ShadowMesh_Begin(struct mempool_s *mempool, int maxverts, int maxtriangles);
623void Mod_ShadowMesh_CalcBBox(shadowmesh_t *firstmesh, vec3_t mins, vec3_t maxs, vec3_t center, float *radius);
625
627
628void Mod_FreeQ3Shaders(void);
629void Mod_LoadQ3Shaders(void);
630shader_t *Mod_LookupQ3Shader(const char *name);
631qbool Mod_LoadTextureFromQ3Shader(struct mempool_s *mempool, const char *modelname, texture_t *texture, const char *name, qbool warnmissing, qbool fallback, int defaulttexflags, int defaultmaterialflags);
632texture_shaderpass_t *Mod_CreateShaderPass(struct mempool_s *mempool, struct skinframe_s *skinframe);
633texture_shaderpass_t *Mod_CreateShaderPassFromQ3ShaderLayer(struct mempool_s *mempool, const char *modelname, q3shaderinfo_layer_t *layer, int layerindex, int texflags, const char *texturename);
635void Mod_LoadCustomMaterial(struct mempool_s *mempool, texture_t *texture, const char *name, int supercontents, int materialflags, struct skinframe_s *skinframe);
638
639extern struct cvar_s r_mipskins;
640extern struct cvar_s r_mipnormalmaps;
641
642typedef struct skinfileitem_s
643{
644 struct skinfileitem_s *next;
646 char replacement[MAX_QPATH];
647}
649
650typedef struct skinfile_s
651{
652 struct skinfile_s *next;
654}
656
658void Mod_FreeSkinFiles(skinfile_t *skinfile);
659int Mod_CountSkinFiles(skinfile_t *skinfile);
660void Mod_BuildAliasSkinsFromSkinFiles(texture_t *skin, skinfile_t *skinfile, const char *meshname, const char *shadername);
661
662void Mod_SnapVertices(int numcomponents, int numvertices, float *vertices, float snap);
663int Mod_RemoveDegenerateTriangles(int numtriangles, const int *inelement3i, int *outelement3i, const float *vertex3f);
664void Mod_VertexRangeFromElements(int numelements, const int *elements, int *firstvertexpointer, int *lastvertexpointer);
665
666typedef struct mod_alloclightmap_row_s
667{
668 int rowY;
670}
672
673typedef struct mod_alloclightmap_state_s
674{
675 int width;
679}
681
682void Mod_AllocLightmap_Init(mod_alloclightmap_state_t *state, struct mempool_s *mempool, int width, int height);
685qbool Mod_AllocLightmap_Block(mod_alloclightmap_state_t *state, int blockwidth, int blockheight, int *outx, int *outy);
686
687// bsp models
688void Mod_BrushInit(void);
689// used for talking to the QuakeC mainly
690int Mod_Q1BSP_NativeContentsFromSuperContents(int supercontents);
691int Mod_Q1BSP_SuperContentsFromNativeContents(int nativecontents);
692// used for loading wal files in Mod_LoadTextureFromQ3Shader
693int Mod_Q2BSP_SuperContentsFromNativeContents(int nativecontents);
694int Mod_Q2BSP_NativeContentsFromSuperContents(int supercontents);
695
696// a lot of model formats use the Q1BSP code, so here are the prototypes...
697struct entity_render_s;
698void R_Mod_DrawAddWaterPlanes(struct entity_render_s *ent);
699void R_Mod_DrawSky(struct entity_render_s *ent);
700void R_Mod_Draw(struct entity_render_s *ent);
701void R_Mod_DrawDepth(struct entity_render_s *ent);
702void R_Mod_DrawDebug(struct entity_render_s *ent);
703void R_Mod_DrawPrepass(struct entity_render_s *ent);
704void R_Mod_GetLightInfo(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius, vec3_t outmins, vec3_t outmaxs, int *outleaflist, unsigned char *outleafpvs, int *outnumleafspointer, int *outsurfacelist, unsigned char *outsurfacepvs, int *outnumsurfacespointer, unsigned char *outshadowtrispvs, unsigned char *outlighttrispvs, unsigned char *visitingleafpvs, int numfrustumplanes, const mplane_t *frustumplanes, qbool noocclusion);
705void R_Mod_CompileShadowMap(struct entity_render_s *ent, vec3_t relativelightorigin, vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist);
706void R_Mod_DrawShadowMap(int side, struct entity_render_s *ent, const vec3_t relativelightorigin, const vec3_t relativelightdirection, float lightradius, int modelnumsurfaces, const int *modelsurfacelist, const unsigned char *surfacesides, const vec3_t lightmins, const vec3_t lightmaxs);
707void R_Mod_DrawLight(struct entity_render_s *ent, int numsurfaces, const int *surfacelist, const unsigned char *trispvs);
708
709// dynamic mesh building (every frame) for debugging and other uses
710void Mod_Mesh_Create(model_t *mod, const char *name);
713texture_t *Mod_Mesh_GetTexture(model_t *mod, const char *name, int defaultdrawflags, int defaulttexflags, int defaultmaterialflags);
714msurface_t *Mod_Mesh_AddSurface(model_t *mod, texture_t *tex, qbool batchwithprevioussurface);
715int Mod_Mesh_IndexForVertex(model_t *mod, msurface_t *surf, float x, float y, float z, float nx, float ny, float nz, float s, float t, float u, float v, float r, float g, float b, float a);
716void Mod_Mesh_AddTriangle(model_t *mod, msurface_t *surf, int e0, int e1, int e2);
719
720// Collision optimization using Bounding Interval Hierarchy
721void Mod_CollisionBIH_TracePoint(model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask);
722void Mod_CollisionBIH_TraceLine(model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask);
723void Mod_CollisionBIH_TraceBox(model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, const vec3_t boxmins, const vec3_t boxmaxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask);
724void Mod_CollisionBIH_TraceBrush(model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, struct colbrushf_s *start, struct colbrushf_s *end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask);
725void Mod_CollisionBIH_TracePoint_Mesh(model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask);
726qbool Mod_CollisionBIH_TraceLineOfSight(struct model_s *model, const vec3_t start, const vec3_t end, const vec3_t acceptmins, const vec3_t acceptmaxs);
727int Mod_CollisionBIH_PointSuperContents(struct model_s *model, int frame, const vec3_t point);
728int Mod_CollisionBIH_PointSuperContents_Mesh(struct model_s *model, int frame, const vec3_t point);
729bih_t *Mod_MakeCollisionBIH(model_t *model, qbool userendersurfaces, bih_t *out);
730
731// alias models
732struct frameblend_s;
733struct skeleton_s;
734void Mod_AliasInit(void);
735int Mod_Alias_GetTagMatrix(const model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, int tagindex, matrix4x4_t *outmatrix);
736int Mod_Alias_GetTagIndexForName(const model_t *model, unsigned int skin, const char *tagname);
737int Mod_Alias_GetExtendedTagInfoForIndex(const model_t *model, unsigned int skin, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, int tagindex, int *parentindex, const char **tagname, matrix4x4_t *tag_localmatrix);
738
739void Mod_Skeletal_FreeBuffers(void);
740
741// sprite models
742void Mod_SpriteInit(void);
743
744// loaders
745void Mod_2PSB_Load(model_t *mod, void *buffer, void *bufferend);
746void Mod_BSP2_Load(model_t *mod, void *buffer, void *bufferend);
747void Mod_HLBSP_Load(model_t *mod, void *buffer, void *bufferend);
748void Mod_Q1BSP_Load(model_t *mod, void *buffer, void *bufferend);
749void Mod_IBSP_Load(model_t *mod, void *buffer, void *bufferend);
750void Mod_VBSP_Load(model_t *mod, void *buffer, void *bufferend);
751void Mod_MAP_Load(model_t *mod, void *buffer, void *bufferend);
752void Mod_OBJ_Load(model_t *mod, void *buffer, void *bufferend);
753void Mod_IDP0_Load(model_t *mod, void *buffer, void *bufferend);
754void Mod_IDP2_Load(model_t *mod, void *buffer, void *bufferend);
755void Mod_IDP3_Load(model_t *mod, void *buffer, void *bufferend);
756void Mod_ZYMOTICMODEL_Load(model_t *mod, void *buffer, void *bufferend);
757void Mod_DARKPLACESMODEL_Load(model_t *mod, void *buffer, void *bufferend);
758void Mod_PSKMODEL_Load(model_t *mod, void *buffer, void *bufferend);
759void Mod_IDSP_Load(model_t *mod, void *buffer, void *bufferend);
760void Mod_IDS2_Load(model_t *mod, void *buffer, void *bufferend);
761void Mod_INTERQUAKEMODEL_Load(model_t *mod, void *buffer, void *bufferend);
762
763#endif // MODEL_SHARED_H
764
#define MAXLIGHTMAPS
Definition bspfile.h:282
float mod(float dividend, float divisor)
vector mins
void() predraw
float skin
vector maxs
string model
float frame
static int(ZEXPORT *qz_inflate)(z_stream *strm
GLubyte GLubyte GLubyte z
Definition glquake.h:782
GLenum GLenum GLuint texture
Definition glquake.h:613
GLenum GLsizei width
Definition glquake.h:622
GLenum GLsizei GLsizei height
Definition glquake.h:622
GLenum GLenum GLuint GLint GLint layer
Definition glquake.h:615
GLuint buffer
Definition glquake.h:630
const GLdouble * v
Definition glquake.h:762
GLint GLenum GLint GLint y
Definition glquake.h:651
GLint GLenum GLint x
Definition glquake.h:651
const GLchar * name
Definition glquake.h:601
GLuint index
Definition glquake.h:629
void crash(void)
void Mod_Reload(void)
void Mod_CollisionBIH_TraceLine(model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask)
void R_Mod_CompileShadowMap(struct entity_render_s *ent, vec3_t relativelightorigin, vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist)
void Mod_CollisionBIH_TraceBox(model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, const vec3_t boxmins, const vec3_t boxmaxs, const vec3_t end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask)
void Mod_ClearUsed(void)
synctype_t
@ ST_RAND
@ ST_SYNC
void Mod_AliasInit(void)
shader_t * Mod_LookupQ3Shader(const char *name)
void Mod_Mesh_Create(model_t *mod, const char *name)
void Mod_Mesh_Reset(model_t *mod)
struct cvar_s mod_q3shader_default_offsetmapping_bias
Definition model_brush.c:54
void Mod_AllocLightmap_Reset(mod_alloclightmap_state_t *state)
void Mod_BuildAliasSkinsFromSkinFiles(texture_t *skin, skinfile_t *skinfile, const char *meshname, const char *shadername)
struct cvar_s mod_q3shader_force_addalpha
Definition model_brush.c:58
int Mod_Q1BSP_SuperContentsFromNativeContents(int nativecontents)
msurface_t * Mod_Mesh_AddSurface(model_t *mod, texture_t *tex, qbool batchwithprevioussurface)
void Mod_ZYMOTICMODEL_Load(model_t *mod, void *buffer, void *bufferend)
void Mod_LoadCustomMaterial(struct mempool_s *mempool, texture_t *texture, const char *name, int supercontents, int materialflags, struct skinframe_s *skinframe)
Sets up a material to render the provided skinframe. See also R_SkinFrame_LoadInternalBGRA.
void Mod_AllocLightmap_Free(mod_alloclightmap_state_t *state)
int Mod_Mesh_IndexForVertex(model_t *mod, msurface_t *surf, float x, float y, float z, float nx, float ny, float nz, float s, float t, float u, float v, float r, float g, float b, float a)
void Mod_ShadowMesh_CalcBBox(shadowmesh_t *firstmesh, vec3_t mins, vec3_t maxs, vec3_t center, float *radius)
void Mod_OBJ_Load(model_t *mod, void *buffer, void *bufferend)
skinfile_t * Mod_LoadSkinFiles(void)
void R_Mod_DrawDepth(struct entity_render_s *ent)
void Mod_BuildNormals(int firstvertex, int numvertices, int numtriangles, const float *vertex3f, const int *elements, float *normal3f, qbool areaweighting)
void Mod_Mesh_Validate(model_t *mod)
model_t * Mod_ForName(const char *name, qbool crash, qbool checkdisk, const char *parentname)
void Mod_ShadowMesh_Free(shadowmesh_t *mesh)
struct cvar_s mod_q3shader_default_offsetmapping
Definition model_brush.c:52
texture_t * Mod_Mesh_GetTexture(model_t *mod, const char *name, int defaultdrawflags, int defaulttexflags, int defaultmaterialflags)
struct cvar_s mod_noshader_default_offsetmapping
Definition model_brush.c:51
int Mod_Alias_GetExtendedTagInfoForIndex(const model_t *model, unsigned int skin, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, int tagindex, int *parentindex, const char **tagname, matrix4x4_t *tag_localmatrix)
struct cvar_s r_fullbrights
Definition gl_rmain.c:122
void Mod_Mesh_AddTriangle(model_t *mod, msurface_t *surf, int e0, int e1, int e2)
void Mod_PurgeUnused(void)
void Mod_IDSP_Load(model_t *mod, void *buffer, void *bufferend)
struct cvar_s mod_q3bsp_lightgrid_bsp_surfaces
Definition model_brush.c:50
void Mod_BrushInit(void)
Definition model_brush.c:80
int Mod_CountSkinFiles(skinfile_t *skinfile)
void Mod_SpriteInit(void)
int Mod_Q1BSP_NativeContentsFromSuperContents(int supercontents)
void Mod_PSKMODEL_Load(model_t *mod, void *buffer, void *bufferend)
int Mod_BuildVertexRemapTableFromElements(int numelements, const int *elements, int numvertices, int *remapvertices)
void Mod_HLBSP_Load(model_t *mod, void *buffer, void *bufferend)
model_t * loadmodel
void R_Mod_DrawSky(struct entity_render_s *ent)
void Mod_CollisionBIH_TraceBrush(model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, struct colbrushf_s *start, struct colbrushf_s *end, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask)
void Mod_RemoveStaleWorldModels(model_t *skip)
struct cvar_s r_mipnormalmaps
int Mod_ShadowMesh_AddVertex(shadowmesh_t *mesh, const float *vertex3f)
void R_Mod_DrawLight(struct entity_render_s *ent, int numsurfaces, const int *surfacelist, const unsigned char *trispvs)
shadowmesh_t * Mod_ShadowMesh_Alloc(struct mempool_s *mempool, int maxverts, int maxtriangles)
qbool Mod_CollisionBIH_TraceLineOfSight(struct model_s *model, const vec3_t start, const vec3_t end, const vec3_t acceptmins, const vec3_t acceptmaxs)
void Mod_Skeletal_FreeBuffers(void)
Definition model_alias.c:46
void R_Mod_GetLightInfo(struct entity_render_s *ent, vec3_t relativelightorigin, float lightradius, vec3_t outmins, vec3_t outmaxs, int *outleaflist, unsigned char *outleafpvs, int *outnumleafspointer, int *outsurfacelist, unsigned char *outsurfacepvs, int *outnumsurfacespointer, unsigned char *outshadowtrispvs, unsigned char *outlighttrispvs, unsigned char *visitingleafpvs, int numfrustumplanes, const mplane_t *frustumplanes, qbool noocclusion)
void Mod_IBSP_Load(model_t *mod, void *buffer, void *bufferend)
int Mod_Q2BSP_SuperContentsFromNativeContents(int nativecontents)
void R_Mod_DrawPrepass(struct entity_render_s *ent)
void Mod_Mesh_Destroy(model_t *mod)
struct cvar_s mod_q3shader_default_refractive_index
Definition model_brush.c:57
void Mod_BuildVBOs(void)
void Mod_INTERQUAKEMODEL_Load(model_t *mod, void *buffer, void *bufferend)
void R_Mod_DrawDebug(struct entity_render_s *ent)
qbool Mod_AllocLightmap_Block(mod_alloclightmap_state_t *state, int blockwidth, int blockheight, int *outx, int *outy)
void Mod_CollisionBIH_TracePoint(model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask)
char loadname[32]
struct cvar_s mod_q3bsp_lightgrid_texture
Definition model_brush.c:48
void Mod_SnapVertices(int numcomponents, int numvertices, float *vertices, float snap)
int Mod_RemoveDegenerateTriangles(int numtriangles, const int *inelement3i, int *outelement3i, const float *vertex3f)
model_t * Mod_FindName(const char *name, const char *parentname)
void Mod_IDP0_Load(model_t *mod, void *buffer, void *bufferend)
shadowmesh_t * Mod_ShadowMesh_Begin(struct mempool_s *mempool, int maxverts, int maxtriangles)
struct cvar_s mod_q3shader_force_terrain_alphaflag
Definition model_brush.c:59
qbool Mod_LoadTextureFromQ3Shader(struct mempool_s *mempool, const char *modelname, texture_t *texture, const char *name, qbool warnmissing, qbool fallback, int defaulttexflags, int defaultmaterialflags)
unsigned char * mod_base
void Mod_BuildTextureVectorsFromNormals(int firstvertex, int numvertices, int numtriangles, const float *vertex3f, const float *texcoord2f, const float *normal3f, const int *elements, float *svector3f, float *tvector3f, qbool areaweighting)
void Mod_FreeSkinFiles(skinfile_t *skinfile)
void Mod_MakeSortedSurfaces(model_t *mod)
void Mod_2PSB_Load(model_t *mod, void *buffer, void *bufferend)
void Mod_AllocLightmap_Init(mod_alloclightmap_state_t *state, struct mempool_s *mempool, int width, int height)
void Mod_CreateCollisionMesh(model_t *mod)
struct cvar_s mod_q3shader_default_polygonoffset
Definition model_brush.c:56
struct cvar_s r_mipskins
struct cvar_s mod_q3bsp_lightgrid_world_surfaces
Definition model_brush.c:49
void Mod_UnloadModel(model_t *mod)
void Mod_ShadowMesh_AddMesh(shadowmesh_t *mesh, const float *vertex3f, int numtris, const int *element3i)
int Mod_CollisionBIH_PointSuperContents(struct model_s *model, int frame, const vec3_t point)
void Mod_VBSP_Load(model_t *mod, void *buffer, void *bufferend)
int Mod_Q2BSP_NativeContentsFromSuperContents(int supercontents)
void Mod_FreeQ3Shaders(void)
qbool Mod_ValidateElements(int *element3i, unsigned short *element3s, int numtriangles, int firstvertex, int numvertices, const char *filename, int fileline)
bih_t * Mod_MakeCollisionBIH(model_t *model, qbool userendersurfaces, bih_t *out)
void Mod_Q1BSP_Load(model_t *mod, void *buffer, void *bufferend)
model_t * Mod_LoadModel(model_t *mod, qbool crash, qbool checkdisk)
int Mod_Alias_GetTagIndexForName(const model_t *model, unsigned int skin, const char *tagname)
void Mod_IDP3_Load(model_t *mod, void *buffer, void *bufferend)
int Mod_Alias_GetTagMatrix(const model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, int tagindex, matrix4x4_t *outmatrix)
void R_Mod_DrawShadowMap(int side, struct entity_render_s *ent, const vec3_t relativelightorigin, const vec3_t relativelightdirection, float lightradius, int modelnumsurfaces, const int *modelsurfacelist, const unsigned char *surfacesides, const vec3_t lightmins, const vec3_t lightmaxs)
void Mod_AllocSurfMesh(struct mempool_s *mempool, int numvertices, int numtriangles, qbool lightmapoffsets, qbool vertexcolors)
void Mod_BSP2_Load(model_t *mod, void *buffer, void *bufferend)
void Mod_Mesh_Finalize(model_t *mod)
void Mod_LoadQ3Shaders(void)
void Mod_UnloadCustomMaterial(texture_t *texture, qbool purgeskins)
Removes all shaderpasses from material, and optionally deletes the textures in the skinframes.
void R_Mod_Draw(struct entity_render_s *ent)
void Mod_DARKPLACESMODEL_Load(model_t *mod, void *buffer, void *bufferend)
struct cvar_s mod_q3shader_default_offsetmapping_scale
Definition model_brush.c:53
modtype_t
@ mod_invalid
@ mod_obj
@ mod_null
@ mod_brushq3
@ mod_brushq2
@ mod_brushq1
@ mod_alias
@ mod_brushhl2
@ mod_sprite
void Mod_MAP_Load(model_t *mod, void *buffer, void *bufferend)
texture_shaderpass_t * Mod_CreateShaderPass(struct mempool_s *mempool, struct skinframe_s *skinframe)
struct cvar_s mod_q3shader_default_polygonfactor
Definition model_brush.c:55
void Mod_VertexRangeFromElements(int numelements, const int *elements, int *firstvertexpointer, int *lastvertexpointer)
int Mod_CollisionBIH_PointSuperContents_Mesh(struct model_s *model, int frame, const vec3_t point)
shadowmesh_t * Mod_ShadowMesh_Finish(shadowmesh_t *firstmesh, qbool createvbo)
void Mod_IDS2_Load(model_t *mod, void *buffer, void *bufferend)
void Mod_SetDrawSkyAndWater(model_t *mod)
Sets the mod->DrawSky and mod->DrawAddWaterPlanes pointers conditionally based on whether surfaces in...
void Mod_CollisionBIH_TracePoint_Mesh(model_t *model, const struct frameblend_s *frameblend, const struct skeleton_s *skeleton, struct trace_s *trace, const vec3_t start, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask)
void R_Mod_DrawAddWaterPlanes(struct entity_render_s *ent)
texture_shaderpass_t * Mod_CreateShaderPassFromQ3ShaderLayer(struct mempool_s *mempool, const char *modelname, q3shaderinfo_layer_t *layer, int layerindex, int texflags, const char *texturename)
void Mod_IDP2_Load(model_t *mod, void *buffer, void *bufferend)
void Mod_Init(void)
#define MAX_QPATH
max length of a quake game pathname
Definition qdefs.h:169
vec_t vec3_t[3]
Definition qtypes.h:71
bool qbool
Definition qtypes.h:9
vec_t vec4_t[4]
Definition qtypes.h:72
#define RESTRICT
Definition qtypes.h:27
#define Q3MAXDEFORMS
Definition r_qshader.h:27
#define Q3SHADER_MAXLAYERS
Definition r_qshader.h:21
dptransparentsortcategory_t
Definition r_qshader.h:192
dpoffsetmapping_technique_t
Definition r_qshader.h:184
dp_FragColor r
dp_FragColor g
dp_FragColor b
ret a
float framerate
Definition bih.h:70
mod_alloclightmap_row_t * rows
model_brush_t brush
float radius2
model_sprite_t sprite
modtype_t type
float * data_baseboneposeinverse
surfmesh_t surfmesh
int num_tagframes
qbool loaded
int firstmodelbrush
unsigned effects
qbool lit
vec3_t yawmaxs
int * modelsurfaces_sorted
surface indices of model in an optimal draw order (submodelindex -> texture -> lightmap -> index)
bih_t collision_bih
qbool wanttangents
int submodelsurfaces_end
vec3_t rotatedmaxs
msurface_t * data_surfaces
float num_posescale
float radius
msurface_lightmapinfo_t * data_surfaces_lightmapinfo
int submodelsurfaces_start
qbool nolerp
model_brushq3_t brushq3
model_brushq1_t brushq1
synctype_t synctype
vec3_t normalmaxs
rtexturepool_t * texturepool
float lightmapscale
int num_poses
animscene_t * animscenes
struct mempool_s * mempool
unsigned int crc
int nummodelbrushes
bih_t render_bih
int numframes
qbool used
float num_poseinvscale
int soundfromcenter
int num_surfaces
int num_textures
const char * modeldatatypestring
texture_t * data_textures
aliasbone_t * data_bones
int max_surfaces
animscene_t * skinscenes
short * data_poses7s
int max_textures
int num_texturesperskin
int num_bones
aliastag_t * data_tags
qbool wantnormals
const char * header
const char * extension
size_t headersize
unsigned char * stainsamples
unsigned char * samples
unsigned char * nmapsamples
describes the textures to use on a range of triangles in the model, and mins/maxs (AABB) for culling.
int num_collisiontriangles
msurface_lightmapinfo_t * lightmapinfo
lightmaptexture rebuild information not used in q3bsp
int num_firsttriangle
int num_triangles
range of triangles and vertices in model->surfmesh
int num_firstcollisiontriangle
mesh information for collisions (only used by q3bsp curves)
texture_t * texture
the texture to use on the surface
int num_firstvertex
vec3_t mins
bounding box for onscreen checks
struct q3deffect_s * effect
fog volume info in q3bsp
int num_collisionvertices
struct rtexture_s * deluxemaptexture
the lighting direction texture fragment to use on the rendering mesh
struct rtexture_s * lightmaptexture
the lightmap texture fragment to use on the rendering mesh
qbool isuniformbuffer
void * devicebuffer
int element3s_bufferoffset
int element3i_bufferoffset
r_meshbuffer_t * element3s_indexbuffer
struct mempool_s * mempool
r_meshbuffer_t * vbo_vertexbuffer
float * vertex3f
r_meshbuffer_t * element3i_indexbuffer
unsigned short * element3s
shadowmeshvertexhash_t * vertexhashentries
struct shadowmeshvertexhash_s * next
struct skinfile_s * next
skinfileitem_t * items
struct skinfileitem_s * next
r_meshbuffer_t * data_svector3f_vertexbuffer
int data_normal3f_bufferoffset
int data_element3s_bufferoffset
struct texvecvertex_s * data_morphtexvecvertex
int data_skeletalweight4ub_bufferoffset
r_meshbuffer_t * data_lightmapcolor4f_vertexbuffer
r_meshbuffer_t * data_normal3f_vertexbuffer
int data_element3i_bufferoffset
int data_texcoordlightmap2f_bufferoffset
qbool isanimated
int * data_vertexhash
int data_skeletalindex4ub_bufferoffset
int data_svector3f_bufferoffset
float * data_lightmapcolor4f
unsigned char * data_skeletalweight4ub
float * data_svector3f
unsigned char * data_skeletalindex4ub
int * data_element3i
unsigned short * data_element3s
r_meshbuffer_t * data_texcoordtexture2f_vertexbuffer
r_meshbuffer_t * data_skeletalindex4ub_vertexbuffer
float * data_vertex3f
r_meshbuffer_t * data_tvector3f_vertexbuffer
struct trivertx_s * data_morphmdlvertex
r_meshbuffer_t * data_element3i_indexbuffer
float * data_tvector3f
struct blendweights_s * data_blendweights
int * data_lightmapoffsets
float * data_morphmd2framesize6f
int num_vertexhashsize
int data_texcoordtexture2f_bufferoffset
int num_triangles
int data_tvector3f_bufferoffset
int num_morphframes
struct md3vertex_s * data_morphmd3vertex
r_meshbuffer_t * data_texcoordlightmap2f_vertexbuffer
unsigned short * blends
r_meshbuffer_t * data_skeletalweight4ub_vertexbuffer
int data_vertex3f_bufferoffset
int data_lightmapcolor4f_bufferoffset
float * data_texcoordtexture2f
r_meshbuffer_t * data_element3s_indexbuffer
float * data_normal3f
float * data_texcoordlightmap2f
r_meshbuffer_t * data_vertex3f_vertexbuffer
float specularpower
struct skinframe_s * backgroundcurrentskinframe
struct rtexture_s * basetexture
matrix4x4_t currenttexmatrix
qbool colormapping
struct rtexture_s * glosstexture
float refractfactor
dptransparentsortcategory_t transparentsort
struct rtexture_s * nmaptexture
dpoffsetmapping_technique_t offsetmapping
struct rtexture_s * backgroundglosstexture
struct rtexture_s * backgroundbasetexture
int currentmaterialflags
texture_shaderpass_t * backgroundshaderpass
int camera_entity
void * update_lastrenderentity
float biaspolygonoffset
float basealpha
struct rtexture_s * shirttexture
struct rtexture_s * pantstexture
float specularpowermod
int basematerialflags
struct texture_s * currentframe
float reflectmin
float rtlightambient
struct rtexture_s * glowtexture
int update_lastrenderframe
vec4_t refractcolor4f
struct rtexture_s * backgroundglowtexture
unsigned char endpreshaderpass
struct rtexture_s * reflectmasktexture
matrix4x4_t currentbackgroundtexmatrix
struct rtexture_s * fogtexture
struct rtexture_s * reflectcubetexture
float reflectmax
int mesh_drawflag
struct texture_s * skynoshadowtexture
this points to a variant of the sky texture that has MATERIALFLAG_NOSHADOW, for the e1m5 logo shadow ...
int supercontents
float offsetscale
float refractive_index
texture_shaderpass_t * materialshaderpass
unsigned int height
int mesh_defaulttexflags
unsigned char endpostshaderpass
float r_water_wateralpha
float specularscalemod
float reflectfactor
struct rtexture_s * backgroundnmaptexture
float offsetbias
float currentalpha
float biaspolygonfactor
unsigned char startpostshaderpass
struct skinframe_s * currentskinframe
unsigned char startpreshaderpass
int mesh_defaultmaterialflags
vec4_t reflectcolor4f