]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rsurf.c
implemented r_glsl_water cvar (refraction and reflection rendering)
[xonotic/darkplaces.git] / gl_rsurf.c
index 1dd4c27c7a8408181de47dbb2c67089cf0c26db0..cdd439266453dcd5171cf8685559cde40d4eff6f 100644 (file)
@@ -404,7 +404,7 @@ void R_DrawPortals(void)
        }
 }
 
        }
 }
 
-void R_View_WorldVisibility(void)
+void R_View_WorldVisibility(qboolean forcenovis)
 {
        int i, j, *mark;
        mleaf_t *leaf;
 {
        int i, j, *mark;
        mleaf_t *leaf;
@@ -430,7 +430,7 @@ void R_View_WorldVisibility(void)
 
                // if floating around in the void (no pvs data available, and no
                // portals available), simply use all on-screen leafs.
 
                // if floating around in the void (no pvs data available, and no
                // portals available), simply use all on-screen leafs.
-               if (!viewleaf || viewleaf->clusterindex < 0)
+               if (!viewleaf || viewleaf->clusterindex < 0 || forcenovis)
                {
                        // no visibility method: (used when floating around in the void)
                        // simply cull each leaf to the frustum (view pyramid)
                {
                        // no visibility method: (used when floating around in the void)
                        // simply cull each leaf to the frustum (view pyramid)
@@ -524,9 +524,20 @@ void R_Q1BSP_DrawSky(entity_render_t *ent)
        if (ent->model == NULL)
                return;
        if (ent == r_refdef.worldentity)
        if (ent->model == NULL)
                return;
        if (ent == r_refdef.worldentity)
-               R_DrawWorldSurfaces(true, true, false);
+               R_DrawWorldSurfaces(true, true, false, false);
        else
        else
-               R_DrawModelSurfaces(ent, true, true, false);
+               R_DrawModelSurfaces(ent, true, true, false, false);
+}
+
+void R_Q1BSP_DrawAddWaterPlanes(entity_render_t *ent)
+{
+       model_t *model = ent->model;
+       if (model == NULL)
+               return;
+       if (ent == r_refdef.worldentity)
+               R_DrawWorldSurfaces(false, false, false, true);
+       else
+               R_DrawModelSurfaces(ent, false, false, false, true);
 }
 
 void R_Q1BSP_Draw(entity_render_t *ent)
 }
 
 void R_Q1BSP_Draw(entity_render_t *ent)
@@ -535,9 +546,9 @@ void R_Q1BSP_Draw(entity_render_t *ent)
        if (model == NULL)
                return;
        if (ent == r_refdef.worldentity)
        if (model == NULL)
                return;
        if (ent == r_refdef.worldentity)
-               R_DrawWorldSurfaces(false, true, false);
+               R_DrawWorldSurfaces(false, true, false, false);
        else
        else
-               R_DrawModelSurfaces(ent, false, true, false);
+               R_DrawModelSurfaces(ent, false, true, false, false);
 }
 
 void R_Q1BSP_DrawDepth(entity_render_t *ent)
 }
 
 void R_Q1BSP_DrawDepth(entity_render_t *ent)
@@ -546,9 +557,9 @@ void R_Q1BSP_DrawDepth(entity_render_t *ent)
        if (model == NULL)
                return;
        if (ent == r_refdef.worldentity)
        if (model == NULL)
                return;
        if (ent == r_refdef.worldentity)
-               R_DrawWorldSurfaces(false, false, true);
+               R_DrawWorldSurfaces(false, false, true, false);
        else
        else
-               R_DrawModelSurfaces(ent, false, false, true);
+               R_DrawModelSurfaces(ent, false, false, true, false);
 }
 
 typedef struct r_q1bsp_getlightinfo_s
 }
 
 typedef struct r_q1bsp_getlightinfo_s