// transparent stuff can't be lit during the opaque stage
if (e->render.effects & (EF_ADDITIVE | EF_NODEPTHTEST) || e->render.alpha < 1)
e->render.flags |= RENDER_TRANSPARENT;
+ // double sided rendering mode causes backfaces to be visible
+ // (mostly useful on transparent stuff)
+ if (e->render.effects & EF_DOUBLESIDED)
+ e->render.flags |= RENDER_NOCULLFACE;
// either fullbright or lit
if (!(e->render.effects & EF_FULLBRIGHT) && !r_fullbright.integer)
e->render.flags |= RENDER_LIGHT;
// FIXME: identify models using a better check than ent->model->brush.shadowmesh
lightmode = ((ent->effects & EF_FULLBRIGHT) || ent->model->brush.shadowmesh) ? 0 : 2;
GL_DepthTest(!(texture->currentmaterialflags & MATERIALFLAG_NODEPTHTEST));
- if (texture->textureflags & Q3TEXTUREFLAG_TWOSIDED)
+ if ((texture->textureflags & Q3TEXTUREFLAG_TWOSIDED) || (ent->flags & RENDER_NOCULLFACE))
qglDisable(GL_CULL_FACE);
if (texture->currentnumlayers)
{
}
}
}
- if (texture->textureflags & Q3TEXTUREFLAG_TWOSIDED)
+ if ((texture->textureflags & Q3TEXTUREFLAG_TWOSIDED) || (ent->flags & RENDER_NOCULLFACE))
qglEnable(GL_CULL_FACE);
}
texture = surface->texture;
if ((texture->basematerialflags & (MATERIALFLAG_NODRAW | MATERIALFLAG_TRANSPARENT | MATERIALFLAG_WALL)) != MATERIALFLAG_WALL)
continue;
- if (texture->textureflags & (Q3TEXTUREFLAG_TWOSIDED | Q3TEXTUREFLAG_AUTOSPRITE | Q3TEXTUREFLAG_AUTOSPRITE2))
+ if ((texture->textureflags & (Q3TEXTUREFLAG_TWOSIDED | Q3TEXTUREFLAG_AUTOSPRITE | Q3TEXTUREFLAG_AUTOSPRITE2)) || (ent->flags & RENDER_NOCULLFACE))
continue;
R_Shadow_MarkVolumeFromBox(surface->num_firstshadowmeshtriangle, surface->num_triangles, model->brush.shadowmesh->vertex3f, model->brush.shadowmesh->element3i, relativelightorigin, r_shadow_compilingrtlight->cullmins, r_shadow_compilingrtlight->cullmaxs, surface->mins, surface->maxs);
}
texture = surface->texture->currentframe;
if ((texture->currentmaterialflags & (MATERIALFLAG_NODRAW | MATERIALFLAG_TRANSPARENT | MATERIALFLAG_WALL)) != MATERIALFLAG_WALL)
continue;
- if (texture->textureflags & (Q3TEXTUREFLAG_TWOSIDED | Q3TEXTUREFLAG_AUTOSPRITE | Q3TEXTUREFLAG_AUTOSPRITE2))
+ if ((texture->textureflags & (Q3TEXTUREFLAG_TWOSIDED | Q3TEXTUREFLAG_AUTOSPRITE | Q3TEXTUREFLAG_AUTOSPRITE2)) || (ent->flags & RENDER_NOCULLFACE))
continue;
R_Shadow_MarkVolumeFromBox(surface->num_firstshadowmeshtriangle, surface->num_triangles, model->brush.shadowmesh->vertex3f, model->brush.shadowmesh->element3i, relativelightorigin, lightmins, lightmaxs, surface->mins, surface->maxs);
}
#define EF_NOSHADOW 4096 // LordHavoc: does not cast a shadow
#define EF_NODEPTHTEST 8192 // LordHavoc: shows through walls
#define EF_SELECTABLE 16384 // LordHavoc: highlights when PRYDON_CLIENTCURSOR mouse is over it
+#define EF_DOUBLESIDED 32768 //[515]: disable cull face for this entity
#define EF_STEP 0x80000000 // internal client use only - present on MOVETYPE_STEP entities, not QC accessible (too many bits)
#define RENDER_SHADOW 65536 // cast shadow
#define RENDER_LIGHT 131072 // receive light
#define RENDER_TRANSPARENT 262144 // can't light during opaque stage
+#define RENDER_NOCULLFACE 524288 // render as double sided (disable GL_CULL_FACE)
// this is 80 bytes
typedef struct entity_state_s
rtexture_t *basetexture;
rtexture_t *glosstexture;
float specularscale;
- if (texture->textureflags & Q3TEXTUREFLAG_TWOSIDED)
+ if ((texture->textureflags & Q3TEXTUREFLAG_TWOSIDED) || (ent->flags & RENDER_NOCULLFACE))
qglDisable(GL_CULL_FACE);
else
qglEnable(GL_CULL_FACE);