#define MAX_LIGHTMAP_SIZE 256
-cvar_t r_ambient = {0, "r_ambient", "0", "brighter world cheat (not allowed in multiplayer), value is 0-128"};
+cvar_t r_ambient = {0, "r_ambient", "0", "brightens map, value is 0-128"};
cvar_t r_lockpvs = {0, "r_lockpvs", "0", "disables pvs switching, allows you to walk around and inspect what is visible from a given location in the map (anything not visible from your current location will not be drawn)"};
cvar_t r_lockvisibility = {0, "r_lockvisibility", "0", "disables visibility updates, allows you to walk around and inspect what is visible from a given viewpoint in the map (anything offscreen at the moment this is enabled will not be drawn)"};
cvar_t r_useportalculling = {0, "r_useportalculling", "1", "use advanced portal culling visibility method to improve performance over just Potentially Visible Set, provides an even more significant speed improvement in unvised maps"};
CHECKGLERROR
GL_BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
GL_DepthMask(false);
+ GL_DepthRange(0, 1);
GL_DepthTest(true);
GL_CullFace(GL_NONE);
R_Mesh_Matrix(&identitymatrix);
model_t *model = ent->model;
msurface_t *surface;
int i, k, l, m, mend, endsurface, batchnumsurfaces, batchnumtriangles, batchfirstvertex, batchlastvertex;
- qboolean usebufferobject;
+ qboolean usebufferobject, culltriangles;
const int *element3i;
msurface_t *batchsurfacelist[RSURF_MAX_BATCHSURFACES];
int batchelements[BATCHSIZE*3];
RSurf_ActiveModelEntity(ent, true, true);
R_UpdateAllTextureInfo(ent);
CHECKGLERROR
+ culltriangles = r_shadow_culltriangles.integer && !(ent->flags & RENDER_NOSELFSHADOW);
element3i = rsurface_model->surfmesh.data_element3i;
// this is a double loop because non-visible surface skipping has to be
// fast, and even if this is not the world model (and hence no visibility
rsurface_texture = tex->currentframe;
if (rsurface_texture->currentmaterialflags & (MATERIALFLAG_WALL | MATERIALFLAG_WATER))
{
- if (rsurface_texture->currentmaterialflags & MATERIALFLAG_BLENDED)
+ if (rsurface_texture->currentmaterialflags & MATERIALFLAGMASK_DEPTHSORTED)
{
vec3_t tempcenter, center;
for (l = k;l < batchnumsurfaces && tex == batchsurfacelist[l]->texture;l++)
RSurf_PrepareVerticesForBatch(true, true, 1, &surface);
for (m = surface->num_firsttriangle, mend = m + surface->num_triangles;m < mend;m++)
{
- if (r_shadow_culltriangles.integer)
+ if (culltriangles)
{
if (trispvs)
{
texture_t *t;
int i;
const char *r, *newt;
+ skinframe_t *skinframe;
m = r_refdef.worldmodel;
if(Cmd_Argc() < 2)
{
if(t->width && !strcasecmp(t->name, r))
{
- if(Mod_LoadSkinFrame(&t->skinframes[0], (char*)newt, TEXF_MIPMAP | TEXF_ALPHA | TEXF_PRECACHE | TEXF_PICMIP, false, r_fullbrights.integer))
+ if ((skinframe = R_SkinFrame_LoadExternal((char*)newt, TEXF_MIPMAP | TEXF_ALPHA | TEXF_PRECACHE | TEXF_PICMIP)))
{
+ t->skinframes[0] = skinframe;
Con_Printf("%s replaced with %s\n", r, newt);
return;
}
else
{
Con_Printf("%s was not found\n", newt);
- Mod_LoadSkinFrame(&t->skinframes[0], (char*)r, TEXF_MIPMAP | TEXF_ALPHA | TEXF_PRECACHE | TEXF_PICMIP, false, r_fullbrights.integer);//back to default
return;
}
}