Skip to content
Permalink
Browse files

R2: Remove forceambient, use r_ambientscale

this fixes black playermodels on oasis btw..
  • Loading branch information...
thunderpwn committed Nov 7, 2019
1 parent b19f50c commit cfcdb80be27fe6d977597f85c3666fcbf37ddb2d
Showing with 14 additions and 20 deletions.
  1. +6 −6 src/renderer2/tr_bsp.c
  2. +2 −3 src/renderer2/tr_init.c
  3. +4 −4 src/renderer2/tr_light.c
  4. +1 −1 src/renderer2/tr_local.h
  5. +1 −6 src/renderer2/tr_shade.c
@@ -5538,11 +5538,11 @@ void R_LoadEntities(lump_t *l)
// check for ambient color
else if (!Q_stricmp(keyname, "_color") || !Q_stricmp(keyname, "color"))
{
if (r_forceAmbient->value <= 0)
{


sscanf(value, "%f %f %f", &tr.worldEntity.ambientLight[0], &tr.worldEntity.ambientLight[1],
&tr.worldEntity.ambientLight[2]);
}

}
// check for ambient scale constant
else if (!Q_stricmp(keyname, "ambientColor") || !Q_stricmp(keyname, "ambient") || !Q_stricmp(keyname, "_ambient"))
@@ -8674,9 +8674,9 @@ void RE_LoadWorldMap(const char *name)
tr.fogDensity = 0;

// set default ambient color
tr.worldEntity.ambientLight[0] = r_forceAmbient->value;
tr.worldEntity.ambientLight[1] = r_forceAmbient->value;
tr.worldEntity.ambientLight[2] = r_forceAmbient->value;
tr.worldEntity.ambientLight[0] = r_ambientScale->value;
tr.worldEntity.ambientLight[1] = r_ambientScale->value;
tr.worldEntity.ambientLight[2] = r_ambientScale->value;

tr.worldMapLoaded = qtrue;

@@ -197,7 +197,7 @@ cvar_t *r_showImages;
cvar_t *r_wolfFog;
cvar_t *r_noFog;

cvar_t *r_forceAmbient;

cvar_t *r_ambientScale;
cvar_t *r_lightScale;
cvar_t *r_debugLight;
@@ -1177,8 +1177,7 @@ void R_Register(void)
r_reflectionMapping = ri.Cvar_Get("r_reflectionMapping", "0", CVAR_ARCHIVE | CVAR_LATCH);
r_highQualityNormalMapping = ri.Cvar_Get("r_highQualityNormalMapping", "0", CVAR_ARCHIVE | CVAR_LATCH);

r_forceAmbient = ri.Cvar_Get("r_forceAmbient", "0", CVAR_CHEAT | CVAR_LATCH);
ri.Cvar_CheckRange(r_forceAmbient, 0.0f, 0.3f, qfalse);


// temporary latched variables that can only change over a restart
r_overBrightBits = ri.Cvar_Get("r_overBrightBits", "0", CVAR_ARCHIVE | CVAR_LATCH);
@@ -370,11 +370,11 @@ void R_SetupEntityLighting(const trRefdef_t *refdef, trRefEntity_t *ent, vec3_t

// force an ambient light value or scale by given r_ambientscale
// note: this will also affect ambient light for hilightIntensity and RF_MINLIGHT ...
if (VectorLength(ent->ambientLight) < r_forceAmbient->value)
if (VectorLength(ent->ambientLight) < r_ambientScale->value)
{
ent->ambientLight[0] = r_forceAmbient->value;
ent->ambientLight[1] = r_forceAmbient->value;
ent->ambientLight[2] = r_forceAmbient->value;
ent->ambientLight[0] = r_ambientScale->value;
ent->ambientLight[1] = r_ambientScale->value;
ent->ambientLight[2] = r_ambientScale->value;
}
else
{
@@ -3738,7 +3738,7 @@ extern cvar_t *r_lodTest;
extern cvar_t *r_wolfFog;
extern cvar_t *r_noFog;

extern cvar_t *r_forceAmbient;

extern cvar_t *r_ambientScale;
extern cvar_t *r_lightScale;
extern cvar_t *r_debugLight;
@@ -1053,12 +1053,7 @@ static void Render_depthFill(int stage)
VectorCopy(backEnd.currentEntity->ambientLight, ambientColor);
ClampColor(ambientColor);
}
else if (r_forceAmbient->integer)
{
ambientColor[0] = r_forceAmbient->value;
ambientColor[1] = r_forceAmbient->value;
ambientColor[2] = r_forceAmbient->value;
}
else
{
VectorClear(ambientColor);

0 comments on commit cfcdb80

Please sign in to comment.
You can’t perform that action at this time.