Skip to content

Commit 7749e7d

Browse files
committed
Some renderer refactor and cleanup
- r_shadeMethod : 0/1 = q3 behavior, 2 = ue1-ish behavior, 3 = mix of 1 and 2, -1 = one uniform color, 150-666 = a lod range to change between the 3 - r_monolightmaps : refactor - goes to the light data instead of the calculations and images - removed r_greyscale because this is a data-modifying novelty that would complicate support for loading compressed texture formats. This is better off as a post-process shader - environment mapping refactor, rewrite and cleanup - removed a lot of deprecated rgbGens - removed r_texdump (it never worked) - remove a few leftover broken postprocess things
1 parent ed16ba3 commit 7749e7d

File tree

12 files changed

+232
-1030
lines changed

12 files changed

+232
-1030
lines changed

code/client/cl_scrn.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ leilei - Adjusted for resolution and screen aspect ratio.... but from vertical o
9393
================
9494
*/
9595
void SCR_AdjustFrom480( float *x, float *y, float *w, float *h ) {
96-
float xscale;
9796
float yscale;
9897

9998
// scale for screen sizes
@@ -202,14 +201,8 @@ void SCR_DrawSmallChar( int x, int y, int ch, int scalemode ) {
202201
float frow, fcol;
203202
float ax, ay, aw, ah;
204203
float size;
205-
float sizeup = 1.0f;
206-
float sizedown = 1.0f;
207204
ch &= 255;
208205

209-
if (cls.glconfig.vidHeight >= 480)
210-
sizeup = cls.glconfig.vidHeight / 480;
211-
sizedown = (cls.glconfig.vidHeight - 480);
212-
213206
if ( ch == ' ' ) {
214207
return;
215208
}

code/renderer_oa/tr_bloom.c

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,58 +1277,3 @@ void R_AltBrightnessInit( void )
12771277
r_alternateBrightness = ri.Cvar_Get( "r_alternateBrightness", "0", CVAR_ARCHIVE | CVAR_LATCH);
12781278
}
12791279

1280-
1281-
1282-
// =================================================================
1283-
// WATER BUFFER TEST
1284-
// =================================================================
1285-
1286-
#if 0
1287-
static struct {
1288-
// NO!
1289-
} water;
1290-
1291-
// leilei - experimental water effect
1292-
static void R_Water_InitTextures( void )
1293-
{
1294-
// NO!
1295-
}
1296-
#endif
1297-
1298-
1299-
1300-
void R_InitWaterTextures( void )
1301-
{
1302-
// NO!
1303-
}
1304-
1305-
1306-
#if 0
1307-
static void R_Water_BackupScreen( void )
1308-
{
1309-
// NO!
1310-
}
1311-
1312-
static void R_WaterWorks( void )
1313-
{
1314-
// NO!
1315-
}
1316-
1317-
1318-
static void R_Water_RestoreScreen( void )
1319-
{
1320-
// NO!
1321-
}
1322-
#endif
1323-
1324-
void R_WaterInit( void )
1325-
{
1326-
// NO!
1327-
}
1328-
1329-
1330-
void R_WaterScreen( void )
1331-
{
1332-
// NO!
1333-
}
1334-

code/renderer_oa/tr_bsp.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,17 @@ static void R_ColorShiftLightingBytes( byte in[4], byte out[4] ) {
108108
r = in[0] << shift;
109109
g = in[1] << shift;
110110
b = in[2] << shift;
111+
112+
// leilei - handle light desaturation here instead, so we can also mono the lightgrid and have one less redundant clamp
113+
if( r_monolightmaps->value > 0)
114+
{
115+
float saturated = (r * 0.22126) + (g * 0.7152) + (b * 0.0722);
116+
float ml = r_monolightmaps->value; // sanitize
117+
if (ml>1) ml=1; if (ml<0) ml=0;
118+
r = saturated + (r - saturated) * ( 1-ml );
119+
g = saturated + (g - saturated) * ( 1-ml );
120+
b = saturated + (b - saturated) * ( 1-ml );
121+
}
111122

112123
if (r_lightmapColorNorm->integer == 2) // leilei
113124
{
@@ -341,7 +352,6 @@ static shader_t *ShaderForShaderNum( int shaderNum, int lightmapNum ) {
341352
// leilei - placeholder hack
342353
if (tr.placeholderTextureAvail == 1 && !Q_strncmp( dsh->shader, "textures", 8 ))
343354
{
344-
// return tr.placeholderTextureShader;
345355
shader = R_FindShader( "placeholder_texture", lightmapNum, qtrue );
346356
return shader;
347357
}

0 commit comments

Comments
 (0)