X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=model_shared.h;h=0226e7015ead54ea9326f6985e11822d387634b5;hb=576b979605c27c7d0923dded4be463c53bebf73f;hp=0b377c2c18f79745437ad7cee9aca9f54074ad9a;hpb=00aec42dd35089cb6f237f7670a575271da6ebd4;p=xonotic%2Fdarkplaces.git diff --git a/model_shared.h b/model_shared.h index 0b377c2c..0226e701 100644 --- a/model_shared.h +++ b/model_shared.h @@ -487,9 +487,10 @@ texture_shaderpass_t; typedef struct texture_s { - // q1bsp // name - //char name[16]; + char name[64]; + + // q1bsp // size unsigned int width, height; // SURF_ flags @@ -590,7 +591,6 @@ typedef struct texture_s int customblendfunc[2]; // q3bsp - char name[64]; int surfaceflags; int supercontents; @@ -631,6 +631,11 @@ typedef struct texture_s // diffuse and ambient float rtlightambient; + + // used by Mod_Mesh_GetTexture for drawflag and materialflag overrides, to disambiguate the same texture with different hints + int mesh_drawflag; + int mesh_defaulttexflags; + int mesh_defaultmaterialflags; } texture_t; @@ -682,10 +687,6 @@ typedef struct msurface_s struct q3deffect_s *effect; // q3bsp // mesh information for collisions (only used by q3bsp curves) int num_firstcollisiontriangle; - int *deprecatedq3data_collisionelement3i; // q3bsp - float *deprecatedq3data_collisionvertex3f; // q3bsp - float *deprecatedq3data_collisionbbox6f; // collision optimization - contains combined bboxes of every data_collisionstride triangles - float *deprecatedq3data_bbox6f; // collision optimization - contains combined bboxes of every data_collisionstride triangles // surfaces own ranges of vertices and triangles in the model->surfmesh int num_triangles; // number of triangles @@ -696,10 +697,6 @@ typedef struct msurface_s // mesh information for collisions (only used by q3bsp curves) int num_collisiontriangles; // q3bsp int num_collisionvertices; // q3bsp - int deprecatedq3num_collisionbboxstride; - int deprecatedq3num_bboxstride; - // FIXME: collisionmarkframe should be kept in a separate array - int deprecatedq3collisionmarkframe; // q3bsp // don't collide twice in one trace // used by Mod_Mesh_Finalize when building sortedmodelsurfaces qboolean included; @@ -878,12 +875,6 @@ typedef struct model_brushq1_s } model_brushq1_t; -typedef struct model_brushq2_s -{ - int dummy; // MSVC can't handle an empty struct -} -model_brushq2_t; - typedef struct model_brushq3_s { int num_models; @@ -914,7 +905,7 @@ typedef struct model_brushq3_s rtexture_t **data_lightmaps; rtexture_t **data_deluxemaps; - // voxel light data with directional shading + // voxel light data with directional shading - data for cpu sampling of it... int num_lightgrid; q3dlightgrid_t *data_lightgrid; // size of each cell (may vary by map, typically 64 64 128) @@ -927,6 +918,10 @@ typedef struct model_brushq3_s int num_lightgrid_isize[3]; // transform modelspace coordinates to lightgrid index matrix4x4_t num_lightgrid_indexfromworld; + // parameters for fragment shader to sample the texture version of it: + int lightgridtexturesize[3]; // 3 layers tall (ambient, lightcolor, lightdir) + matrix4x4_t lightgridworldtotexturematrix; + rtexture_t *lightgridtexture; // true if this q3bsp file has been detected as using deluxemapping // (lightmap texture pairs, every odd one is never directly refernced, @@ -1058,7 +1053,6 @@ typedef struct model_s model_sprite_t sprite; model_brush_t brush; model_brushq1_t brushq1; - model_brushq2_t brushq2; model_brushq3_t brushq3; // flags this model for offseting sounds to the model center (used by brush models) int soundfromcenter; @@ -1088,6 +1082,9 @@ extern cvar_t mod_q3shader_default_polygonfactor; extern cvar_t mod_q3shader_default_refractive_index; extern cvar_t mod_q3shader_force_addalpha; extern cvar_t mod_q3shader_force_terrain_alphaflag; +extern cvar_t mod_q3bsp_lightgrid_texture; +extern cvar_t mod_q3bsp_lightgrid_world_surfaces; +extern cvar_t mod_q3bsp_lightgrid_bsp_surfaces; void Mod_Init (void); void Mod_Reload (void); @@ -1210,7 +1207,7 @@ void R_Q1BSP_DrawLight(struct entity_render_s *ent, int numsurfaces, const int * void Mod_Mesh_Create(dp_model_t *mod, const char *name); void Mod_Mesh_Destroy(dp_model_t *mod); void Mod_Mesh_Reset(dp_model_t *mod); -texture_t *Mod_Mesh_GetTexture(dp_model_t *mod, const char *name, int defaultdrawflags, int defaulttexflags, int addmaterialflags); +texture_t *Mod_Mesh_GetTexture(dp_model_t *mod, const char *name, int defaultdrawflags, int defaulttexflags, int defaultmaterialflags); msurface_t *Mod_Mesh_AddSurface(dp_model_t *mod, texture_t *tex, qboolean batchwithprevioussurface); int Mod_Mesh_IndexForVertex(dp_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_Mesh_AddTriangle(dp_model_t *mod, msurface_t *surf, int e0, int e1, int e2);