*/
-typedef enum modtype_e {mod_invalid, mod_brushq1, mod_sprite, mod_alias, mod_brushq2, mod_brushq3, mod_obj, mod_null} modtype_t;
+typedef enum modtype_e {mod_invalid, mod_brushq1, mod_sprite, mod_alias, mod_brushq2, mod_brushq3, mod_brushjk, mod_obj, mod_null} modtype_t;
typedef struct animscene_s
{
#define Q3TEXTUREFLAG_REFLECTION 512
#define Q3TEXTUREFLAG_WATERSHADER 1024
#define Q3TEXTUREFLAG_CAMERA 2048
+#define Q3TEXTUREFLAG_TRANSPARENTSORT 4096
#define Q3PATHLENGTH 64
#define TEXTURE_MAXFRAMES 64
OFFSETMAPPING_RELIEF // relief
}dpoffsetmapping_technique_t;
+typedef enum dptransparentsort_category_e
+{
+ TRANSPARENTSORT_SKY,
+ TRANSPARENTSORT_DISTANCE,
+ TRANSPARENTSORT_HUD,
+}dptransparentsortcategory_t;
typedef struct q3shaderinfo_s
{
char name[Q3PATHLENGTH];
#define Q3SHADERINFO_COMPARE_START surfaceparms
int surfaceparms;
+ int surfaceflags;
int textureflags;
int numlayers;
qboolean lighting;
// dp-specific additions:
// shadow control
+ qboolean dpnortlight;
qboolean dpshadow;
qboolean dpnoshadow;
// add collisions to all triangles of the surface
qboolean dpmeshcollisions;
+ // kill shader based on cvar checks
+ qboolean dpshaderkill;
+
// fake reflection
char dpreflectcube[Q3PATHLENGTH];
// offsetmapping
dpoffsetmapping_technique_t offsetmapping;
float offsetscale;
+ float offsetbias; // 0 is normal, 1 leads to alpha 0 being neutral and alpha 1 pushing "out"
// polygonoffset (only used if Q3TEXTUREFLAG_POLYGONOFFSET)
float biaspolygonoffset, biaspolygonfactor;
+ // transparent sort category
+ dptransparentsortcategory_t transparentsort;
+
// gloss
float specularscalemod;
float specularpowermod;
-#define Q3SHADERINFO_COMPARE_END specularpowermod
+
+ // rtlightning ambient addition
+ float rtlightambient;
+#define Q3SHADERINFO_COMPARE_END rtlightambient
}
q3shaderinfo_t;
char name[64];
int surfaceflags;
int supercontents;
- int surfaceparms;
int textureflags;
// reflection
// offsetmapping
dpoffsetmapping_technique_t offsetmapping;
float offsetscale;
+ float offsetbias;
+
+ // transparent sort category
+ dptransparentsortcategory_t transparentsort;
// gloss
float specularscalemod;
float specularpowermod;
+
+ // diffuse and ambient
+ float rtlightambient;
}
texture_t;
{
// true if this model is a HalfLife .bsp file
qboolean ishlbsp;
+ // true if this model is a BSP2 .bsp file (expanded 32bit bsp format for DarkPlaces, RMQ, others?)
+ qboolean isbsp2;
// string of entity definitions (.map format)
char *entities;
int (*FindBoxClusters)(struct model_s *model, const vec3_t mins, const vec3_t maxs, int maxclusters, int *clusterlist);
void (*LightPoint)(struct model_s *model, const vec3_t p, vec3_t ambientcolor, vec3_t diffusecolor, vec3_t diffusenormal);
void (*FindNonSolidLocation)(struct model_s *model, const vec3_t in, vec3_t out, vec_t radius);
- mleaf_t *(*PointInLeaf)(struct model_s *model, const float *p);
+ mleaf_t *(*PointInLeaf)(struct model_s *model, const vec3_t p);
// these are actually only found on brushq1, but NULL is handled gracefully
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);
typedef struct model_brushq1_s
{
- dmodel_t *submodels;
+ mmodel_t *submodels;
int numvertexes;
mvertex_t *vertexes;
}
model_brushq3_t;
+typedef struct model_brushjk_s
+{
+ int num_models;
+ jkdmodel_t *data_models;
+
+ // used only during loading - freed after loading!
+ int num_vertices;
+ float *data_vertex3f;
+ float *data_normal3f;
+ float *data_texcoordtexture2f;
+ float **data_texcoordlightmap2f;
+ float **data_color4f;
+
+ // freed after loading!
+ int num_triangles;
+ int *data_element3i;
+
+ int num_effects;
+ q3deffect_t *data_effects;
+
+ // lightmap textures
+ int num_originallightmaps;
+ int num_mergedlightmaps;
+ int num_lightmapmergedwidthpower;
+ int num_lightmapmergedheightpower;
+ int num_lightmapmergedwidthheightdeluxepower;
+ int num_lightmapmerge;
+ rtexture_t **data_lightmaps;
+ rtexture_t **data_deluxemaps;
+
+ // voxel light data with directional shading
+ int num_lightgrid;
+ jkdlightgrid_t *data_lightgrid;
+ // size of each cell (may vary by map, typically 64 64 128)
+ float num_lightgrid_cellsize[3];
+ // 1.0 / num_lightgrid_cellsize
+ float num_lightgrid_scale[3];
+ // dimensions of the world model in lightgrid cells
+ int num_lightgrid_imins[3];
+ int num_lightgrid_imaxs[3];
+ int num_lightgrid_isize[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;
+ // size of lightmaps (128 by default, but may be another poweroftwo if
+ // external lightmaps are used (q3map2 -lightmapsize)
+ int lightmapsize;
+}
+model_brushjk_t;
+
struct frameblend_s;
struct skeleton_s;
// for skeletal models
int num_bones;
aliasbone_t *data_bones;
- float num_posescale; // scaling factor from origin in poses6s format (includes divide by 32767)
- float num_poseinvscale; // scaling factor to origin in poses6s format (includes multiply by 32767)
+ float num_posescale; // scaling factor from origin in poses7s format (includes divide by 32767)
+ float num_poseinvscale; // scaling factor to origin in poses7s format (includes multiply by 32767)
int num_poses;
- short *data_poses6s; // origin xyz, quat xyz, w implied negative, unit length, values normalized to +/-32767 range
+ short *data_poses7s; // origin xyz, quat xyzw, unit length, values normalized to +/-32767 range
float *data_baseboneposeinverse;
// textures of this model
int num_textures;
model_brushq2_t brushq2;
*/
model_brushq3_t brushq3;
+ model_brushjk_t brushjk;
// flags this model for offseting sounds to the model center (used by brush models)
int soundfromcenter;
// if set, the model contains light information (lightmap, or vertexlight)
qboolean lit;
+ float lightmapscale;
}
dp_model_t;
extern cvar_t r_mipskins;
extern cvar_t r_mipnormalmaps;
-typedef struct skeleton_s
-{
- const dp_model_t *model;
- matrix4x4_t *relativetransforms;
-}
-skeleton_t;
-
typedef struct skinfileitem_s
{
struct skinfileitem_s *next;
void Mod_IDSP_Load(dp_model_t *mod, void *buffer, void *bufferend);
void Mod_IDS2_Load(dp_model_t *mod, void *buffer, void *bufferend);
void Mod_INTERQUAKEMODEL_Load(dp_model_t *mod, void *buffer, void *bufferend);
+void Mod_RBSP_Load(dp_model_t *mod, void *buffer, void *bufferend);
#endif // MODEL_SHARED_H