}
}
-static cvar_t r_drawparticles = {0, "r_drawparticles", "1", "enables drawing of particles"};
+cvar_t r_drawparticles = {0, "r_drawparticles", "1", "enables drawing of particles"};
static cvar_t r_drawparticles_drawdistance = {CVAR_SAVE, "r_drawparticles_drawdistance", "2000", "particles further than drawdistance*size will not be drawn"};
static cvar_t r_drawparticles_nearclip_min = {CVAR_SAVE, "r_drawparticles_nearclip_min", "4", "particles closer than drawnearclip_min will not be drawn"};
static cvar_t r_drawparticles_nearclip_max = {CVAR_SAVE, "r_drawparticles_nearclip_max", "4", "particles closer than drawnearclip_min will be faded"};
-static cvar_t r_drawdecals = {0, "r_drawdecals", "1", "enables drawing of decals"};
+cvar_t r_drawdecals = {0, "r_drawdecals", "1", "enables drawing of decals"};
static cvar_t r_drawdecals_drawdistance = {CVAR_SAVE, "r_drawdecals_drawdistance", "500", "decals further than drawdistance*size will not be drawn"};
#define PARTICLETEXTURESIZE 64
* has to detect input the client sent before it received the origin
* update, but after the warp occurred on the server, and has to adjust
* input appropriately.
- */
+ */
matrix4x4_t m;
vec3_t v = {0, 0, 0};
vec3_t x, y, z;
CL_RotateMoves(&m);
}
+// #358 void(string cubemapname) loadcubemap
+static void VM_CL_loadcubemap(void)
+{
+ const char *name;
+
+ VM_SAFEPARMCOUNT(1, VM_CL_loadcubemap);
+ name = PRVM_G_STRING(OFS_PARM0);
+ R_GetCubemap(name);
+}
+
//============================================================================
// To create a almost working builtin file from this replace:
VM_CL_videoplaying, // #355
VM_findfont, // #356 float(string fontname) loadfont (DP_GFX_FONTS)
VM_loadfont, // #357 float(string fontname, string fontmaps, string sizes, float slot) loadfont (DP_GFX_FONTS)
-NULL, // #358
+VM_CL_loadcubemap, // #358 void(string cubemapname) loadcubemap (DP_GFX_)
NULL, // #359
VM_CL_ReadByte, // #360 float() readbyte (EXT_CSQC)
VM_CL_ReadChar, // #361 float() readchar (EXT_CSQC)
cvar_t r_water_refractdistort = {CVAR_SAVE, "r_water_refractdistort", "0.01", "how much water refractions shimmer"};
cvar_t r_water_reflectdistort = {CVAR_SAVE, "r_water_reflectdistort", "0.01", "how much water reflections shimmer"};
cvar_t r_water_scissormode = {0, "r_water_scissormode", "3", "scissor (1) or cull (2) or both (3) water renders"};
+cvar_t r_water_lowquality = {0, "r_water_lowquality", "0", "special option to accelerate water rendering, 1 disables shadows and particles, 2 disables all dynamic lights"};
cvar_t r_lerpsprites = {CVAR_SAVE, "r_lerpsprites", "0", "enables animation smoothing on sprites"};
cvar_t r_lerpmodels = {CVAR_SAVE, "r_lerpmodels", "1", "enables animation smoothing on models"};
Cvar_RegisterVariable(&r_water_refractdistort);
Cvar_RegisterVariable(&r_water_reflectdistort);
Cvar_RegisterVariable(&r_water_scissormode);
+ Cvar_RegisterVariable(&r_water_lowquality);
+
Cvar_RegisterVariable(&r_lerpsprites);
Cvar_RegisterVariable(&r_lerpmodels);
Cvar_RegisterVariable(&r_lerplightstyles);
}
}
+extern cvar_t r_drawparticles;
+extern cvar_t r_drawdecals;
+
static void R_Water_ProcessPlanes(void)
{
int myscissor[4];
r_refdef_view_t originalview;
r_refdef_view_t myview;
- int planeindex;
+ int planeindex, qualityreduction = 0, old_r_dynamic = 0, old_r_shadows = 0, old_r_worldrtlight = 0, old_r_dlight = 0, old_r_particles = 0, old_r_decals = 0;
r_waterstate_waterplane_t *p;
vec3_t visorigin;
originalview = r_refdef.view;
+ // lowquality hack, temporarily shut down some cvars and restore afterwards
+ qualityreduction = r_water_lowquality.integer;
+ if (qualityreduction > 0)
+ {
+ if (qualityreduction >= 1)
+ {
+ old_r_shadows = r_shadows.integer;
+ old_r_worldrtlight = r_shadow_realtime_world.integer;
+ old_r_dlight = r_shadow_realtime_dlight.integer;
+ Cvar_SetValueQuick(&r_shadows, 0);
+ Cvar_SetValueQuick(&r_shadow_realtime_world, 0);
+ Cvar_SetValueQuick(&r_shadow_realtime_dlight, 0);
+ }
+ if (qualityreduction >= 2)
+ {
+ old_r_dynamic = r_dynamic.integer;
+ old_r_particles = r_drawparticles.integer;
+ old_r_decals = r_drawdecals.integer;
+ Cvar_SetValueQuick(&r_dynamic, 0);
+ Cvar_SetValueQuick(&r_drawparticles, 0);
+ Cvar_SetValueQuick(&r_drawdecals, 0);
+ }
+ }
+
// make sure enough textures are allocated
for (planeindex = 0, p = r_waterstate.waterplanes;planeindex < r_waterstate.numwaterplanes;planeindex++, p++)
{
R_ResetViewRendering3D();
R_ClearScreen(r_refdef.fogenabled);
R_View_Update();
- return;
+ goto finish;
error:
r_refdef.view = originalview;
r_waterstate.renderingscene = false;
Cvar_SetValueQuick(&r_water, 0);
Con_Printf("R_Water_ProcessPlanes: Error: texture creation failed! Turned off r_water.\n");
- return;
+finish:
+ // lowquality hack, restore cvars
+ if (qualityreduction > 0)
+ {
+ if (qualityreduction >= 1)
+ {
+ Cvar_SetValueQuick(&r_shadows, old_r_shadows);
+ Cvar_SetValueQuick(&r_shadow_realtime_world, old_r_worldrtlight);
+ Cvar_SetValueQuick(&r_shadow_realtime_dlight, old_r_dlight);
+ }
+ if (qualityreduction >= 2)
+ {
+ Cvar_SetValueQuick(&r_dynamic, old_r_dynamic);
+ Cvar_SetValueQuick(&r_drawparticles, old_r_particles);
+ Cvar_SetValueQuick(&r_drawdecals, old_r_decals);
+ }
+ }
}
void R_Bloom_StartFrame(void)
cvar_t gl_texturecompression_sky = {CVAR_SAVE, "gl_texturecompression_sky", "0", "whether to compress sky textures"};
cvar_t gl_texturecompression_lightcubemaps = {CVAR_SAVE, "gl_texturecompression_lightcubemaps", "1", "whether to compress light cubemaps (spotlights and other light projection images)"};
cvar_t gl_texturecompression_reflectmask = {CVAR_SAVE, "gl_texturecompression_reflectmask", "1", "whether to compress reflection cubemap masks (mask of which areas of the texture should reflect the generic shiny cubemap)"};
+cvar_t gl_texturecompression_sprites = {CVAR_SAVE, "gl_texturecompression_sprites", "1", "whether to compress sprites"};
cvar_t gl_nopartialtextureupdates = {CVAR_SAVE, "gl_nopartialtextureupdates", "0", "use alternate path for dynamic lightmap updates that avoids a possibly slow code path in the driver"};
cvar_t r_texture_dds_load_alphamode = {0, "r_texture_dds_load_alphamode", "1", "0: trust DDPF_ALPHAPIXELS flag, 1: texture format and brute force search if ambiguous, 2: texture format only"};
cvar_t r_texture_dds_load_logfailure = {0, "r_texture_dds_load_logfailure", "1", "log missing DDS textures to ddstexturefailures.log"};
Cvar_RegisterVariable (&gl_texturecompression_sky);
Cvar_RegisterVariable (&gl_texturecompression_lightcubemaps);
Cvar_RegisterVariable (&gl_texturecompression_reflectmask);
+ Cvar_RegisterVariable (&gl_texturecompression_sprites);
Cvar_RegisterVariable (&gl_nopartialtextureupdates);
Cvar_RegisterVariable (&r_texture_dds_load_alphamode);
Cvar_RegisterVariable (&r_texture_dds_load_logfailure);
texture->supercontents |= SUPERCONTENTS_OPAQUE;
}
+extern cvar_t gl_texturecompression_sprites;
+
static void Mod_Sprite_SharedSetup(const unsigned char *datapointer, int version, const unsigned int *palette, qboolean additive)
{
int i, j, groupframes, realframes, x, y, origin[2], width, height;
float modelradius, interval;
char name[MAX_QPATH], fogname[MAX_QPATH];
const void *startframes;
- int texflags = (r_mipsprites.integer ? TEXF_MIPMAP : 0) | TEXF_ISSPRITE | TEXF_PICMIP | TEXF_ALPHA | TEXF_CLAMP;
+ int texflags = (r_mipsprites.integer ? TEXF_MIPMAP : 0) | (gl_texturecompression_sprites.integer ? TEXF_COMPRESS : 0) | TEXF_ISSPRITE | TEXF_PICMIP | TEXF_ALPHA | TEXF_CLAMP;
modelradius = 0;
if (loadmodel->numframes < 1)
else //if (version == SPRITEHL_VERSION || version == SPRITE_VERSION)
Image_Copy8bitBGRA(datapointer, pixels, width*height, palette ? palette : palette_bgra_transparent);
skinframe = R_SkinFrame_LoadInternalBGRA(name, texflags, pixels, width, height, false);
+ // texflags |= TEXF_COMPRESS;
Mem_Free(pixels);
}
}