diff --git a/Linux/sgml/Quakespasm.sgml b/Linux/sgml/Quakespasm.sgml index f57f49b6c..b8c364f67 100644 --- a/Linux/sgml/Quakespasm.sgml +++ b/Linux/sgml/Quakespasm.sgml @@ -160,7 +160,7 @@ QuakeSpasm 0.94 has support for playing the 2021 re-release content: Copy the qu Fix a potential crash after loading of saved game. Fix possible out-of-bound reads when handling progs type sizes. Fix Dutch angle VP_PARALLEL_UPRIGHT sprites. - Fix an issue with blending of lights. + Fix an issue with blending of lights by using 10 bit depth for lightmaps. (GLSL mode only. Disable with "-nopackedpixels" if necessarry.) No relative motions when the window is not focused. Status bar and intermission screen tweaks. Properly display monster counts > 3 digits. diff --git a/Quake/gl_vidsdl.c b/Quake/gl_vidsdl.c index e0e72838c..cedc791f2 100644 --- a/Quake/gl_vidsdl.c +++ b/Quake/gl_vidsdl.c @@ -1267,19 +1267,24 @@ static void GL_CheckExtensions (void) else if (gl_glsl_able && gl_vbo_able && gl_max_texture_units >= 3) { gl_glsl_alias_able = true; - gl_packed_pixels = true; Con_Printf("Enabled: GLSL alias model rendering\n"); - Con_Printf("Enabled: EXT_packed_pixels\n"); } else { Con_Warning ("GLSL alias model rendering not available, using Fitz renderer\n"); } + if (COM_CheckParm("-nopackedpixels")) + Con_Warning ("EXT_packed_pixels disabled at command line\n"); + else if (gl_glsl_alias_able) + { + gl_packed_pixels = true; + Con_Printf("Enabled: EXT_packed_pixels\n"); + } #if 0 /* Disabling for non-GLSL path, needs more surgery. See: https://github.com/sezero/quakespasm/issues/47#issuecomment-1681540278 */ // packed_pixels // - if (!gl_packed_pixels) + else { if (GL_ParseExtensionList(gl_extensions, "GL_APPLE_packed_pixels")) { diff --git a/Quake/r_world.c b/Quake/r_world.c index d4f758850..421f4c755 100644 --- a/Quake/r_world.c +++ b/Quake/r_world.c @@ -553,6 +553,7 @@ static GLuint fullbrightTexLoc; static GLuint useFullbrightTexLoc; static GLuint useOverbrightLoc; static GLuint useAlphaTestLoc; +static GLuint usePackedPixelsLoc; static GLuint alphaLoc; #define vertAttrIndex 0 @@ -633,6 +634,7 @@ void R_DrawTextureChains_Water (qmodel_t *model, entity_t *ent, texchain_t chain GL_Uniform1iFunc (fullbrightTexLoc, 2); GL_Uniform1iFunc (useFullbrightTexLoc, 0); GL_Uniform1iFunc (useOverbrightLoc, (int)gl_overbright.value); + GL_Uniform1iFunc (usePackedPixelsLoc, gl_packed_pixels); GL_Uniform1iFunc (useAlphaTestLoc, 0); for (i=0 ; inumtextures ; i++) @@ -843,6 +845,7 @@ void GLWorld_CreateShaders (void) "uniform bool UseFullbrightTex;\n" "uniform bool UseOverbright;\n" "uniform bool UseAlphaTest;\n" + "uniform bool UsePackedPixels;\n" "uniform float Alpha;\n" "\n" "varying float FogFragCoord;\n" @@ -853,7 +856,8 @@ void GLWorld_CreateShaders (void) " if (UseAlphaTest && (result.a < 0.666))\n" " discard;\n" " result *= texture2D(LMTex, gl_TexCoord[1].xy);\n" - " result.rgb *= 4.0;\n" + " if (UsePackedPixels)\n" + " result.rgb *= 4.0;\n" " if (UseOverbright)\n" " result.rgb *= 2.0;\n" " if (UseFullbrightTex)\n" @@ -880,6 +884,7 @@ void GLWorld_CreateShaders (void) useFullbrightTexLoc = GL_GetUniformLocation (&r_world_program, "UseFullbrightTex"); useOverbrightLoc = GL_GetUniformLocation (&r_world_program, "UseOverbright"); useAlphaTestLoc = GL_GetUniformLocation (&r_world_program, "UseAlphaTest"); + usePackedPixelsLoc = GL_GetUniformLocation (&r_world_program, "UsePackedPixels"); alphaLoc = GL_GetUniformLocation (&r_world_program, "Alpha"); } } @@ -932,6 +937,7 @@ void R_DrawTextureChains_GLSL (qmodel_t *model, entity_t *ent, texchain_t chain) GL_Uniform1iFunc (useFullbrightTexLoc, 0); GL_Uniform1iFunc (useOverbrightLoc, (int)gl_overbright.value); GL_Uniform1iFunc (useAlphaTestLoc, 0); + GL_Uniform1iFunc (usePackedPixelsLoc, gl_packed_pixels); GL_Uniform1fFunc (alphaLoc, entalpha); for (i=0 ; inumtextures ; i++) diff --git a/Quakespasm.html b/Quakespasm.html index ad8dd6713..fe9aa5b6d 100644 --- a/Quakespasm.html +++ b/Quakespasm.html @@ -234,7 +234,7 @@

5.1 Changes in 0.96.0
  • Fix a potential crash after loading of saved game.
  • Fix possible out-of-bound reads when handling progs type sizes.
  • Fix Dutch angle VP_PARALLEL_UPRIGHT sprites.
  • -
  • Fix an issue with blending of lights.
  • +
  • Fix an issue with blending of lights by using 10 bit depth for lightmaps. (GLSL mode only. Disable with "-nopackedpixels" if necessarry.)
  • No relative motions when the window is not focused.
  • Status bar and intermission screen tweaks.
  • Properly display monster counts > 3 digits.
  • diff --git a/Quakespasm.txt b/Quakespasm.txt index 66bda1d37..3fd287111 100644 --- a/Quakespasm.txt +++ b/Quakespasm.txt @@ -269,7 +269,9 @@ - Fix Dutch angle VP_PARALLEL_UPRIGHT sprites. - - Fix an issue with blending of lights. + - Fix an issue with blending of lights by using 10 bit depth for + lightmaps. (GLSL mode only. Disable with "-nopackedpixels" if + necessarry.) - No relative motions when the window is not focused.