cvar_t r_textureunits = {0, "r_textureunits", "32"};
+cvar_t r_lerpsprites = {CVAR_SAVE, "r_lerpsprites", "1"};
+cvar_t r_lerpmodels = {CVAR_SAVE, "r_lerpmodels", "1"};
+cvar_t r_waterscroll = {CVAR_SAVE, "r_waterscroll", "1"};
+
+
+
void R_ModulateColors(float *in, float *out, int verts, float r, float g, float b)
{
int i;
Cvar_RegisterVariable (&r_fullbright);
Cvar_RegisterVariable (&r_textureunits);
Cvar_RegisterVariable (&r_shadow_cull);
+ Cvar_RegisterVariable (&r_lerpsprites);
+ Cvar_RegisterVariable (&r_lerpmodels);
+ Cvar_RegisterVariable (&r_waterscroll);
if (gamemode == GAME_NEHAHRA || gamemode == GAME_NEXUIZ)
Cvar_SetValue("r_fullbrights", 0);
R_RegisterModule("GL_Main", gl_main_start, gl_main_shutdown, gl_main_newmap);
texture_t *texture;
matrix4x4_t tempmatrix;
- // scrolling in texture matrix
- Matrix4x4_CreateTranslate(&tempmatrix, sin(cl.time) * 0.125, sin(cl.time * 0.8f) * 0.125, 0);
- R_Mesh_TextureMatrix(0, &tempmatrix);
+ 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);
+ R_Mesh_TextureMatrix(0, &tempmatrix);
+ }
R_Mesh_Matrix(&ent->matrix);
Matrix4x4_Transform(&ent->inversematrix, r_origin, modelorg);
}
}
- Matrix4x4_CreateIdentity(&tempmatrix);
- R_Mesh_TextureMatrix(0, &tempmatrix);
+ if (r_waterscroll.value)
+ {
+ Matrix4x4_CreateIdentity(&tempmatrix);
+ R_Mesh_TextureMatrix(0, &tempmatrix);
+ }
}
static void RSurfShader_Water(const entity_render_t *ent, const texture_t *texture, msurface_t **surfchain)
menu_height = height;
menu_x = (vid.conwidth - menu_width) * 0.5;
menu_y = (vid.conheight - menu_height) * 0.5;
- DrawQ_Fill(menu_x, menu_y, menu_width, menu_height, 0, 0, 0, 0.5, 0);
- //DrawQ_Fill(0, 0, vid.conwidth, vid.conheight, 0, 0, 0, 0.5, 0);
+ //DrawQ_Fill(menu_x, menu_y, menu_width, menu_height, 0, 0, 0, 0.5, 0);
+ DrawQ_Fill(0, 0, vid.conwidth, vid.conheight, 0, 0, 0, 0.5, 0);
}
/*
}
}
-#define OPTIONS_EFFECTS_ITEMS 17
+#define OPTIONS_EFFECTS_ITEMS 20
int options_effects_cursor;
case 16:
Cvar_SetValueQuick (&cl_particles_blood_alpha, bound(0.2, cl_particles_blood_alpha.value + dir * 0.1, 1));
break;
+ case 17:
+ Cvar_SetValueQuick (&r_lerpmodels, !r_lerpmodels.integer);
+ break;
+ case 18:
+ Cvar_SetValueQuick (&r_lerpsprites, !r_lerpsprites.integer);
+ break;
+ case 19:
+ Cvar_SetValueQuick (&r_waterscroll, bound(0, r_waterscroll.value + dir * 0.5, 10));
+ break;
}
}
M_Print(16, y, " Blood");M_DrawCheckbox(220, y, cl_particles_blood.integer);y += 8;
M_Print(16, y, " Blood Size");M_DrawSlider(220, y, cl_particles_blood_size.value, 2, 20);y += 8;
M_Print(16, y, " Blood Opacity");M_DrawSlider(220, y, cl_particles_blood_alpha.value, 0.2, 1);y += 8;
+ M_Print(16, y, " Model Interpolation");M_DrawCheckbox(220, y, r_lerpmodels.integer);y += 8;
+ M_Print(16, y, " Sprite Interpolation");M_DrawCheckbox(220, y, r_lerpsprites.integer);y += 8;
+ M_Print(16, y, " Water Movement");M_DrawSlider(220, y, r_waterscroll.value, 0, 10);y += 8;
// cursor
M_DrawCharacter(200, 32 + options_effects_cursor*8, 12+((int)(realtime*4)&1));
if (r->frame1 < 0)
Host_Error ("CL_LerpAnimation: frame1 is NULL\n");
- // round off very close blend percentages
- if (r->framelerp < (1.0f / 65536.0f))
- r->framelerp = 0;
- if (r->framelerp >= (65535.0f / 65536.0f))
+ // check r_lerpmodels and round off very close blend percentages
+ if (!r_lerpmodels.integer)
+ r->framelerp = 1;
+ else if (r->framelerp >= (65535.0f / 65536.0f))
r->framelerp = 1;
+ else if (r->framelerp < (1.0f / 65536.0f))
+ r->framelerp = 0;
blend[0].frame = blend[1].frame = blend[2].frame = blend[3].frame = 0;
blend[0].lerp = blend[1].lerp = blend[2].lerp = blend[3].lerp = 0;
sub1 = (int) (sublerp);
sub2 = sub1 + 1;
sublerp -= sub1;
- if (sublerp < (1.0f / 65536.0f))
- sublerp = 0;
- if (sublerp >= (65535.0f / 65536.0f))
+ if (!r_lerpmodels.integer)
+ sublerp = 1;
+ else if (sublerp >= (65535.0f / 65536.0f))
sublerp = 1;
+ else if (sublerp < (1.0f / 65536.0f))
+ sublerp = 0;
if (scene->loop)
{
sub1 = (sub1 % scene->framecount);
sub1 = (int) (sublerp);
sub2 = sub1 + 1;
sublerp -= sub1;
- if (sublerp < (1.0f / 65536.0f))
- sublerp = 0;
- if (sublerp >= (65535.0f / 65536.0f))
+ if (!r_lerpmodels.integer)
sublerp = 1;
+ else if (sublerp >= (65535.0f / 65536.0f))
+ sublerp = 1;
+ else if (sublerp < (1.0f / 65536.0f))
+ sublerp = 0;
if (scene->loop)
{
sub1 = (sub1 % scene->framecount);
#include "quakedef.h"
-#define LERPSPRITES
-
static int R_SpriteSetup (const entity_render_t *ent, int type, float org[3], float left[3], float up[3])
{
float matrix1[3][3], matrix2[3][3], matrix3[3][3];
fog = 0;
ifog = 1 - fog;
-#ifdef LERPSPRITES
- // LordHavoc: interpolated sprite rendering
- for (i = 0;i < 4;i++)
+ if (r_lerpsprites.integer)
{
- if (ent->frameblend[i].lerp >= 0.01f)
+ // LordHavoc: interpolated sprite rendering
+ for (i = 0;i < 4;i++)
{
- frame = ent->model->sprdata_frames + ent->frameblend[i].frame;
- R_DrawSpriteImage((ent->effects & EF_ADDITIVE) || (ent->model->flags & EF_ADDITIVE), frame, frame->texture, org, up, left, color[0] * ifog, color[1] * ifog, color[2] * ifog, ent->alpha * ent->frameblend[i].lerp);
- if (fog * ent->frameblend[i].lerp >= 0.01f)
- R_DrawSpriteImage(true, frame, frame->fogtexture, org, up, left, fogcolor[0],fogcolor[1],fogcolor[2], fog * ent->alpha * ent->frameblend[i].lerp);
+ if (ent->frameblend[i].lerp >= 0.01f)
+ {
+ frame = ent->model->sprdata_frames + ent->frameblend[i].frame;
+ R_DrawSpriteImage((ent->effects & EF_ADDITIVE) || (ent->model->flags & EF_ADDITIVE), frame, frame->texture, org, up, left, color[0] * ifog, color[1] * ifog, color[2] * ifog, ent->alpha * ent->frameblend[i].lerp);
+ if (fog * ent->frameblend[i].lerp >= 0.01f)
+ R_DrawSpriteImage(true, frame, frame->fogtexture, org, up, left, fogcolor[0],fogcolor[1],fogcolor[2], fog * ent->alpha * ent->frameblend[i].lerp);
+ }
}
}
-#else
- // LordHavoc: no interpolation
- frame = NULL;
- for (i = 0;i < 4 && ent->frameblend[i].lerp;i++)
- frame = ent->model->sprdata_frames + ent->frameblend[i].frame;
-
- R_DrawSpriteImage((ent->effects & EF_ADDITIVE) || (ent->model->flags & EF_ADDITIVE), frame, frame->texture, org, up, left, color[0] * ifog, color[1] * ifog, color[2] * ifog, ent->alpha);
- if (fog * ent->frameblend[i].lerp >= 0.01f)
- R_DrawSpriteImage(true, frame, frame->fogtexture, org, up, left, fogcolor[0],fogcolor[1],fogcolor[2], fog * ent->alpha);
-#endif
+ else
+ {
+ // LordHavoc: no interpolation
+ frame = NULL;
+ for (i = 0;i < 4 && ent->frameblend[i].lerp;i++)
+ frame = ent->model->sprdata_frames + ent->frameblend[i].frame;
+
+ R_DrawSpriteImage((ent->effects & EF_ADDITIVE) || (ent->model->flags & EF_ADDITIVE), frame, frame->texture, org, up, left, color[0] * ifog, color[1] * ifog, color[2] * ifog, ent->alpha);
+ if (fog * ent->frameblend[i].lerp >= 0.01f)
+ R_DrawSpriteImage(true, frame, frame->fogtexture, org, up, left, fogcolor[0],fogcolor[1],fogcolor[2], fog * ent->alpha);
+ }
}
void R_Model_Sprite_Draw(entity_render_t *ent)
// detail texture stuff
extern cvar_t r_detailtextures;
+extern cvar_t r_lerpsprites;
+extern cvar_t r_lerpmodels;
+extern cvar_t r_waterscroll;
+
// useful functions for rendering
void R_ModulateColors(float *in, float *out, int verts, float r, float g, float b);
void R_FillColors(float *out, int verts, float r, float g, float b, float a);