Add gl_fakemodellightintensity to allow adjusting the fake sunlight's intensity on models

This commit is contained in:
nashmuhandes 2025-02-03 16:30:22 +08:00
commit 166f0cdc5b
3 changed files with 4 additions and 2 deletions

View file

@ -180,4 +180,5 @@ int get_gl_spritelight()
return gl_spritelight < 0 ? (screen->IsRayQueryEnabled() ? 1 : 0) : gl_spritelight;
}
CVAR(Bool, gl_fakemodellight, true, CVAR_GLOBALCONFIG | CVAR_ARCHIVE)
CVARD(Bool, gl_fakemodellight, true, CVAR_GLOBALCONFIG | CVAR_ARCHIVE, "adds a fake sunlight on models to improve contrast")
CVARD(Float, gl_fakemodellightintensity, 0.05, CVAR_GLOBALCONFIG | CVAR_ARCHIVE, "fake sunlight intensity (brightness)")

View file

@ -66,3 +66,4 @@ EXTERN_CVAR(Color, gl_wireframecolor)
int get_gl_spritelight();
EXTERN_CVAR(Bool, gl_fakemodellight)
EXTERN_CVAR(Float, gl_fakemodellightintensity)

View file

@ -280,7 +280,7 @@ void HWDrawInfo::GetDynSpriteLightList(AActor *self, double x, double y, double
if(isModel && gl_fakemodellight)
{
//fake light for contrast
AddSunLightToList(modellightdata, x, y, z, FVector3(Level->SunDirection.X + 180, 45, 0), Level->SunColor * Level->SunIntensity * 0.05, false);
AddSunLightToList(modellightdata, x, y, z, FVector3(Level->SunDirection.X + 180, 45, 0), Level->SunColor * Level->SunIntensity * gl_fakemodellightintensity, false);
}
if ((level.lightmaps && gl_spritelight > 0) || ActorTraceStaticLight::TraceSunVisibility(x, y, z, traceCache, (self ? staticLight.ActorMoved : traceCache ? traceCache->Pos != DVector3(x, y, z) : false)))