]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - model_brush.h
Elric rewrote the makefile, it is quite self explanatory when run.
[xonotic/darkplaces.git] / model_brush.h
index ede0144e0732068f417befe78fb9f9654a589112..e928269894be7f585f5c86792db4e76ad598a096 100644 (file)
@@ -120,6 +120,8 @@ texture_t;
 #define SURF_DRAWFULLBRIGHT 0x200
 #define SURF_LIGHTBOTHSIDES 0x400
 #define SURF_CLIPSOLID 0x800 // this polygon can obscure other polygons
+#define SURF_SHADOWCAST 0x1000 // this polygon can cast stencil shadows
+#define SURF_SHADOWLIGHT 0x2000 // this polygon can be lit by stencil shadowing
 
 typedef struct
 {
@@ -143,11 +145,13 @@ typedef struct surfmesh_s
        int numverts;
        int numtriangles;
        float *verts;
+       float *normals;
        int *lightmapoffsets;
-       float *st;
-       float *uv;
-       float *ab;
+       float *str;
+       float *uvw;
+       float *abc;
        int *index;
+       int *triangleneighbors;
 }
 surfmesh_t;
 
@@ -200,6 +204,8 @@ typedef struct msurface_s
        float *poly_verts;
        // bounding box for onscreen checks, and center for sorting
        vec3_t poly_mins, poly_maxs, poly_center;
+       // bounding sphere radius (around poly_center)
+       float poly_radius, poly_radius2;
 
        // these are regenerated every frame
        // lighting info
@@ -216,7 +222,7 @@ typedef struct msurface_s
        // if lightmap was lit by dynamic lights, force update on next frame
        short cached_dlight;
        // to cause lightmap to be rerendered when v_overbrightbits changes
-       short cached_lightscalebit;
+       short cached_lightmapscalebit;
        // rerender lightmaps when r_ambient changes
        float cached_ambient;
 }
@@ -297,6 +303,16 @@ typedef struct mportal_s
 }
 mportal_t;
 
+typedef struct svbspmesh_s
+{
+       struct svbspmesh_s *next;
+       int numverts, maxverts;
+       int numtriangles, maxtriangles;
+       float *verts;
+       int *elements;
+}
+svbspmesh_t;
+
 typedef struct mlight_s
 {
        // location of light
@@ -315,8 +331,18 @@ typedef struct mlight_s
        float distbias;
        // light style controlling this light
        int style;
-       // used only for loading calculations, number of leafs this shines on
-       //int numleafs;
+       // maximum extent of the light for various purposes
+       float cullradius;
+       float cullradius2;
+       // surfaces this shines on
+       int numsurfaces;
+       msurface_t **surfaces;
+       // lit area
+       vec3_t mins, maxs;
+       // precomputed shadow volume meshs
+       //svbspmesh_t *shadowvolume;
+       //vec3_t shadowvolumemins, shadowvolumemaxs;
+       shadowmesh_t *shadowvolume;
 }
 mlight_t;