Skip to content

Commit

Permalink
client: render: removed r_lighting_modulate cvar
Browse files Browse the repository at this point in the history
  • Loading branch information
SNMetamorph committed Jan 7, 2024
1 parent 42394c7 commit 432fe22
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
6 changes: 3 additions & 3 deletions client/render/gl_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void GL_ComputeSunParams( const Vector &skyVector )
float ambientIntensity = 0.0025f + sunBrightness * Q_min(1.0f, Q_max(0.0f, (0.375f + sunPos) / 0.25f));
float diffuseIntensity = sunBrightness * Q_min(1.0f, Q_max(0.0f, (0.03125f + sunPos) / 0.0625f));

float ambientFactor = RemapVal(tr.ambientFactor, AMBIENT_EPSILON, r_lighting_modulate->value, 0.0f, 1.0f);
float ambientFactor = RemapVal(tr.ambientFactor, AMBIENT_EPSILON, 1.0f, 0.0f, 1.0f);
tr.sun_ambient = Q_max(ambientIntensity * ambientFactor, 0.0f);
tr.sun_ambient = bound(0.0f, tr.sun_ambient, tr.ambientFactor);
tr.sun_diffuse = sunColor * diffuseIntensity;
Expand Down Expand Up @@ -248,8 +248,8 @@ bool GL_BackendStartFrame( ref_viewpass_t *rvp, RefParams params )
pglFinish();

// setup light factors
tr.ambientFactor = bound( AMBIENT_EPSILON, r_lighting_ambient->value, r_lighting_modulate->value );
float cachedFactor = bound( tr.ambientFactor, r_lighting_modulate->value, 1.0f );
tr.ambientFactor = bound( AMBIENT_EPSILON, r_lighting_ambient->value, 1.0f );
float cachedFactor = bound( tr.ambientFactor, 1.0f, 1.0f );

if( cachedFactor != tr.diffuseFactor )
{
Expand Down
2 changes: 0 additions & 2 deletions client/render/gl_cvars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ cvar_t *gl_debug_verbose;
cvar_t *cv_dynamiclight;
cvar_t *r_detailtextures;
cvar_t *r_lighting_ambient;
cvar_t *r_lighting_modulate;
cvar_t *r_lightstyle_lerping;
cvar_t *r_lighting_extended;
cvar_t *r_occlusion_culling;
Expand Down Expand Up @@ -131,7 +130,6 @@ void R_InitializeConVars()
r_finish = CVAR_GET_POINTER("gl_finish");
cv_crosshair = CVAR_GET_POINTER("crosshair");
r_lighting_ambient = CVAR_GET_POINTER("r_lighting_ambient");
r_lighting_modulate = CVAR_GET_POINTER("r_lighting_modulate");
r_lightstyle_lerping = CVAR_GET_POINTER("cl_lightstyle_lerping");
r_lighting_extended = CVAR_GET_POINTER("r_lighting_extended");
r_draw_beams = CVAR_GET_POINTER("cl_draw_beams");
Expand Down
1 change: 0 additions & 1 deletion client/render/gl_cvars.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ extern cvar_t *gl_debug_verbose;
extern cvar_t *cv_dynamiclight;
extern cvar_t *r_detailtextures;
extern cvar_t *r_lighting_ambient;
extern cvar_t *r_lighting_modulate;
extern cvar_t *r_lightstyle_lerping;
extern cvar_t *r_lighting_extended;
extern cvar_t *r_occlusion_culling;
Expand Down

0 comments on commit 432fe22

Please sign in to comment.