Skip to content

Commit

Permalink
Add gl_fakemodellightintensity to allow adjusting the fake sunlight's…
Browse files Browse the repository at this point in the history
… intensity on models
  • Loading branch information
nashmuhandes committed Feb 3, 2025
1 parent 7a59234 commit 166f0cd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/common/rendering/hwrenderer/data/hw_cvars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)")
1 change: 1 addition & 0 deletions src/common/rendering/hwrenderer/data/hw_cvars.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@ EXTERN_CVAR(Color, gl_wireframecolor)
int get_gl_spritelight();

EXTERN_CVAR(Bool, gl_fakemodellight)
EXTERN_CVAR(Float, gl_fakemodellightintensity)
2 changes: 1 addition & 1 deletion src/rendering/hwrenderer/scene/hw_spritelight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit 166f0cd

Please sign in to comment.