-#if 0
-static void RSurf_GL11_WaterTexCoords(int texturenumsurfaces, msurface_t **texturesurfacelist)
-{
- int texturesurfaceindex;
- const msurface_t *surface;
- // compute texcoords for vertices (yes, these swim around the screen a bit unintentionally)
- // compute vertex alpha to fade between reflection and refraction if this is water
- for (texturesurfaceindex = 0;texturesurfaceindex < texturenumsurfaces;texturesurfaceindex++)
- {
- surface = texturesurfacelist[texturesurfaceindex];
- GL_TransformToScreenTexCoords(surface->num_vertices, rsurface.vertex3f + 3 * surface->num_firstvertex, rsurface.array_generatedtexcoordtexture2f + 2 * surface->num_firstvertex, r_waterstate.screenscale[0], r_waterstate.screenscale[1], r_waterstate.screencenter[0], r_waterstate.screencenter[1]);
- }
-}
-
-static void RSurf_GL11_WaterFresnelAlpha(int texturenumsurfaces, msurface_t **texturesurfacelist)
-{
- int texturesurfaceindex;
- int i;
- const msurface_t *surface;
- int numverts;
- const float *v;
- const float *n;
- float *c2;
- vec3_t dir;
- float Fresnel;
- // compute texcoords for vertices (yes, these swim around the screen a bit unintentionally)
- // compute vertex alpha to fade between reflection and refraction if this is water
- for (texturesurfaceindex = 0;texturesurfaceindex < texturenumsurfaces;texturesurfaceindex++)
- {
- surface = texturesurfacelist[texturesurfaceindex];
- numverts = surface->num_vertices;
- v = rsurface.vertex3f + 3 * surface->num_firstvertex;
- n = rsurface.normal3f + 3 * surface->num_firstvertex;
- c2 = rsurface.array_color4f + 4 * surface->num_firstvertex;
- for (i = 0;i < numverts;i++, v += 3, n += 3, c2 += 4)
- {
- VectorSubtract(rsurface.modelorg, v, dir);
- VectorNormalize(dir);
- Fresnel = pow(min(1.0f, 1.0f - DotProduct(dir, n)), 2.0f) * (rsurface.texture->reflectmax - rsurface.texture->reflectmin) + rsurface.texture->reflectmin;
- Vector4Set(c2, 1, 1, 1, Fresnel);
- }
- }
-}
-
-static void R_DrawTextureSurfaceList_GL11_Water(int texturenumsurfaces, msurface_t **texturesurfacelist)
-{
- // OpenGL 1.1 path - crusty old voodoo path
- rmeshstate_t m;
- qboolean water;
- if (rsurface.mode != RSURFMODE_MULTIPASS)
- rsurface.mode = RSURFMODE_MULTIPASS;
- RSurf_PrepareVerticesForBatch(true, false, texturenumsurfaces, texturesurfacelist);
- R_Mesh_ColorPointer(NULL, 0, 0);
- water = (rsurface.texture->currentmaterialflags & MATERIALFLAG_WATERSHADER) != 0;
- RSurf_GL11_WaterTexCoords(texturenumsurfaces, texturesurfacelist);
- if (water)
- RSurf_GL11_WaterFresnelAlpha(texturenumsurfaces, texturesurfacelist);
- // now draw the surfaces as refraction texture
- memset(&m, 0, sizeof(m));
- m.tex[0] = R_GetTexture(r_texture_white);
- m.pointer_texcoord[0] = rsurface.array_generatedtexcoordtexture2f;
- R_Mesh_TextureState(&m);
- RSurf_DrawBatch_WithLightmapSwitching_WithWaterTextureSwitching(texturenumsurfaces, texturesurfacelist, -1, -1, 0, -1);
- if (water)
- {
- // water also reflects before the normal render occurs, and uses a
- // vertex-controlled alpha blend between refraction and reflection
- GL_LockArrays(0, 0);
- R_Mesh_ColorPointer(rsurface.array_color4f, 0, 0);
- GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- GL_DepthMask(false);
- RSurf_DrawBatch_WithLightmapSwitching_WithWaterTextureSwitching(texturenumsurfaces, texturesurfacelist, -1, -1, -1, 0);
- }
- GL_LockArrays(0, 0);
- CHECKGLERROR
-}
-
-static void R_DrawTextureSurfaceList_GL11_Reflection(int texturenumsurfaces, msurface_t **texturesurfacelist)
-{
- // OpenGL 1.1 path - crusty old voodoo path
- rmeshstate_t m;
- qboolean water;
- if (rsurface.mode != RSURFMODE_MULTIPASS)
- rsurface.mode = RSURFMODE_MULTIPASS;
- RSurf_PrepareVerticesForBatch(true, false, texturenumsurfaces, texturesurfacelist);
- R_Mesh_ColorPointer(NULL, 0, 0);
- water = (rsurface.texture->currentmaterialflags & MATERIALFLAG_WATERSHADER) != 0;
- RSurf_GL11_WaterTexCoords(texturenumsurfaces, texturesurfacelist);
- // now draw the surfaces as refraction texture
- memset(&m, 0, sizeof(m));
- m.tex[0] = R_GetTexture(r_texture_white);
- m.pointer_texcoord[0] = rsurface.array_generatedtexcoordtexture2f;
- R_Mesh_TextureState(&m);
- RSurf_DrawBatch_WithLightmapSwitching_WithWaterTextureSwitching(texturenumsurfaces, texturesurfacelist, -1, -1, -1, 0);
- GL_LockArrays(0, 0);
- CHECKGLERROR
-}
-#endif
-