mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-23 12:22:42 +00:00
A bugfix and a slightly more efficient rendering thingie.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1399 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
710d7aa3ed
commit
e91c945952
1 changed files with 36 additions and 21 deletions
|
@ -42,6 +42,7 @@ extern cvar_t r_shadow_glsl_offsetmapping_bias;
|
||||||
extern int detailtexture;
|
extern int detailtexture;
|
||||||
extern cvar_t gl_bump;
|
extern cvar_t gl_bump;
|
||||||
extern cvar_t gl_specular;
|
extern cvar_t gl_specular;
|
||||||
|
extern cvar_t gl_mylumassuck;
|
||||||
//end header confict
|
//end header confict
|
||||||
|
|
||||||
extern cvar_t gl_schematics;
|
extern cvar_t gl_schematics;
|
||||||
|
@ -396,6 +397,8 @@ static void PPL_BaseChain_NoBump_2TMU_Overbright(msurface_t *s, texture_t *tex)
|
||||||
GL_SelectTexture(GL_TEXTURE1_ARB);
|
GL_SelectTexture(GL_TEXTURE1_ARB);
|
||||||
qglEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
qglEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||||
|
|
||||||
|
GL_TexEnv(GL_MODULATE);
|
||||||
|
|
||||||
|
|
||||||
if (overbright != 1)
|
if (overbright != 1)
|
||||||
{
|
{
|
||||||
|
@ -1174,7 +1177,7 @@ static void PPL_BaseChain_Flat(msurface_t *first)
|
||||||
for (s = first; s ; s=s->texturechain)
|
for (s = first; s ; s=s->texturechain)
|
||||||
PPL_GenerateArrays(s);
|
PPL_GenerateArrays(s);
|
||||||
PPL_FlushArrays();
|
PPL_FlushArrays();
|
||||||
qglEnable(GL_TEXTURE_2D); //texturing? who wants texturing?!?!
|
qglEnable(GL_TEXTURE_2D);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1207,19 +1210,22 @@ static void PPL_BaseChain_Flat(msurface_t *first)
|
||||||
|
|
||||||
PPL_EnableVertexArrays();
|
PPL_EnableVertexArrays();
|
||||||
GL_TexEnv(GL_MODULATE);
|
GL_TexEnv(GL_MODULATE);
|
||||||
qglEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
|
||||||
qglTexCoordPointer(2, GL_FLOAT, sizeof(surfvertexarray_t), varray_v->stl);
|
|
||||||
|
|
||||||
for (s = first; s ; s=s->texturechain)
|
for (s = first; s ; s=s->texturechain)
|
||||||
{
|
{
|
||||||
if (vi != s->lightmaptexturenum)
|
if (vi != s->lightmaptexturenum)
|
||||||
{
|
{
|
||||||
PPL_FlushArrays();
|
|
||||||
if (vi < 0)
|
if (vi < 0)
|
||||||
|
{
|
||||||
qglEnable(GL_TEXTURE_2D);
|
qglEnable(GL_TEXTURE_2D);
|
||||||
else if (s->lightmaptexturenum < 0)
|
qglEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||||
qglDisable(GL_TEXTURE_2D);
|
}
|
||||||
vi = s->lightmaptexturenum;
|
vi = s->lightmaptexturenum;
|
||||||
|
if (s->lightmaptexturenum < 0)
|
||||||
|
{
|
||||||
|
qglDisable(GL_TEXTURE_2D);
|
||||||
|
qglDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||||
|
}
|
||||||
|
|
||||||
if (vi>=0)
|
if (vi>=0)
|
||||||
{
|
{
|
||||||
|
@ -1243,21 +1249,21 @@ static void PPL_BaseChain_Flat(msurface_t *first)
|
||||||
{
|
{
|
||||||
if (iswall != 0)
|
if (iswall != 0)
|
||||||
{
|
{
|
||||||
PPL_FlushArrays();
|
|
||||||
iswall=0;
|
iswall=0;
|
||||||
qglColor4fv(wallcolour);
|
qglColor4fv(wallcolour);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (iswall != 1)
|
else if (iswall != 1)
|
||||||
{
|
{
|
||||||
PPL_FlushArrays();
|
|
||||||
iswall=1;
|
iswall=1;
|
||||||
qglColor4fv(floorcolour);
|
qglColor4fv(floorcolour);
|
||||||
}
|
}
|
||||||
PPL_GenerateArrays(s);
|
|
||||||
|
qglTexCoordPointer(2, GL_FLOAT, 0, s->mesh->lmst_array);
|
||||||
|
qglVertexPointer(3, GL_FLOAT, 0, s->mesh->xyz_array);
|
||||||
|
qglDrawRangeElements(GL_TRIANGLES, 0, s->mesh->numvertexes, s->mesh->numindexes, GL_UNSIGNED_INT, s->mesh->indexes);
|
||||||
}
|
}
|
||||||
|
|
||||||
PPL_FlushArrays();
|
|
||||||
qglDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
qglDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||||
qglColor3f(1,1,1);
|
qglColor3f(1,1,1);
|
||||||
}
|
}
|
||||||
|
@ -1587,7 +1593,9 @@ static void PPL_FullBrightTextureChain(msurface_t *first)
|
||||||
if (t->gl_texturenumfb && r_fb_bmodels.value && cls.allow_luma)
|
if (t->gl_texturenumfb && r_fb_bmodels.value && cls.allow_luma)
|
||||||
{
|
{
|
||||||
GL_Bind(t->gl_texturenumfb);
|
GL_Bind(t->gl_texturenumfb);
|
||||||
qglBlendFunc(GL_ONE, GL_ONE);
|
qglBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||||
|
if (gl_mylumassuck.value)
|
||||||
|
qglEnable(GL_ALPHA_TEST);
|
||||||
|
|
||||||
PPL_EnableVertexArrays();
|
PPL_EnableVertexArrays();
|
||||||
qglEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
qglEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||||
|
@ -1597,6 +1605,9 @@ static void PPL_FullBrightTextureChain(msurface_t *first)
|
||||||
PPL_GenerateArrays(s);
|
PPL_GenerateArrays(s);
|
||||||
}
|
}
|
||||||
PPL_FlushArrays();
|
PPL_FlushArrays();
|
||||||
|
|
||||||
|
if (gl_mylumassuck.value)
|
||||||
|
qglDisable(GL_ALPHA_TEST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1704,24 +1715,26 @@ void PPL_BaseBModelTextures(entity_t *e)
|
||||||
|
|
||||||
// calculate dynamic lighting for bmodel if it's not an
|
// calculate dynamic lighting for bmodel if it's not an
|
||||||
// instanced model
|
// instanced model
|
||||||
if (currentmodel->nummodelsurfaces != 0 && r_dynamic.value)
|
if (model->fromgame != fg_quake3)
|
||||||
{
|
{
|
||||||
for (k=0 ; k<MAX_SWLIGHTS ; k++)
|
if (currentmodel->nummodelsurfaces != 0 && r_dynamic.value)
|
||||||
{
|
{
|
||||||
if (!cl_dlights[k].radius)
|
for (k=0 ; k<MAX_SWLIGHTS ; k++)
|
||||||
continue;
|
{
|
||||||
if (cl_dlights[k].nodynamic)
|
if (!cl_dlights[k].radius)
|
||||||
continue;
|
continue;
|
||||||
|
if (cl_dlights[k].nodynamic)
|
||||||
|
continue;
|
||||||
|
|
||||||
currentmodel->funcs.MarkLights (&cl_dlights[k], 1<<k,
|
currentmodel->funcs.MarkLights (&cl_dlights[k], 1<<k,
|
||||||
currentmodel->nodes + currentmodel->hulls[0].firstclipnode);
|
currentmodel->nodes + currentmodel->hulls[0].firstclipnode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
//update lightmaps.
|
//update lightmaps.
|
||||||
if (model->fromgame != fg_quake3)
|
|
||||||
for (s = model->surfaces+model->firstmodelsurface,i = 0; i < model->nummodelsurfaces; i++, s++)
|
for (s = model->surfaces+model->firstmodelsurface,i = 0; i < model->nummodelsurfaces; i++, s++)
|
||||||
R_RenderDynamicLightmaps (s);
|
R_RenderDynamicLightmaps (s);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
for (s = model->surfaces+model->firstmodelsurface,i = 0; i < model->nummodelsurfaces; i++, s++)
|
for (s = model->surfaces+model->firstmodelsurface,i = 0; i < model->nummodelsurfaces; i++, s++)
|
||||||
|
@ -1755,6 +1768,7 @@ void PPL_BaseBModelTextures(entity_t *e)
|
||||||
R_IBrokeTheArrays();
|
R_IBrokeTheArrays();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef Q3SHADERS
|
||||||
void R_DrawLightning(entity_t *e)
|
void R_DrawLightning(entity_t *e)
|
||||||
{
|
{
|
||||||
vec3_t v;
|
vec3_t v;
|
||||||
|
@ -1889,6 +1903,7 @@ void R_DrawRailCore(entity_t *e)
|
||||||
|
|
||||||
R_RenderMeshBuffer ( &mb, false );
|
R_RenderMeshBuffer ( &mb, false );
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point, float degrees );
|
void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point, float degrees );
|
||||||
void PerpendicularVector( vec3_t dst, const vec3_t src );
|
void PerpendicularVector( vec3_t dst, const vec3_t src );
|
||||||
|
|
Loading…
Reference in a new issue