// used always
int *element3i;
unsigned short *element3s;
+ // used for shadow mapping cubemap side partitioning
+ int sideoffsets[6], sidetotals[6];
// used for shadow mesh (NULL on light mesh)
int *neighbor3i;
// these are NULL after Mod_ShadowMesh_Finish is performed, only used
typedef struct q3shaderinfo_s
{
char name[Q3PATHLENGTH];
+#define Q3SHADERINFO_COMPARE_START surfaceparms
int surfaceparms;
int textureflags;
int numlayers;
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
+
+ // gloss
+ float specularscalemod;
+ float specularpowermod;
+#define Q3SHADERINFO_COMPARE_END specularpowermod
}
q3shaderinfo_t;
struct texture_s *currentframe;
// current texture transform matrix (used for water scrolling)
matrix4x4_t currenttexmatrix;
+ matrix4x4_t currentbackgroundtexmatrix;
// various q3 shader features
q3shaderinfo_layer_rgbgen_t rgbgen;
q3shaderinfo_layer_alphagen_t alphagen;
q3shaderinfo_layer_tcgen_t tcgen;
q3shaderinfo_layer_tcmod_t tcmods[Q3MAXTCMODS];
+ q3shaderinfo_layer_tcmod_t backgroundtcmods[Q3MAXTCMODS];
q3shaderinfo_deform_t deforms[Q3MAXDEFORMS];
qboolean colormapping;
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
+
+ // gloss
+ float specularscalemod;
+ float specularpowermod;
}
texture_t;
struct q3deffect_s *effect; // q3bsp
// FIXME: collisionmarkframe should be kept in a separate array
int collisionmarkframe; // q3bsp // don't collide twice in one trace
+
+ // optimization...
+ float *data_collisionbbox6f; // collision optimization - contains combined bboxes of every data_collisionstride triangles
+ int num_collisionbboxstride;
+ float *data_bbox6f; // collision optimization - contains combined bboxes of every data_collisionstride triangles
+ int num_bboxstride;
}
msurface_t;
int num_lightgrid_imins[3];
int num_lightgrid_imaxs[3];
int num_lightgrid_isize[3];
- // indexing/clamping
- int num_lightgrid_dimensions[3];
// transform modelspace coordinates to lightgrid index
matrix4x4_t num_lightgrid_indexfromworld;
void(*DrawDepth)(struct entity_render_s *ent);
// draw any enabled debugging effects on this model (such as showing triangles, normals, collision brushes...)
void(*DrawDebug)(struct entity_render_s *ent);
+ // compile an optimized shadowmap mesh for the model based on light source
+ void(*CompileShadowMap)(struct entity_render_s *ent, vec3_t relativelightorigin, vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist);
+ // draw depth into a shadowmap
+ 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);
// gathers info on which clusters and surfaces are lit by light, as well as calculating a bounding box
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);
// compile a shadow volume for the model based on light source
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);
+ // trace a box against this model
+ void (*TraceLine)(struct model_s *model, int frame, struct trace_s *trace, const vec3_t start, const vec3_t end, int hitsupercontentsmask);
+ // trace a point against this model (like PointSuperContents)
+ void (*TracePoint)(struct model_s *model, int frame, struct trace_s *trace, const vec3_t start, 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
void R_Q1BSP_DrawDepth(struct entity_render_s *ent);
void R_Q1BSP_DrawDebug(struct entity_render_s *ent);
void R_Q1BSP_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);
+void R_Q1BSP_CompileShadowMap(struct entity_render_s *ent, vec3_t relativelightorigin, vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist);
+void R_Q1BSP_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 R_Q1BSP_CompileShadowVolume(struct entity_render_s *ent, vec3_t relativelightorigin, vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist);
void R_Q1BSP_DrawShadowVolume(struct entity_render_s *ent, const vec3_t relativelightorigin, const vec3_t relativelightdirection, float lightradius, int numsurfaces, const int *surfacelist, const vec3_t lightmins, const vec3_t lightmaxs);
void R_Q1BSP_DrawLight(struct entity_render_s *ent, int numsurfaces, const int *surfacelist, const unsigned char *trispvs);
void Mod_IDSP_Load(dp_model_t *mod, void *buffer, void *bufferend);
void Mod_IDS2_Load(dp_model_t *mod, void *buffer, void *bufferend);
-// utility
-qboolean Mod_CanSeeBox_Trace(int numsamples, float t, dp_model_t *model, vec3_t eye, vec3_t minsX, vec3_t maxsX);
-
#endif // MODEL_SHARED_H