cvar_t r_floatbuildlightmap = {0, "r_floatbuildlightmap", "0"};
cvar_t r_detailtextures = {CVAR_SAVE, "r_detailtextures", "1"};
cvar_t r_surfaceworldnode = {0, "r_surfaceworldnode", "1"};
-cvar_t r_curves_subdivide_level = {0, "r_curves_subdivide_level", "0"};
+cvar_t r_drawcollisionbrushes_polygonoffset = {0, "r_drawcollisionbrushes_polygonoffset", "-4"};
static int dlightdivtable[32768];
R_Mesh_Matrix(&ent->matrix);
- GL_Color(fogcolor[0] * r_colorscale, fogcolor[1] * r_colorscale, fogcolor[2] * r_colorscale, 1);
+ GL_Color(fogcolor[0], fogcolor[1], fogcolor[2], 1);
if (skyrendermasked)
{
// depth-only (masking)
{
const entity_render_t *ent = calldata1;
const msurface_t *surf = ent->model->brushq1.surfaces + calldata2;
- float f, colorscale;
+ float colorscale;
const surfmesh_t *mesh;
rmeshstate_t m;
float alpha;
float modelorg[3];
texture_t *texture;
matrix4x4_t tempmatrix;
+ float args[4] = {0.05f,0,0,0.04f};
if (r_waterscroll.value)
{
// scrolling in texture matrix
Matrix4x4_CreateTranslate(&tempmatrix, sin(cl.time) * 0.025 * r_waterscroll.value, sin(cl.time * 0.8f) * 0.025 * r_waterscroll.value, 0);
+ if (gl_textureshader && r_watershader.integer)
+ {
+ R_Mesh_TextureMatrix(1, &tempmatrix);
+ Matrix4x4_CreateTranslate(&tempmatrix, -sin(cl.time) * 0.025 * r_waterscroll.value, -sin(cl.time * 0.8f) * 0.025 * r_waterscroll.value, 0);
+ }
R_Mesh_TextureMatrix(0, &tempmatrix);
}
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_DepthMask(true);
}
- m.tex[0] = R_GetTexture(texture->skin.base);
- colorscale = r_colorscale;
+ if (gl_textureshader && r_watershader.integer)
+ {
+ m.tex[0] = R_GetTexture(mod_shared_distorttexture);
+ m.tex[1] = R_GetTexture(texture->skin.base);
+ }
+ else
+ m.tex[0] = R_GetTexture(texture->skin.base);
+ colorscale = 1;
if (gl_combine.integer)
{
m.texrgbscale[0] = 4;
colorscale *= 0.25f;
}
GL_DepthTest(true);
- GL_ColorPointer(varray_color4f);
+ if (fogenabled)
+ GL_ColorPointer(varray_color4f);
+ else
+ GL_Color(1, 1, 1, alpha);
+ if (gl_textureshader && r_watershader.integer)
+ {
+ GL_ActiveTexture (0);
+ qglTexEnvi (GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_TEXTURE_2D);
+ GL_ActiveTexture (1);
+ qglTexEnvi (GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_TEXTURE_2D);
+ qglTexEnvi (GL_TEXTURE_SHADER_NV, GL_SHADER_OPERATION_NV, GL_OFFSET_TEXTURE_2D_NV);
+ qglTexEnvi (GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, GL_TEXTURE0_ARB);
+ qglTexEnvfv (GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, &args[0]);
+ qglEnable (GL_TEXTURE_SHADER_NV);
+ }
for (mesh = surf->mesh;mesh;mesh = mesh->chain)
{
GL_VertexPointer(mesh->vertex3f);
m.pointer_texcoord[0] = mesh->texcoordtexture2f;
+ m.pointer_texcoord[1] = mesh->texcoordtexture2f;
+ m.texcombinergb[1] = GL_REPLACE;
R_Mesh_State_Texture(&m);
- f = surf->flags & SURF_DRAWFULLBRIGHT ? 1.0f : ((surf->flags & SURF_LIGHTMAP) ? 0 : 0.5f);
- R_FillColors(varray_color4f, mesh->numverts, f, f, f, alpha);
- if (!(surf->flags & SURF_DRAWFULLBRIGHT || ent->effects & EF_FULLBRIGHT))
+ if (fogenabled)
{
- if (surf->dlightframe == r_framecount)
- RSurf_LightSeparate_Vertex3f_Color4f(&ent->inversematrix, surf->dlightbits, mesh->numverts, mesh->vertex3f, varray_color4f, 1);
- if (surf->flags & SURF_LIGHTMAP)
- RSurf_AddLightmapToVertexColors_Color4f(mesh->lightmapoffsets, varray_color4f, mesh->numverts, surf->samples, ((surf->extents[0]>>4)+1)*((surf->extents[1]>>4)+1)*3, surf->styles);
+ R_FillColors(varray_color4f, mesh->numverts, 1, 1, 1, alpha);
+ RSurf_FogColors_Vertex3f_Color4f(mesh->vertex3f, varray_color4f, colorscale, mesh->numverts, modelorg);
}
- RSurf_FogColors_Vertex3f_Color4f(mesh->vertex3f, varray_color4f, colorscale, mesh->numverts, modelorg);
- R_Mesh_Draw(mesh->numverts, mesh->numtriangles, mesh->element3i);
+ R_Mesh_Draw(mesh->numverts, mesh->numtriangles, mesh->element3i);
+ }
+ if (gl_textureshader && r_watershader.integer)
+ {
+ qglDisable (GL_TEXTURE_SHADER_NV);
+ GL_ActiveTexture (0);
}
if (fogenabled)
m.pointer_texcoord[0] = mesh->texcoordtexture2f;
GL_ColorPointer(varray_color4f);
R_Mesh_State_Texture(&m);
- RSurf_FogPassColors_Vertex3f_Color4f(mesh->vertex3f, varray_color4f, fogcolor[0], fogcolor[1], fogcolor[2], alpha, r_colorscale, mesh->numverts, modelorg);
+ RSurf_FogPassColors_Vertex3f_Color4f(mesh->vertex3f, varray_color4f, fogcolor[0], fogcolor[1], fogcolor[2], alpha, 1, mesh->numverts, modelorg);
R_Mesh_Draw(mesh->numverts, mesh->numtriangles, mesh->element3i);
}
}
{
Matrix4x4_CreateIdentity(&tempmatrix);
R_Mesh_TextureMatrix(0, &tempmatrix);
+ R_Mesh_TextureMatrix(1, &tempmatrix);
}
}
GL_DepthMask(true);
}
m.tex[0] = R_GetTexture(texture->skin.base);
- colorscale = r_colorscale;
+ colorscale = 1;
if (gl_combine.integer)
{
m.texrgbscale[0] = 4;
if (m.tex[0])
m.pointer_texcoord[0] = mesh->texcoordtexture2f;
R_Mesh_State_Texture(&m);
- RSurf_FoggedColors_Vertex3f_Color4f(mesh->vertex3f, varray_color4f, 1, 1, 1, currentalpha, r_colorscale, mesh->numverts, modelorg);
+ RSurf_FoggedColors_Vertex3f_Color4f(mesh->vertex3f, varray_color4f, 1, 1, 1, currentalpha, 1, mesh->numverts, modelorg);
R_Mesh_Draw(mesh->numverts, mesh->numtriangles, mesh->element3i);
}
}
if (m.tex[0])
m.pointer_texcoord[0] = mesh->texcoordtexture2f;
R_Mesh_State_Texture(&m);
- RSurf_FogPassColors_Vertex3f_Color4f(mesh->vertex3f, varray_color4f, fogcolor[0], fogcolor[1], fogcolor[2], currentalpha, r_colorscale, mesh->numverts, modelorg);
+ RSurf_FogPassColors_Vertex3f_Color4f(mesh->vertex3f, varray_color4f, fogcolor[0], fogcolor[1], fogcolor[2], currentalpha, 1, mesh->numverts, modelorg);
R_Mesh_Draw(mesh->numverts, mesh->numtriangles, mesh->element3i);
}
}
m.texrgbscale[0] = 1;
m.texrgbscale[1] = 4;
m.texrgbscale[2] = 2;
- cl = (float) (1 << r_lightmapscalebit) * r_colorscale;
+ cl = (float) (1 << r_lightmapscalebit);
GL_Color(cl, cl, cl, 1);
while((surf = *surfchain++) != NULL)
m.tex[1] = R_GetTexture((**surfchain).lightmaptexture);
if (gl_combine.integer)
m.texrgbscale[1] = 4;
- GL_Color(r_colorscale, r_colorscale, r_colorscale, 1);
+ GL_Color(1, 1, 1, 1);
while((surf = *surfchain++) != NULL)
{
if (surf->visframe == r_framecount)
m.tex[0] = R_GetTexture((**surfchain).lightmaptexture);
if (gl_combine.integer)
m.texrgbscale[0] = 4;
- GL_Color(r_colorscale, r_colorscale, r_colorscale, 1);
+ GL_Color(1, 1, 1, 1);
while((surf = *surfchain++) != NULL)
{
if (surf->visframe == r_framecount)
GL_DepthMask(false);
GL_DepthTest(true);
m.tex[0] = R_GetTexture(texture->skin.base);
- colorscale = r_colorscale;
+ colorscale = 1;
if (gl_combine.integer)
{
m.texrgbscale[0] = 4;
if (m.tex[0])
m.pointer_texcoord[0] = mesh->texcoordtexture2f;
R_Mesh_State_Texture(&m);
- RSurf_FogPassColors_Vertex3f_Color4f(mesh->vertex3f, varray_color4f, fogcolor[0], fogcolor[1], fogcolor[2], 1, r_colorscale, mesh->numverts, modelorg);
+ RSurf_FogPassColors_Vertex3f_Color4f(mesh->vertex3f, varray_color4f, fogcolor[0], fogcolor[1], fogcolor[2], 1, 1, mesh->numverts, modelorg);
R_Mesh_Draw(mesh->numverts, mesh->numtriangles, mesh->element3i);
}
}
GL_DepthMask(false);
GL_DepthTest(true);
m.tex[0] = R_GetTexture(texture->skin.glow);
- GL_Color(r_colorscale, r_colorscale, r_colorscale, 1);
+ GL_Color(1, 1, 1, 1);
while((surf = *surfchain++) != NULL)
{
if (surf->visframe == r_framecount)
GL_DepthMask(true);
m.tex[0] = R_GetTexture(texture->skin.glow);
if (m.tex[0])
- GL_Color(r_colorscale, r_colorscale, r_colorscale, 1);
+ GL_Color(1, 1, 1, 1);
else
GL_Color(0, 0, 0, 1);
while((surf = *surfchain++) != NULL)
texture = texture->anim_frames[ent->frame != 0][(texture->anim_total[ent->frame != 0] >= 2) ? ((int) (cl.time * 5.0f) % texture->anim_total[ent->frame != 0]) : 0];
currentalpha = ent->alpha;
- if (texture->flags & SURF_WATERALPHA)
- currentalpha *= r_wateralpha.value;
if (ent->effects & EF_ADDITIVE)
rendertype = SURFRENDER_ADD;
else if (currentalpha < 1 || texture->skin.fog != NULL)
else
{
// opaque lightmapped
- if (r_textureunits.integer >= 2)
+ if (r_textureunits.integer >= 3 && gl_combine.integer && r_detailtextures.integer)
+ RSurfShader_OpaqueWall_Pass_BaseTripleTexCombine(ent, texture, surfchain);
+ else if (r_textureunits.integer >= 2)
{
- if (r_textureunits.integer >= 3 && gl_combine.integer && r_detailtextures.integer)
- RSurfShader_OpaqueWall_Pass_BaseTripleTexCombine(ent, texture, surfchain);
- else
- {
- RSurfShader_OpaqueWall_Pass_BaseDoubleTex(ent, texture, surfchain);
- if (r_detailtextures.integer)
- RSurfShader_OpaqueWall_Pass_BaseDetail(ent, texture, surfchain);
- }
+ RSurfShader_OpaqueWall_Pass_BaseDoubleTex(ent, texture, surfchain);
+ if (r_detailtextures.integer)
+ RSurfShader_OpaqueWall_Pass_BaseDetail(ent, texture, surfchain);
}
else
{
R_Mesh_State_Texture(&m);
i = portal - ent->model->brushq1.portals;
- GL_Color(((i & 0x0007) >> 0) * (1.0f / 7.0f) * r_colorscale,
- ((i & 0x0038) >> 3) * (1.0f / 7.0f) * r_colorscale,
- ((i & 0x01C0) >> 6) * (1.0f / 7.0f) * r_colorscale,
+ GL_Color(((i & 0x0007) >> 0) * (1.0f / 7.0f),
+ ((i & 0x0038) >> 3) * (1.0f / 7.0f),
+ ((i & 0x01C0) >> 6) * (1.0f / 7.0f),
0.125f);
- if (PlaneDiff(r_origin, (&portal->plane)) > 0)
+ if (PlaneDiff(r_origin, (&portal->plane)) < 0)
{
for (i = portal->numpoints - 1, v = varray_vertex3f;i >= 0;i--, v += 3)
VectorCopy(portal->points[i].position, v);
{
int i;
i = ((int)brush) / sizeof(colbrushf_t);
- GL_Color((i & 31) * (1.0f / 32.0f) * r_colorscale, ((i >> 5) & 31) * (1.0f / 32.0f) * r_colorscale, ((i >> 10) & 31) * (1.0f / 32.0f) * r_colorscale, 0.2f);
+ GL_Color((i & 31) * (1.0f / 32.0f), ((i >> 5) & 31) * (1.0f / 32.0f), ((i >> 10) & 31) * (1.0f / 32.0f), 0.2f);
GL_VertexPointer(brush->points->v);
R_Mesh_Draw(brush->numpoints, brush->numtriangles, brush->elements);
}
-void R_Q3BSP_DrawFace_Mesh(entity_render_t *ent, q3mface_t *face)
+void R_Q3BSP_DrawFace(entity_render_t *ent, q3mface_t *face)
{
rmeshstate_t m;
- memset(&m, 0, sizeof(m));
- GL_BlendFunc(GL_ONE, GL_ZERO);
- GL_DepthMask(true);
- GL_DepthTest(true);
- m.tex[0] = R_GetTexture(face->texture->skin.base);
- m.pointer_texcoord[0] = face->data_texcoordtexture2f;
- if (face->lightmaptexture)
- {
- m.tex[1] = R_GetTexture(face->lightmaptexture);
- m.pointer_texcoord[1] = face->data_texcoordlightmap2f;
- m.texrgbscale[1] = 2;
- GL_Color(r_colorscale, r_colorscale, r_colorscale, 1);
- }
- else
+ if (!face->numtriangles)
+ return;
+ if (face->texture->renderflags)
{
- m.texrgbscale[0] = 2;
- GL_ColorPointer(face->data_color4f);
- }
- R_Mesh_State_Texture(&m);
- GL_VertexPointer(face->data_vertex3f);
- R_Mesh_Draw(face->numvertices, face->numtriangles, face->data_element3i);
-}
-
-#include "curves.h"
+ if (face->texture->renderflags & Q3MTEXTURERENDERFLAGS_SKY)
+ {
+ if (skyrendernow)
+ {
+ skyrendernow = false;
+ if (skyrendermasked)
+ R_Sky();
+ }
-void R_Q3BSP_DrawFace_Patch(entity_render_t *ent, q3mface_t *face)
-{
- int *e, row0, row1, finalwidth, finalheight, x, y, xlevel = r_curves_subdivide_level.integer, ylevel = r_curves_subdivide_level.integer;
- rmeshstate_t m;
+ R_Mesh_Matrix(&ent->matrix);
- finalwidth = ((face->patchsize[0] - 1) << xlevel) + 1;
- finalheight = ((face->patchsize[1] - 1) << ylevel) + 1;
+ GL_Color(fogcolor[0], fogcolor[1], fogcolor[2], 1);
+ if (skyrendermasked)
+ {
+ // depth-only (masking)
+ qglColorMask(0,0,0,0);
+ // just to make sure that braindead drivers don't draw anything
+ // despite that colormask...
+ GL_BlendFunc(GL_ZERO, GL_ONE);
+ }
+ else
+ {
+ // fog sky
+ GL_BlendFunc(GL_ONE, GL_ZERO);
+ }
+ GL_DepthMask(true);
+ GL_DepthTest(true);
- // generate vertex arrays
- QuadraticSplinePatchSubdivideFloatBuffer(face->patchsize[0], face->patchsize[1], xlevel, ylevel, 3, face->data_vertex3f, varray_vertex3f);
- QuadraticSplinePatchSubdivideFloatBuffer(face->patchsize[0], face->patchsize[1], xlevel, ylevel, 2, face->data_texcoordtexture2f, varray_texcoord2f[0]);
- if (face->lightmaptexture)
- QuadraticSplinePatchSubdivideFloatBuffer(face->patchsize[0], face->patchsize[1], xlevel, ylevel, 2, face->data_texcoordlightmap2f, varray_texcoord2f[1]);
- else
- QuadraticSplinePatchSubdivideFloatBuffer(face->patchsize[0], face->patchsize[1], xlevel, ylevel, 4, face->data_color4f, varray_color4f);
+ memset(&m, 0, sizeof(m));
+ R_Mesh_State_Texture(&m);
- // generate elements
- e = earray_element3i;
- for (y = 0;y < finalheight - 1;y++)
- {
- row0 = (y + 0) * finalwidth;
- row1 = (y + 1) * finalwidth;
- for (x = 0;x < finalwidth - 1;x++)
- {
- *e++ = row0;
- *e++ = row1;
- *e++ = row0 + 1;
- *e++ = row1;
- *e++ = row1 + 1;
- *e++ = row0 + 1;
- row0++;
- row1++;
+ GL_VertexPointer(face->data_vertex3f);
+ R_Mesh_Draw(face->numvertices, face->numtriangles, face->data_element3i);
+ qglColorMask(1,1,1,1);
+ return;
}
+ if (face->texture->renderflags & Q3MTEXTURERENDERFLAGS_NODRAW)
+ return;
}
- for (x = 0;x < (finalwidth-1)*(finalheight-1)*6;x++)
- if ((unsigned int)earray_element3i[x] >= (unsigned int)(finalwidth*finalheight))
- Con_Printf("e[%i] = %i (> %i)\n", x, earray_element3i[x], finalwidth*finalheight);
-
+ R_Mesh_Matrix(&ent->matrix);
+ face->visframe = r_framecount;
memset(&m, 0, sizeof(m));
GL_BlendFunc(GL_ONE, GL_ZERO);
GL_DepthMask(true);
GL_DepthTest(true);
m.tex[0] = R_GetTexture(face->texture->skin.base);
- m.pointer_texcoord[0] = varray_texcoord2f[0];
+ m.pointer_texcoord[0] = face->data_texcoordtexture2f;
if (face->lightmaptexture)
{
m.tex[1] = R_GetTexture(face->lightmaptexture);
- m.pointer_texcoord[1] = varray_texcoord2f[1];
+ m.pointer_texcoord[1] = face->data_texcoordlightmap2f;
m.texrgbscale[1] = 2;
- GL_Color(r_colorscale, r_colorscale, r_colorscale, 1);
+ GL_Color(1, 1, 1, 1);
}
else
{
m.texrgbscale[0] = 2;
- GL_ColorPointer(varray_color4f);
+ GL_ColorPointer(face->data_color4f);
}
R_Mesh_State_Texture(&m);
- GL_VertexPointer(varray_vertex3f);
- R_Mesh_Draw(finalwidth * finalheight, (finalwidth - 1) * (finalheight - 1) * 2, earray_element3i);
-}
-
-void R_Q3BSP_DrawFace(entity_render_t *ent, q3mface_t *face)
-{
- if (face->texture->renderflags & Q3MTEXTURERENDERFLAGS_NODRAW)
- return;
- switch(face->type)
- {
- case Q3FACETYPE_POLYGON:
- case Q3FACETYPE_MESH:
- R_Q3BSP_DrawFace_Mesh(ent, face);
- break;
- case Q3FACETYPE_PATCH:
- R_Q3BSP_DrawFace_Patch(ent, face);
- break;
- case Q3FACETYPE_FLARE:
- break;
- }
+ GL_VertexPointer(face->data_vertex3f);
+ R_Mesh_Draw(face->numvertices, face->numtriangles, face->data_element3i);
}
/*
{
int i;
q3mleaf_t *leaf;
+ q3mface_t *face;
while (node->isnode)
{
if (R_CullBox(node->mins, node->maxs))
{
for (i = 0;i < leaf->numleaffaces;i++)
{
- if (leaf->firstleafface[i]->markframe != markframe)
+ face = leaf->firstleafface[i];
+ if (face->markframe != markframe)
{
- leaf->firstleafface[i]->markframe = markframe;
- R_Q3BSP_DrawFace(ent, leaf->firstleafface[i]);
+ face->markframe = markframe;
+ if (!R_CullBox(face->mins, face->maxs))
+ R_Q3BSP_DrawFace(ent, face);
}
}
}
model = ent->model;
if (r_drawcollisionbrushes.integer < 2)
{
- if (ent == &cl_entities[0].render && model->brushq3.num_pvsclusters && !r_novis.integer)
- {
- Matrix4x4_Transform(&ent->inversematrix, r_origin, modelorg);
- pvs = model->brush.GetPVS(model, modelorg);
+ Matrix4x4_Transform(&ent->inversematrix, r_origin, modelorg);
+ if (ent == &cl_entities[0].render && model->brushq3.num_pvsclusters && !r_novis.integer && (pvs = model->brush.GetPVS(model, modelorg)))
R_Q3BSP_RecursiveWorldNode(ent, model->brushq3.data_nodes, modelorg, pvs, ++markframe);
- }
else
for (i = 0, face = model->brushq3.data_thismodel->firstface;i < model->brushq3.data_thismodel->numfaces;i++, face++)
R_Q3BSP_DrawFace(ent, face);
}
*/
-/*
void R_Q3BSP_DrawShadowVolume(entity_render_t *ent, vec3_t relativelightorigin, float lightradius)
{
+ int i;
+ q3mface_t *face;
+ vec3_t modelorg, lightmins, lightmaxs;
+ model_t *model;
+ float projectdistance;
+ projectdistance = 1000000000.0f;//lightradius + ent->model->radius;
+ if (r_drawcollisionbrushes.integer < 2)
+ {
+ model = ent->model;
+ R_Mesh_Matrix(&ent->matrix);
+ Matrix4x4_Transform(&ent->inversematrix, r_origin, modelorg);
+ lightmins[0] = relativelightorigin[0] - lightradius;
+ lightmins[1] = relativelightorigin[1] - lightradius;
+ lightmins[2] = relativelightorigin[2] - lightradius;
+ lightmaxs[0] = relativelightorigin[0] + lightradius;
+ lightmaxs[1] = relativelightorigin[1] + lightradius;
+ lightmaxs[2] = relativelightorigin[2] + lightradius;
+ //if (ent == &cl_entities[0].render && model->brushq3.num_pvsclusters && !r_novis.integer && (pvs = model->brush.GetPVS(model, modelorg)))
+ // R_Q3BSP_RecursiveWorldNode(ent, model->brushq3.data_nodes, modelorg, pvs, ++markframe);
+ //else
+ for (i = 0, face = model->brushq3.data_thismodel->firstface;i < model->brushq3.data_thismodel->numfaces;i++, face++)
+ if (BoxesOverlap(lightmins, lightmaxs, face->mins, face->maxs))
+ R_Shadow_Volume(face->numvertices, face->numtriangles, face->data_vertex3f, face->data_element3i, face->data_neighbor3i, relativelightorigin, lightradius, projectdistance);
+ }
+}
+
+void R_Q3BSP_DrawFaceLight(entity_render_t *ent, q3mface_t *face, vec3_t relativelightorigin, vec3_t relativeeyeorigin, float lightradius, float *lightcolor, const matrix4x4_t *matrix_modeltofilter, const matrix4x4_t *matrix_modeltoattenuationxyz, const matrix4x4_t *matrix_modeltoattenuationz)
+{
+ if ((face->texture->renderflags & Q3MTEXTURERENDERFLAGS_NODRAW) || !face->numtriangles)
+ return;
+ R_Shadow_DiffuseLighting(face->numvertices, face->numtriangles, face->data_element3i, face->data_vertex3f, face->data_svector3f, face->data_tvector3f, face->data_normal3f, face->data_texcoordtexture2f, relativelightorigin, lightradius, lightcolor, matrix_modeltofilter, matrix_modeltoattenuationxyz, matrix_modeltoattenuationz, face->texture->skin.base, face->texture->skin.nmap, NULL);
+ R_Shadow_SpecularLighting(face->numvertices, face->numtriangles, face->data_element3i, face->data_vertex3f, face->data_svector3f, face->data_tvector3f, face->data_normal3f, face->data_texcoordtexture2f, relativelightorigin, relativeeyeorigin, lightradius, lightcolor, matrix_modeltofilter, matrix_modeltoattenuationxyz, matrix_modeltoattenuationz, face->texture->skin.gloss, face->texture->skin.nmap, NULL);
}
-*/
-/*
void R_Q3BSP_DrawLight(entity_render_t *ent, vec3_t relativelightorigin, vec3_t relativeeyeorigin, float lightradius, float *lightcolor, const matrix4x4_t *matrix_modeltofilter, const matrix4x4_t *matrix_modeltoattenuationxyz, const matrix4x4_t *matrix_modeltoattenuationz)
{
+ int i;
+ q3mface_t *face;
+ vec3_t modelorg, lightmins, lightmaxs;
+ model_t *model;
+ //qbyte *pvs;
+ //static int markframe = 0;
+ if (r_drawcollisionbrushes.integer < 2)
+ {
+ model = ent->model;
+ R_Mesh_Matrix(&ent->matrix);
+ Matrix4x4_Transform(&ent->inversematrix, r_origin, modelorg);
+ lightmins[0] = relativelightorigin[0] - lightradius;
+ lightmins[1] = relativelightorigin[1] - lightradius;
+ lightmins[2] = relativelightorigin[2] - lightradius;
+ lightmaxs[0] = relativelightorigin[0] + lightradius;
+ lightmaxs[1] = relativelightorigin[1] + lightradius;
+ lightmaxs[2] = relativelightorigin[2] + lightradius;
+ //if (ent == &cl_entities[0].render && model->brushq3.num_pvsclusters && !r_novis.integer && (pvs = model->brush.GetPVS(model, modelorg)))
+ // R_Q3BSP_RecursiveWorldNode(ent, model->brushq3.data_nodes, modelorg, pvs, ++markframe);
+ //else
+ for (i = 0, face = model->brushq3.data_thismodel->firstface;i < model->brushq3.data_thismodel->numfaces;i++, face++)
+ if ((ent != &cl_entities[0].render || face->visframe == r_framecount) && BoxesOverlap(lightmins, lightmaxs, face->mins, face->maxs))
+ R_Q3BSP_DrawFaceLight(ent, face, relativelightorigin, relativeeyeorigin, lightradius, lightcolor, matrix_modeltofilter, matrix_modeltoattenuationxyz, matrix_modeltoattenuationz);
+ }
}
-*/
static void gl_surf_start(void)
{
Cvar_RegisterVariable(&r_floatbuildlightmap);
Cvar_RegisterVariable(&r_detailtextures);
Cvar_RegisterVariable(&r_surfaceworldnode);
- Cvar_RegisterVariable(&r_curves_subdivide_level);
+ Cvar_RegisterVariable(&r_drawcollisionbrushes_polygonoffset);
R_RegisterModule("GL_Surf", gl_surf_start, gl_surf_shutdown, gl_surf_newmap);
}