FTEQW
Documentation of the FTE engine source tree.
gl_terrain.h
Go to the documentation of this file.
1#ifdef TERRAIN
2
3//#define STRICTEDGES //strict (ugly) grid
4#define TERRAINTHICKNESS 16
5#define TERRAINACTIVESECTIONS 3000
6
7/*
8a note on networking:
9By default terrain is NOT networked. This means content is loaded without networking delays.
10If you wish to edit the terrain collaboratively, you can enable the mod_terrain_networked cvar.
11When set, changes on the server will notify clients that a section has changed, and the client will reload it as needed.
12Changes on the client WILL NOT notify the server, and will get clobbered if the change is also made on the server.
13This means for editing purposes, you MUST funnel it via ssqc with your own permission checks.
14It also means for explosions and local stuff, the server will merely restate changes from impacts if you do them early. BUT DO NOT CALL THE EDIT FUNCTION IF THE SERVER HAS ALREADY APPLIED THE CHANGE.
15*/
16/*
17terminology:
18tile:
19 a single grid tile of 2*2 height samples.
20 iterrated for collisions but otherwise unused.
21section:
22 16*16 tiles, with a single texture spread over them.
23 samples have an overlap with the neighbouring section (so 17*17 height samples). texture samples do not quite match height frequency (63*63 vs 16*16).
24 smallest unit for culling.
25block:
26 16*16 sections. forms a single disk file. used only to avoid 16777216 files in a single directory, instead getting 65536 files for a single fully populated map... much smaller...
27 each block file is about 4mb each. larger can be detrimental to automatic downloads.
28cluster:
29 64*64 sections
30 internal concept to avoid a single pointer array of 16 million entries per terrain.
31*/
32
33int Surf_NewLightmaps(int count, int width, int height, uploadfmt_t fmt, qboolean deluxe);
34
35#define MAXCLUSTERS 64
36#define MAXSECTIONS 64 //this many sections within each cluster in each direction
37#define SECTHEIGHTSIZE 17 //this many height samples per section (one for overlap)
38#define SECTTEXSIZE 64 //this many texture samples per section (one for overlap, yes, this is a little awkward)
39#define SECTIONSPERBLOCK 16
40
41//each section is this many sections higher in world space, to keep the middle centered at '0 0'
42#define CHUNKBIAS (MAXCLUSTERS*MAXSECTIONS/2)
43#define CHUNKLIMIT (MAXCLUSTERS*MAXSECTIONS)
44
45#define LMCHUNKS 8//(LMBLOCK_WIDTH/SECTTEXSIZE) //FIXME: make dynamic.
46#define HMLMSTRIDE (LMCHUNKS*SECTTEXSIZE)
47
48#define SECTION_MAGIC (*(int*)"HMMS")
49#define SECTION_VER_DEFAULT 1
50/*simple version history:
51ver=0
52 SECTHEIGHTSIZE=16
53ver=1
54 SECTHEIGHTSIZE=17 (oops, makes holes more usable)
55 (holes in this format are no longer supported)
56ver=2
57 uses deltas instead of absolute values
58 variable length image names
59*/
60
61#define TGS_NOLOAD 0
62#define TGS_LAZYLOAD 1 //see if its available, if not, queue it. don't create too much work at once. peace man
63#define TGS_TRYLOAD 2 //try and get it, but don't stress if its not available yet
64#define TGS_WAITLOAD 4 //load it, wait for it if needed.
65#define TGS_ANYSTATE 8 //returns the section regardless of its current state, even if its loading.
66#define TGS_NODOWNLOAD 16 //don't queue it for download
67#define TGS_NORENDER 32 //don't upload any textures or whatever
68#define TGS_DEFAULTONFAIL 64 //if it failed to load, generate a default anyway
69
70enum
71{
72 //these flags can be found on disk
73 TSF_HASWATER_V0 = 1u<<0, //no longer flagged.
77
78 //these flags are found only on disk
79 TSF_D_UNUSED1 = 1u<<28,
80 TSF_D_UNUSED2 = 1u<<29,
81 TSF_D_UNUSED3 = 1u<<30,
82 TSF_D_UNUSED4 = 1u<<31,
83
84 //these flags should not be found on disk
85 TSF_NOTIFY = 1u<<28, //modified on server, waiting for clients to be told about the change.
86 TSF_RELIGHT = 1u<<29, //height edited, needs relighting.
87 TSF_DIRTY = 1u<<30, //its heightmap has changed, the mesh needs rebuilding
88 TSF_EDITED = 1u<<31 //says it needs to be written if saved
89
90#define TSF_INTERNAL (TSF_RELIGHT|TSF_DIRTY|TSF_EDITED|TSF_NOTIFY)
91};
92enum
93{
94 TMF_SCALE = 1u<<0,
95 //what else do we want? alpha? colormod perhaps?
96};
97
98typedef struct
99{
100 int size;
101 vec3_t axisorg[4];
102 float scale;
106 //char modelname[1+];
108
109typedef struct
110{
111 unsigned int flags;
112 char texname[4][32];
113 unsigned int texmap[SECTTEXSIZE][SECTTEXSIZE];
114 float heights[SECTHEIGHTSIZE*SECTHEIGHTSIZE];
115 unsigned short holes;
116 unsigned short reserved0;
118 float minh;
119 float maxh;
126
127//file header for a single section
128typedef struct
129{
130 int magic;
131 int ver;
132} dsection_t;
133
134//file header for a block of sections.
135//(because 16777216 files in a single directory is a bad plan. windows really doesn't like it.)
136typedef struct
137{
138 //a block is a X*Y group of sections
139 //if offset==0, the section isn't present.
140 //the data length of the section preceeds the actual data.
141 int magic;
142 int ver;
143 unsigned int offset[SECTIONSPERBLOCK*SECTIONSPERBLOCK];
144} dblock_t;
145
146typedef struct hmpolyset_s
147{
155{
157 unsigned int contentmask;
158 qboolean simple; //no holes, one height
161 char shadername[MAX_QPATH];
164 float heights[9*9];
165
166/*
167 qboolean facesdown;
168 unsigned int contentmask;
169 float heights[SECTHEIGHTSIZE*SECTHEIGHTSIZE];
170#ifndef SERVERONLY
171 byte_vec4_t colours[SECTHEIGHTSIZE*SECTHEIGHTSIZE];
172 char texname[4][MAX_QPATH];
173 int lightmap;
174 int lmx, lmy;
175
176 texnums_t textures;
177 vbo_t vbo;
178 mesh_t mesh;
179 mesh_t *amesh;
180#endif
181*/
182};
183enum
184{
186 TSLS_LOADING0, //posted to a worker, but not picked up yet. this allows a single worker to generate multiple sections without fighting.
187 TSLS_LOADING1, //section is queued to the worker (and may be loaded as part of another section)
188 TSLS_LOADING2, //waiting for main thread to finish, worker will ignore
192typedef struct
193{
195 int sx, sy;
196
198 float timestamp; //don't recycle it if its still fairly recent.
199
200 float heights[SECTHEIGHTSIZE*SECTHEIGHTSIZE];
201 unsigned char holes[8];
202 unsigned int flags;
203 float maxh_cull; //includes water+mesh heights
204 float minh, maxh;
206
207 //FIXME: make layers, each with their own holes+heights+contents+textures+shader+mixes. water will presumably have specific values set for each part.
209
210 size_t traceseq;
211
212#ifndef SERVERONLY
214 vec4_t colours[SECTHEIGHTSIZE*SECTHEIGHTSIZE]; //FIXME: make bytes
215 char texname[4][MAX_QPATH]; //fixme: make path length dynamic.
217 int lmx, lmy;
218
223
225#endif
228 struct hmentity_s **ents;
230typedef struct
231{
232 hmsection_t *section[MAXSECTIONS*MAXSECTIONS];
234
235#ifndef SERVERONLY
236typedef struct brushbatch_s
237{
243 avec4_t align; //meh, cos we can.
245#endif
246typedef struct brushtex_s
247{
248 char shadername[MAX_QPATH];
249#ifndef SERVERONLY
251
252 //for rebuild performance
255
257#endif
261
262typedef struct patchtessvert_s
263{
267// vec3_t norm;
268// vec3_t sdir;
269// vec3_t tdir;
271typedef struct qcpatchvert_s
272{
277patchtessvert_t *PatchInfo_Evaluate(const qcpatchvert_t *cp, const unsigned short patch_cp[2], const short subdiv[2], unsigned short *size);
278unsigned int PatchInfo_EvaluateIndexes(const unsigned short *size, index_t *out_indexes);
279
280typedef struct
281{
282 unsigned int contents; //bitmask
283 unsigned int id; //networked/gamecode id.
284 unsigned int axialplanes; //+x,+y,+z,-x,-y,-z. used for bevel stuff.
285 unsigned int numplanes;
286 unsigned char selected:1; //different shader stuff
287 unsigned char ispatch:1; //just for parsing really
289 vec3_t mins, maxs; //for optimisation and stuff
291 { //unlit, always...
293 unsigned short numcp[2];
294 short subdiv[2]; //<0=regular q3 patch, 0=cp-only, >0=fixed-tessellation.
295
296 unsigned short tesssize[2];
297 patchtessvert_t *tessvert; //x+(y*tesssize[0])
298
299 //control points
300 qcpatchvert_t cp[1]; //x+(y*numcp[0]) extends past end of patchdata_s
301 } *patch; //if this is NULL, then its a regular brush. otherwise its a patch.
303 {
305 vec4_t stdir[2];
307 unsigned short numpoints;
308 unsigned short lmscale;
310 unsigned short lmbase[2]; //min st coord of the lightmap atlas, in texels.
311 unsigned short relight:1;
312 unsigned short relit:1;
313 int lmbias[2];
314 unsigned short lmextents[2];
315 unsigned int surfaceflags; //used by q2
316 unsigned int surfacevalue; //used by q2 (generally light levels)
318 } *faces;
319} brushes_t;
320
321typedef struct
322{
327 float sbias;
329 float tbias;
331typedef struct
332{
334 unsigned int contents;
335 unsigned int cp_width;
336 unsigned int cp_height;
337 unsigned int subdiv_x;
338 unsigned int subdiv_y;
341
342typedef struct heightmap_s
343{
344 char path[MAX_QPATH];
345 char skyname[MAX_QPATH]; //name of the skybox
346 char groundshadername[MAX_QPATH]; //this is the shader we're using to draw the terrain itself. you could use other shaders here, for eg debugging or stylised weirdness.
347 unsigned int culldistance; //entities will be culled if they're this far away (squared distance
348 float maxdrawdist; //maximum view distance. extends view if larger than fog implies.
349
350 unsigned char *seed; //used by whatever terrain generator.
351 qboolean forcedefault; //sections that cannot be loaded/generated will receive default values for stuff.
352 char defaultgroundtexture[MAX_QPATH];//texture used for defaulted sections
353 char defaultwatershader[MAX_QPATH]; //shader used for defaulted sections that have heights beneath defaultwaterheight.
354 float defaultwaterheight; //water height. if you want your islands to be surrounded by water.
355 float defaultgroundheight; //defaulted sections will have a z plane this high
356
357 int firstsegx, firstsegy; //min bounds of the terrain, in sections
358 int maxsegx, maxsegy; //max bounds of the terrain, in sections
359 float sectionsize; //each section is this big, in world coords
360 hmcluster_t *cluster[MAXCLUSTERS*MAXCLUSTERS];
365 qboolean legacyterrain; //forced exterior=SOLID
366 unsigned int exteriorcontents; //contents type outside of the terrain sections area (.map should be empty, while terrain will usually block).
367 unsigned int loadingsections; //number of sections currently being loaded. avoid loading extras while non-zero.
368 size_t traceseq;
370 enum
371 {
372 DGT_SOLID, //invalid/new areas should be completely solid until painted.
373 DGT_HOLES, //invalid/new sections should be non-solid+invisible
374 DGT_FLAT //invalid/new sections should be filled with ground by default
376 enum
377 {
381 int tilecount[2];
383
385 link_t recycle; //section list in lru order
386// link_t collected; //memory that may be reused, to avoid excess reallocs.
387
389 {
390 size_t drawnframe; //don't add it to the scene multiple times.
391 size_t traceseq; //don't trace through this entity multiple times if its in different sections.
392 int refs; //entity is free/reusable when its no longer referenced by any sections
393 entity_t ent; //note: only model+modelmatrix info is relevant. fixme: implement instancing.
394
395 struct hmentity_s *next; //used for freeing/allocating an entity
397 void *entitylock; //lock this if you're going to read/write entities of any kind.
398
399#ifndef SERVERONLY
400 unsigned int numusedlmsects; //to track leaks and stats
401 unsigned int numunusedlmsects;
402 struct lmsect_s
403 {
404 struct lmsect_s *next;
405 int lm, x, y;
407#endif
408
409#ifndef SERVERONLY
410 //I'm putting this here because we might have some quite expensive lighting routines going on
411 //and that'll make editing the terrain jerky as fook, so relighting it a few texels at a time will help maintain a framerate while editing
413 unsigned int relightidx;
415#endif
416
417
418
419 char *texmask; //for editing - visually masks off the areas which CANNOT accept this texture
420 qboolean entsdirty; //ents were edited, so we need to reload all lighting...
421 struct relight_ctx_s *relightcontext;
422 struct llightinfo_s *lightthreadmem;
427 unsigned int *brushlmremaps;
428 unsigned int brushmaxlms;
431 unsigned int numbrushes;
432 unsigned int brushidseq;
435
436typedef struct plugterrainfuncs_s
437{
438 void *(QDECL *GenerateWater) (hmsection_t *s, float maxheight);
439 qboolean (QDECL *InitLightmap) (hmsection_t *s, qboolean initialise);
440 unsigned char *(QDECL *GetLightmap) (hmsection_t *s, int idx, qboolean edit);
441 void (QDECL *AddMesh) (heightmap_t *hm, int loadflags, model_t *mod, const char *modelname, vec3_t epos, vec3_t axis[3], float scale);
442 hmsection_t *(QDECL *GetSection) (heightmap_t *hm, int x, int y, unsigned int flags);
443 int (QDECL *GenerateSections) (heightmap_t *hm, int sx, int sy, int count, hmsection_t **sects);
444 void (QDECL *FinishedSection) (hmsection_t *s, qboolean success);
445
446 qboolean (QDECL *AutogenerateSection)(heightmap_t *hm, int sx, int sy, unsigned int tgsflags); //replace this if you want to make a terrain generator.
447#define plugterrainfuncs_name "Terrain"
449#endif
qboolean
Definition: api_menu.h:34
vec_t vec3_t[3]
Definition: api_menu.h:40
vec_t vec4_t[4]
Definition: api_menu.h:41
vec_t vec2_t[2]
Definition: api_menu.h:39
unsigned int width
Definition: bymorphed.h:4
unsigned int height
Definition: bymorphed.h:5
unsigned char qbyte
Definition: common.h:127
s
Definition: execloop.h:53
int Surf_NewLightmaps(int count, int width, int height, uploadfmt_t fmt, qboolean deluxe)
Definition: r_surf.c:3524
@ TMF_SCALE
Definition: gl_terrain.h:94
struct hmpolyset_s hmpolyset_t
@ TSLS_LOADING1
Definition: gl_terrain.h:187
@ TSLS_LOADING2
Definition: gl_terrain.h:188
@ TSLS_FAILED
Definition: gl_terrain.h:190
@ TSLS_LOADING0
Definition: gl_terrain.h:186
@ TSLS_LOADED
Definition: gl_terrain.h:189
@ TSLS_NOTLOADED
Definition: gl_terrain.h:185
struct patchtessvert_s patchtessvert_t
struct brushbatch_s brushbatch_t
@ TSF_HASHEIGHTS
Definition: gl_terrain.h:75
@ TSF_D_UNUSED4
Definition: gl_terrain.h:82
@ TSF_DIRTY
Definition: gl_terrain.h:87
@ TSF_D_UNUSED2
Definition: gl_terrain.h:80
@ TSF_EDITED
Definition: gl_terrain.h:88
@ TSF_HASCOLOURS
Definition: gl_terrain.h:74
@ TSF_RELIGHT
Definition: gl_terrain.h:86
@ TSF_NOTIFY
Definition: gl_terrain.h:85
@ TSF_HASWATER_V0
Definition: gl_terrain.h:73
@ TSF_HASSHADOW
Definition: gl_terrain.h:76
@ TSF_D_UNUSED1
Definition: gl_terrain.h:79
@ TSF_D_UNUSED3
Definition: gl_terrain.h:81
struct heightmap_s heightmap_t
unsigned int PatchInfo_EvaluateIndexes(const unsigned short *size, index_t *out_indexes)
Definition: gl_q2bsp.c:680
struct plugterrainfuncs_s plugterrainfuncs_t
struct brushtex_s brushtex_t
struct qcpatchvert_s qcpatchvert_t
patchtessvert_t * PatchInfo_Evaluate(const qcpatchvert_t *cp, const unsigned short patch_cp[2], const short subdiv[2], unsigned short *size)
Definition: gl_q2bsp.c:632
GLfloat GLfloat y
Definition: glquake.h:158
GLsizei count
Definition: glquake.h:149
GLint size
Definition: glquake.h:157
GLfloat x
Definition: glquake.h:158
int idx
Definition: pr_lua.c:221
evalc_t mins
Definition: pr_menu.c:1354
puint_t string_t
Definition: progtype.h:66
vec3_t offset
Definition: q2m_flash.c:28
uploadfmt_t fmt
Definition: r_2d.c:48
unsigned short index_t
Definition: render.h:56
enum uploadfmt uploadfmt_t
Definition: gl_terrain.h:237
avec4_t align
Definition: gl_terrain.h:243
mesh_t * pmesh
Definition: gl_terrain.h:240
struct brushbatch_s * next
Definition: gl_terrain.h:242
int lightmap
Definition: gl_terrain.h:241
vbo_t vbo
Definition: gl_terrain.h:238
mesh_t mesh
Definition: gl_terrain.h:239
Definition: gl_terrain.h:303
unsigned short relit
Definition: gl_terrain.h:312
unsigned short numpoints
Definition: gl_terrain.h:307
qbyte * lightdata
Definition: gl_terrain.h:317
int lightmap
Definition: gl_terrain.h:309
brushtex_t * tex
Definition: gl_terrain.h:304
unsigned short lmscale
Definition: gl_terrain.h:308
unsigned short relight
Definition: gl_terrain.h:311
unsigned int surfaceflags
Definition: gl_terrain.h:315
unsigned int surfacevalue
Definition: gl_terrain.h:316
vec3_t * points
Definition: gl_terrain.h:306
Definition: gl_terrain.h:291
brushtex_t * tex
Definition: gl_terrain.h:292
patchtessvert_t * tessvert
Definition: gl_terrain.h:297
Definition: gl_terrain.h:281
unsigned int contents
Definition: gl_terrain.h:282
vec3_t maxs
Definition: gl_terrain.h:289
vec4_t * planes
Definition: gl_terrain.h:288
unsigned char selected
Definition: gl_terrain.h:286
unsigned int id
Definition: gl_terrain.h:283
unsigned char ispatch
Definition: gl_terrain.h:287
unsigned int numplanes
Definition: gl_terrain.h:285
unsigned int axialplanes
Definition: gl_terrain.h:284
Definition: gl_terrain.h:247
int lmcount
Definition: gl_terrain.h:254
shader_t * shader
Definition: gl_terrain.h:250
struct brushtex_s * next
Definition: gl_terrain.h:259
char shadername[MAX_QPATH]
Definition: gl_terrain.h:248
struct brushbatch_s * batches
Definition: gl_terrain.h:256
qboolean rebuild
Definition: gl_terrain.h:258
int firstlm
Definition: gl_terrain.h:253
Definition: gl_terrain.h:137
int ver
Definition: gl_terrain.h:142
int magic
Definition: gl_terrain.h:141
Definition: gl_terrain.h:129
int magic
Definition: gl_terrain.h:130
int ver
Definition: gl_terrain.h:131
Definition: gl_terrain.h:110
unsigned int flags
Definition: gl_terrain.h:111
int reserved1
Definition: gl_terrain.h:121
int ents_num
Definition: gl_terrain.h:120
float maxh
Definition: gl_terrain.h:119
int reserved4
Definition: gl_terrain.h:122
int reserved2
Definition: gl_terrain.h:124
float minh
Definition: gl_terrain.h:118
unsigned short reserved0
Definition: gl_terrain.h:116
float waterheight
Definition: gl_terrain.h:117
int reserved3
Definition: gl_terrain.h:123
unsigned short holes
Definition: gl_terrain.h:115
Definition: gl_terrain.h:99
int size
Definition: gl_terrain.h:100
int reserved2
Definition: gl_terrain.h:104
int reserved3
Definition: gl_terrain.h:103
int reserved1
Definition: gl_terrain.h:105
float scale
Definition: gl_terrain.h:102
Definition: render.h:99
Definition: gl_terrain.h:389
entity_t ent
Definition: gl_terrain.h:393
size_t traceseq
Definition: gl_terrain.h:391
struct hmentity_s * next
Definition: gl_terrain.h:395
int refs
Definition: gl_terrain.h:392
size_t drawnframe
Definition: gl_terrain.h:390
Definition: gl_terrain.h:403
struct lmsect_s * next
Definition: gl_terrain.h:404
int y
Definition: gl_terrain.h:405
int x
Definition: gl_terrain.h:405
int lm
Definition: gl_terrain.h:405
Definition: gl_terrain.h:343
hmcluster_t * cluster[MAXCLUSTERS *MAXCLUSTERS]
Definition: gl_terrain.h:360
struct relight_ctx_s * relightcontext
Definition: gl_terrain.h:421
char groundshadername[MAX_QPATH]
Definition: gl_terrain.h:346
qboolean forcedefault
Definition: gl_terrain.h:351
int maxsegy
Definition: gl_terrain.h:358
enum heightmap_s::@294 defaultgroundtype
float defaultwaterheight
Definition: gl_terrain.h:354
unsigned int brushmaxlms
Definition: gl_terrain.h:428
unsigned int numbrushes
Definition: gl_terrain.h:431
unsigned int * brushlmremaps
Definition: gl_terrain.h:427
char defaultgroundtexture[MAX_QPATH]
Definition: gl_terrain.h:352
mesh_t * askymesh
Definition: gl_terrain.h:364
char defaultwatershader[MAX_QPATH]
Definition: gl_terrain.h:353
enum heightmap_s::@295 mode
qboolean recalculatebrushlighting
Definition: gl_terrain.h:424
int firstsegy
Definition: gl_terrain.h:357
brushes_t * wbrushes
Definition: gl_terrain.h:430
@ DGT_HOLES
Definition: gl_terrain.h:373
@ DGT_SOLID
Definition: gl_terrain.h:372
@ DGT_FLAT
Definition: gl_terrain.h:374
struct heightmap_s::lmsect_s * unusedlmsects
unsigned int numusedlmsects
Definition: gl_terrain.h:400
shader_t * shader
Definition: gl_terrain.h:362
int tilepixcount[2]
Definition: gl_terrain.h:382
char * texmask
Definition: gl_terrain.h:419
float brushlmscale
Definition: gl_terrain.h:426
qboolean entsdirty
Definition: gl_terrain.h:420
int tilecount[2]
Definition: gl_terrain.h:381
char path[MAX_QPATH]
Definition: gl_terrain.h:344
unsigned int numunusedlmsects
Definition: gl_terrain.h:401
lmalloc_t brushlmalloc
Definition: gl_terrain.h:425
mesh_t skymesh
Definition: gl_terrain.h:363
struct llightinfo_s * lightthreadmem
Definition: gl_terrain.h:422
size_t traceseq
Definition: gl_terrain.h:368
qboolean brushesedited
Definition: gl_terrain.h:433
unsigned int exteriorcontents
Definition: gl_terrain.h:366
vec2_t relightmin
Definition: gl_terrain.h:414
unsigned char * seed
Definition: gl_terrain.h:350
struct heightmap_s::hmentity_s * entities
int firstsegx
Definition: gl_terrain.h:357
unsigned int loadingsections
Definition: gl_terrain.h:367
char skyname[MAX_QPATH]
Definition: gl_terrain.h:345
unsigned int relightidx
Definition: gl_terrain.h:413
hmsection_t * relight
Definition: gl_terrain.h:412
unsigned int culldistance
Definition: gl_terrain.h:347
qboolean legacyterrain
Definition: gl_terrain.h:365
shader_t * skyshader
Definition: gl_terrain.h:361
int maxsegx
Definition: gl_terrain.h:358
int activesections
Definition: gl_terrain.h:384
void * entitylock
Definition: gl_terrain.h:397
float defaultgroundheight
Definition: gl_terrain.h:355
link_t recycle
Definition: gl_terrain.h:385
@ HMM_BLOCKS
Definition: gl_terrain.h:379
@ HMM_TERRAIN
Definition: gl_terrain.h:378
brushtex_t * brushtextures
Definition: gl_terrain.h:429
unsigned int brushidseq
Definition: gl_terrain.h:432
float maxdrawdist
Definition: gl_terrain.h:348
float sectionsize
Definition: gl_terrain.h:359
size_t drawnframe
Definition: gl_terrain.h:369
qboolean inheritedlightthreadmem
Definition: gl_terrain.h:423
Definition: gl_terrain.h:231
Definition: gl_terrain.h:147
mesh_t * amesh
Definition: gl_terrain.h:151
mesh_t mesh
Definition: gl_terrain.h:150
shader_t * shader
Definition: gl_terrain.h:149
struct hmpolyset_s * next
Definition: gl_terrain.h:148
vbo_t vbo
Definition: gl_terrain.h:152
Definition: gl_terrain.h:193
mesh_t mesh
Definition: gl_terrain.h:221
float maxh
Definition: gl_terrain.h:204
pvscache_t pvscache
Definition: gl_terrain.h:213
size_t traceseq
Definition: gl_terrain.h:210
vbo_t vbo
Definition: gl_terrain.h:220
int maxents
Definition: gl_terrain.h:227
float timestamp
Definition: gl_terrain.h:198
struct hmwater_s * water
Definition: gl_terrain.h:208
mesh_t * amesh
Definition: gl_terrain.h:222
unsigned int flags
Definition: gl_terrain.h:202
hmpolyset_t * polys
Definition: gl_terrain.h:224
int lmx
Definition: gl_terrain.h:217
int sx
Definition: gl_terrain.h:195
struct hmentity_s ** ents
Definition: gl_terrain.h:228
struct heightmap_s * hmmod
Definition: gl_terrain.h:205
float maxh_cull
Definition: gl_terrain.h:203
link_t recycle
Definition: gl_terrain.h:194
int loadstate
Definition: gl_terrain.h:197
texnums_t textures
Definition: gl_terrain.h:219
int lightmap
Definition: gl_terrain.h:216
int numents
Definition: gl_terrain.h:226
Definition: gl_terrain.h:155
float minheight
Definition: gl_terrain.h:159
qboolean simple
Definition: gl_terrain.h:158
qbyte holes[8]
Definition: gl_terrain.h:163
float maxheight
Definition: gl_terrain.h:160
unsigned int contentmask
Definition: gl_terrain.h:157
struct hmwater_s * next
Definition: gl_terrain.h:156
char shadername[MAX_QPATH]
Definition: gl_terrain.h:161
float heights[9 *9]
Definition: gl_terrain.h:164
shader_t * shader
Definition: gl_terrain.h:162
Definition: render.h:422
Definition: gl_model.h:90
Definition: gl_model.h:972
Definition: gl_terrain.h:263
vec3_t v
Definition: gl_terrain.h:264
vec2_t tc
Definition: gl_terrain.h:266
vec4_t rgba
Definition: gl_terrain.h:265
Definition: gl_terrain.h:437
int int sy
Definition: gl_terrain.h:443
qboolean(QDECL *AutogenerateSection)(heightmap_t *hm
void(QDECL *AddMesh)(heightmap_t *hm
int model_t const char vec3_t vec3_t axis[3]
Definition: gl_terrain.h:441
int sx
Definition: gl_terrain.h:443
int int unsigned int tgsflags
Definition: gl_terrain.h:446
int int int hmsection_t ** sects
Definition: gl_terrain.h:443
int model_t const char vec3_t vec3_t float scale
Definition: gl_terrain.h:441
qboolean initialise
Definition: gl_terrain.h:439
int model_t const char vec3_t epos
Definition: gl_terrain.h:441
int loadflags
Definition: gl_terrain.h:441
void *QDECL * GenerateWater(hmsection_t *s, float maxheight)
unsigned char *QDECL * GetLightmap(hmsection_t *s, int idx, qboolean edit)
int int int count
Definition: gl_terrain.h:443
hmsection_t *QDECL * GetSection(heightmap_t *hm, int x, int y, unsigned int flags)
qboolean(QDECL *InitLightmap)(hmsection_t *s
qboolean success
Definition: gl_terrain.h:444
int(QDECL *GenerateSections)(heightmap_t *hm
int model_t * mod
Definition: gl_terrain.h:441
int model_t const char * modelname
Definition: gl_terrain.h:441
Definition: bspfile.h:939
Definition: gl_terrain.h:322
float planedist
Definition: gl_terrain.h:325
vec3_t sdir
Definition: gl_terrain.h:326
float tbias
Definition: gl_terrain.h:329
vec3_t tdir
Definition: gl_terrain.h:328
float sbias
Definition: gl_terrain.h:327
vec3_t planenormal
Definition: gl_terrain.h:324
string_t shadername
Definition: gl_terrain.h:323
Definition: gl_terrain.h:332
unsigned int cp_width
Definition: gl_terrain.h:335
unsigned int subdiv_x
Definition: gl_terrain.h:337
unsigned int cp_height
Definition: gl_terrain.h:336
vec3_t texinfo
Definition: gl_terrain.h:339
unsigned int contents
Definition: gl_terrain.h:334
unsigned int subdiv_y
Definition: gl_terrain.h:338
string_t shadername
Definition: gl_terrain.h:333
Definition: gl_terrain.h:272
vec3_t v
Definition: gl_terrain.h:273
vec4_t rgba
Definition: gl_terrain.h:274
vec2_t tc
Definition: gl_terrain.h:275
Definition: shader.h:602
Definition: merged.h:383
Definition: gl_model.h:320
unsigned int flags
Definition: valid.c:313