mirror of
https://github.com/nzp-team/fteqw.git
synced 2025-01-31 04:30:38 +00:00
Lit sprites should not be additive. Make gl_blendsprites 2 replicate that tenebrae behaviour instead. Allow colormod to oversaturate sprites.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5868 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
ff6c438d89
commit
fb54cc140b
5 changed files with 16 additions and 39 deletions
|
@ -1127,6 +1127,7 @@ struct
|
||||||
"set gl_specular_power 16\n"
|
"set gl_specular_power 16\n"
|
||||||
"set gl_specular_fallback 1\n"
|
"set gl_specular_fallback 1\n"
|
||||||
"set mod_litsprites_force 1\n"
|
"set mod_litsprites_force 1\n"
|
||||||
|
"set gl_blendsprites 2\n"
|
||||||
"set r_nolerp 1\n" //well, that matches tenebrae. for the luls, right?
|
"set r_nolerp 1\n" //well, that matches tenebrae. for the luls, right?
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -399,7 +399,7 @@ cvar_t r_tessellation = CVARAFD ("r_tessellation", "0", "gl_ati_truform",
|
||||||
cvar_t gl_ati_truform_type = CVAR ("gl_ati_truform_type", "1");
|
cvar_t gl_ati_truform_type = CVAR ("gl_ati_truform_type", "1");
|
||||||
cvar_t r_tessellation_level = CVAR ("r_tessellation_level", "5");
|
cvar_t r_tessellation_level = CVAR ("r_tessellation_level", "5");
|
||||||
cvar_t gl_blend2d = CVAR ("gl_blend2d", "1");
|
cvar_t gl_blend2d = CVAR ("gl_blend2d", "1");
|
||||||
cvar_t gl_blendsprites = CVARD ("gl_blendsprites", "0", "Blend sprites instead of alpha testing them");
|
cvar_t gl_blendsprites = CVARD ("gl_blendsprites", "0", "Specifies how sprites are blended.\n0: Alpha tested.\n1: Premultiplied blend.\n2: Additive blend.");
|
||||||
cvar_t r_deluxemapping_cvar = CVARAFD ("r_deluxemapping", "1", "r_glsl_deluxemapping",
|
cvar_t r_deluxemapping_cvar = CVARAFD ("r_deluxemapping", "1", "r_glsl_deluxemapping",
|
||||||
CVAR_ARCHIVE|CVAR_RENDERERLATCH, "Enables bumpmapping based upon precomputed light directions.\n0=off\n1=use if available\n2=auto-generate (if possible)");
|
CVAR_ARCHIVE|CVAR_RENDERERLATCH, "Enables bumpmapping based upon precomputed light directions.\n0=off\n1=use if available\n2=auto-generate (if possible)");
|
||||||
cvar_t mod_loadsurfenvmaps = CVARD ("r_loadsurfenvmaps", "1", "Load local reflection environment-maps, where available. These are normally defined via env_cubemap entities dotted around the place.");
|
cvar_t mod_loadsurfenvmaps = CVARD ("r_loadsurfenvmaps", "1", "Load local reflection environment-maps, where available. These are normally defined via env_cubemap entities dotted around the place.");
|
||||||
|
|
|
@ -1502,9 +1502,9 @@ static int QDECL V_DepthSortTwoEntities(const void *p1,const void *p2)
|
||||||
const entity_t *b = p2;
|
const entity_t *b = p2;
|
||||||
|
|
||||||
if (a->angles[0] < b->angles[0])
|
if (a->angles[0] < b->angles[0])
|
||||||
return -1;
|
|
||||||
if (a->angles[0] > b->angles[0])
|
|
||||||
return 1;
|
return 1;
|
||||||
|
if (a->angles[0] > b->angles[0])
|
||||||
|
return -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
void V_DepthSortEntities(float *vieworg)
|
void V_DepthSortEntities(float *vieworg)
|
||||||
|
|
|
@ -2659,13 +2659,9 @@ static void R_Sprite_GenerateTrisoup(entity_t *e, int bemode)
|
||||||
case SPR_ORIENTED:
|
case SPR_ORIENTED:
|
||||||
// bullet marks on walls
|
// bullet marks on walls
|
||||||
if ((e->flags & RF_WEAPONMODEL) && r_refdef.playerview->viewentity > 0)
|
if ((e->flags & RF_WEAPONMODEL) && r_refdef.playerview->viewentity > 0)
|
||||||
{
|
Matrix3_Multiply(e->axis, r_refdef.playerview->vw_axis, spraxis);
|
||||||
vec3_t ea[3];
|
|
||||||
AngleVectors (e->angles, ea[0], ea[1], ea[2]);
|
|
||||||
Matrix3_Multiply(ea, r_refdef.playerview->vw_axis, spraxis);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
AngleVectors (e->angles, spraxis[0], spraxis[1], spraxis[2]);
|
memcpy(spraxis, e->axis, sizeof(spraxis));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SPR_FACING_UPRIGHT:
|
case SPR_FACING_UPRIGHT:
|
||||||
|
@ -2699,12 +2695,12 @@ static void R_Sprite_GenerateTrisoup(entity_t *e, int bemode)
|
||||||
|
|
||||||
if (e->shaderRGBAf[0] != 0 || e->shaderRGBAf[1] != 0 || e->shaderRGBAf[2] != 0 || (batchflags & BEF_FORCECOLOURMOD))
|
if (e->shaderRGBAf[0] != 0 || e->shaderRGBAf[1] != 0 || e->shaderRGBAf[2] != 0 || (batchflags & BEF_FORCECOLOURMOD))
|
||||||
{
|
{
|
||||||
if (e->shaderRGBAf[0] > 1)
|
// if (e->shaderRGBAf[0] > 1)
|
||||||
e->shaderRGBAf[0] = 1;
|
// e->shaderRGBAf[0] = 1;
|
||||||
if (e->shaderRGBAf[1] > 1)
|
// if (e->shaderRGBAf[1] > 1)
|
||||||
e->shaderRGBAf[1] = 1;
|
// e->shaderRGBAf[1] = 1;
|
||||||
if (e->shaderRGBAf[2] > 1)
|
// if (e->shaderRGBAf[2] > 1)
|
||||||
e->shaderRGBAf[2] = 1;
|
// e->shaderRGBAf[2] = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -5601,7 +5601,9 @@ void Mod_LoadDoomSprite (model_t *mod)
|
||||||
"endif\n" \
|
"endif\n" \
|
||||||
"{\n" \
|
"{\n" \
|
||||||
"map $diffuse\n" \
|
"map $diffuse\n" \
|
||||||
"if gl_blendsprites\n" \
|
"if gl_blendsprites == 2\n" \
|
||||||
|
"blendfunc GL_ONE GL_ONE\n" \
|
||||||
|
"elif gl_blendsprites\n" \
|
||||||
"blendfunc GL_ONE GL_ONE_MINUS_SRC_ALPHA\n" \
|
"blendfunc GL_ONE GL_ONE_MINUS_SRC_ALPHA\n" \
|
||||||
"else\n" \
|
"else\n" \
|
||||||
"alphafunc ge128\n" \
|
"alphafunc ge128\n" \
|
||||||
|
@ -5668,29 +5670,7 @@ void Mod_LoadSpriteFrameShader(model_t *spr, int frame, int subframe, mspritefra
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (litsprite) // a ! in the filename makes it non-fullbright (and can also be lit by rtlights too).
|
if (litsprite) // a ! in the filename makes it non-fullbright (and can also be lit by rtlights too).
|
||||||
{
|
shadertext = SPRITE_SHADER_MAIN SPRITE_SHADER_LIT SPRITE_SHADER_FOOTER;
|
||||||
shadertext =
|
|
||||||
"{\n"
|
|
||||||
"program defaultsprite\n"
|
|
||||||
"{\n"
|
|
||||||
"map $diffuse\n"
|
|
||||||
"blendfunc GL_ONE GL_ONE\n" //lit sprites are actually additive...
|
|
||||||
"rgbgen vertex\n"
|
|
||||||
"alphagen vertex\n"
|
|
||||||
"}\n"
|
|
||||||
"surfaceparm noshadows\n"
|
|
||||||
"sort seethrough\n"
|
|
||||||
"bemode rtlight\n"
|
|
||||||
"{\n"
|
|
||||||
"program rtlight#NOBUMP\n"
|
|
||||||
"{\n"
|
|
||||||
"map $diffuse\n"
|
|
||||||
"blendfunc add\n"
|
|
||||||
"}\n"
|
|
||||||
"}\n"
|
|
||||||
"}\n"
|
|
||||||
;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
shadertext = SPRITE_SHADER_MAIN SPRITE_SHADER_UNLIT SPRITE_SHADER_FOOTER;
|
shadertext = SPRITE_SHADER_MAIN SPRITE_SHADER_UNLIT SPRITE_SHADER_FOOTER;
|
||||||
frameinfo->shader = R_RegisterShader(name, SUF_NONE, shadertext);
|
frameinfo->shader = R_RegisterShader(name, SUF_NONE, shadertext);
|
||||||
|
|
Loading…
Reference in a new issue