mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
Change meaning of gl_lightmap_components a bit. Setting 4 changed to reduce texture memory waste by a bit. Really only an optimization for nvidia drivers anyways. This also should fix a quality issue in 16bpp with it set to 4.
This commit is contained in:
parent
cf2e098434
commit
f7330f078e
2 changed files with 10 additions and 2 deletions
|
@ -55,6 +55,7 @@ int skytexturenum;
|
|||
|
||||
extern vec3_t shadecolor; // Ender (Extend) Colormod
|
||||
|
||||
int gl_internalformat;
|
||||
int lightmap_bytes; // 1, 3, or 4
|
||||
int lightmap_textures;
|
||||
|
||||
|
@ -366,7 +367,7 @@ GL_UploadLightmap (int i, int x, int y, int w, int h)
|
|||
GL_UNSIGNED_BYTE,
|
||||
lightmaps[i] + (y * BLOCK_WIDTH) * lightmap_bytes);
|
||||
*/
|
||||
glTexImage2D (GL_TEXTURE_2D, 0, lightmap_bytes, BLOCK_WIDTH,
|
||||
glTexImage2D (GL_TEXTURE_2D, 0, gl_internalformat, BLOCK_WIDTH,
|
||||
BLOCK_HEIGHT, 0, gl_lightmap_format,
|
||||
GL_UNSIGNED_BYTE, lightmaps[i]);
|
||||
}
|
||||
|
@ -1154,15 +1155,18 @@ GL_BuildLightmaps (void)
|
|||
|
||||
switch (gl_lightmap_components->int_val) {
|
||||
case 1:
|
||||
gl_internalformat = 1;
|
||||
gl_lightmap_format = GL_LUMINANCE;
|
||||
lightmap_bytes = 1;
|
||||
break;
|
||||
case 3:
|
||||
gl_internalformat = 3;
|
||||
gl_lightmap_format = GL_RGB;
|
||||
lightmap_bytes = 3;
|
||||
break;
|
||||
case 4:
|
||||
default:
|
||||
gl_internalformat = 3;
|
||||
gl_lightmap_format = GL_RGBA;
|
||||
lightmap_bytes = 4;
|
||||
break;
|
||||
|
|
|
@ -55,6 +55,7 @@ int skytexturenum;
|
|||
|
||||
extern vec3_t shadecolor; // Ender (Extend) Colormod
|
||||
|
||||
int gl_internalformat;
|
||||
int lightmap_bytes; // 1, 3, or 4
|
||||
int lightmap_textures;
|
||||
|
||||
|
@ -366,7 +367,7 @@ GL_UploadLightmap (int i, int x, int y, int w, int h)
|
|||
GL_UNSIGNED_BYTE,
|
||||
lightmaps[i] + (y * BLOCK_WIDTH) * lightmap_bytes);
|
||||
*/
|
||||
glTexImage2D (GL_TEXTURE_2D, 0, lightmap_bytes, BLOCK_WIDTH,
|
||||
glTexImage2D (GL_TEXTURE_2D, 0, gl_internalformat, BLOCK_WIDTH,
|
||||
BLOCK_HEIGHT, 0, gl_lightmap_format,
|
||||
GL_UNSIGNED_BYTE, lightmaps[i]);
|
||||
}
|
||||
|
@ -1154,15 +1155,18 @@ GL_BuildLightmaps (void)
|
|||
|
||||
switch (gl_lightmap_components->int_val) {
|
||||
case 1:
|
||||
gl_internalformat = 1;
|
||||
gl_lightmap_format = GL_LUMINANCE;
|
||||
lightmap_bytes = 1;
|
||||
break;
|
||||
case 3:
|
||||
gl_internalformat = 3;
|
||||
gl_lightmap_format = GL_RGB;
|
||||
lightmap_bytes = 3;
|
||||
break;
|
||||
case 4:
|
||||
default:
|
||||
gl_internalformat = 3;
|
||||
gl_lightmap_format = GL_RGBA;
|
||||
lightmap_bytes = 4;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue