Fix directional model lightning
This commit is contained in:
parent
abd4566fc0
commit
d4ac123d19
5 changed files with 27 additions and 7 deletions
|
|
@ -2525,6 +2525,14 @@ static boolean CV_FilterVarByVersion(consvar_t *v, const char *valstr)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (GETMAJOREXECVERSION(cv_execversion.value) == 12 && GETMINOREXECVERSION(cv_execversion.value) < 2) // 12.1 = BK Indev 25-04-26
|
||||
{
|
||||
if (fasticmp(v->name, "gr_modellighting")) // This needs to be on for directional lighting to look right on models.
|
||||
return false;
|
||||
if (fasticmp(v->name, "gr_palettedepth")) // 24 bit looks best.
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -398,10 +398,10 @@ consvar_t cv_dummyrestatrandom[MAXSPLITSCREENPLAYERS] = {
|
|||
|
||||
// Toggle for automatic voice preferences on voice change
|
||||
consvar_t cv_autovoxpref[MAXSPLITSCREENPLAYERS] = {
|
||||
CVAR_INIT ("voicepref_auto", "On", CV_SAVE|CV_NOINIT, CV_OnOff, NULL),
|
||||
CVAR_INIT ("voicepref_auto2", "On", CV_SAVE|CV_NOINIT, CV_OnOff, NULL),
|
||||
CVAR_INIT ("voicepref_auto3", "On", CV_SAVE|CV_NOINIT, CV_OnOff, NULL),
|
||||
CVAR_INIT ("voicepref_auto4", "On", CV_SAVE|CV_NOINIT, CV_OnOff, NULL)
|
||||
CVAR_INIT ("voicepref_auto", "On", CV_SAVE, CV_OnOff, NULL),
|
||||
CVAR_INIT ("voicepref_auto2", "On", CV_SAVE, CV_OnOff, NULL),
|
||||
CVAR_INIT ("voicepref_auto3", "On", CV_SAVE, CV_OnOff, NULL),
|
||||
CVAR_INIT ("voicepref_auto4", "On", CV_SAVE, CV_OnOff, NULL)
|
||||
};
|
||||
|
||||
consvar_t cv_skipmapcheck = CVAR_INIT ("skipmapcheck", "Off", CV_SAVE, CV_OnOff, NULL);
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ extern char logfilename[1024];
|
|||
// to an increment in MODVERSION. This might never happen in practice.
|
||||
// If MODVERSION increases, set MINOREXECVERSION to 0.
|
||||
#define MAJOREXECVERSION MODVERSION
|
||||
#define MINOREXECVERSION 1
|
||||
#define MINOREXECVERSION 2
|
||||
// (It would have been nice to use VERSION and SUBVERSION but those are zero'd out for DEVELOP builds)
|
||||
|
||||
// Macros
|
||||
|
|
|
|||
|
|
@ -283,6 +283,7 @@ static int compareDrawCalls(const void *p1, const void *p2)
|
|||
if (diff != 0) return diff;
|
||||
|
||||
diff = poly1->surf.LightInfo.directional - poly2->surf.LightInfo.directional;
|
||||
if (diff != 0) return diff;
|
||||
|
||||
return diff;
|
||||
}
|
||||
|
|
@ -400,7 +401,8 @@ static unsigned int HWR_MarkStateChanges(DrawCallInfo *current, DrawCallInfo *ne
|
|||
currentSI->FadeColor.rgba != nextSI->FadeColor.rgba ||
|
||||
currentSI->LightInfo.light_level != nextSI->LightInfo.light_level ||
|
||||
currentSI->LightInfo.fade_start != nextSI->LightInfo.fade_start ||
|
||||
currentSI->LightInfo.fade_end != nextSI->LightInfo.fade_end)
|
||||
currentSI->LightInfo.fade_end != nextSI->LightInfo.fade_end ||
|
||||
currentSI->LightInfo.directional != nextSI->LightInfo.directional)
|
||||
{
|
||||
stateChanges |= SURFACEINFO_CHANGED;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -729,8 +729,18 @@ void HWR_RenderPlayerView(void)
|
|||
ClearColor.alpha = 1.0f;
|
||||
|
||||
if (cv_glshaders.value)
|
||||
{
|
||||
GL_SetShaderInfo(HWD_SHADERINFO_LEVELTIME, (INT32)leveltime); // The water surface shader needs the leveltime.
|
||||
|
||||
const angle_t light_angle = maplighting.angle - viewangle + ANGLE_90; // I fucking hate OGL's coordinate system
|
||||
GL_SetShaderInfo(HWD_SHADERINFO_LIGHT_X, FINECOSINE(light_angle >> ANGLETOFINESHIFT));
|
||||
GL_SetShaderInfo(HWD_SHADERINFO_LIGHT_Y, 0);
|
||||
GL_SetShaderInfo(HWD_SHADERINFO_LIGHT_Z, -FINESINE(light_angle >> ANGLETOFINESHIFT));
|
||||
|
||||
GL_SetShaderInfo(HWD_SHADERINFO_LIGHT_CONTRAST, maplighting.contrast);
|
||||
GL_SetShaderInfo(HWD_SHADERINFO_LIGHT_BACKLIGHT, maplighting.backlight);
|
||||
}
|
||||
|
||||
if (viewssnum == 0) // Only do it if it's the first screen being rendered
|
||||
GL_ClearBuffer(true, true, true, &ClearColor); // Clear the Color Buffer, stops HOMs. Also seems to fix the skybox issue on Intel GPUs.
|
||||
|
||||
|
|
@ -886,7 +896,7 @@ consvar_t cv_glmodels = CVAR_INIT ("gr_models", "Off", CV_SAVE, CV_OnOff, NULL);
|
|||
|
||||
#ifdef BAD_MODEL_OPTIONS
|
||||
consvar_t cv_glmodelinterpolation = CVAR_INIT ("gr_modelinterpolation", "Sometimes", CV_SAVE, glmodelinterpolation_cons_t, NULL);
|
||||
consvar_t cv_glmodellighting = CVAR_INIT ("gr_modellighting", "Off", CV_SAVE, CV_OnOff, NULL);
|
||||
consvar_t cv_glmodellighting = CVAR_INIT ("gr_modellighting", "On", CV_SAVE, CV_OnOff, NULL);
|
||||
#endif
|
||||
|
||||
consvar_t cv_glshearing = CVAR_INIT ("gr_shearing", "Off", CV_SAVE, glshearing_cons_t, NULL);
|
||||
|
|
|
|||
Loading…
Reference in a new issue