diff --git a/include/QF/GLSL/qf_textures.h b/include/QF/GLSL/qf_textures.h index bf3251574..1447d797a 100644 --- a/include/QF/GLSL/qf_textures.h +++ b/include/QF/GLSL/qf_textures.h @@ -52,7 +52,7 @@ int GLSL_LoadRGBATexture (const char *identifier, int width, int height, void GLSL_ReleaseTexture (int tex); void GLSL_TextureInit (void); -scrap_t *GLSL_CreateScrap (int size, int format); +scrap_t *GLSL_CreateScrap (int size, int format, int linear); void GLSL_DestroyScrap (scrap_t *scrap); void GLSL_ScrapClear (scrap_t *scrap); int GLSL_ScrapTexture (scrap_t *scrap); diff --git a/libs/video/renderer/glsl/glsl_lightmap.c b/libs/video/renderer/glsl/glsl_lightmap.c index 88faa61f3..540f6f4ce 100644 --- a/libs/video/renderer/glsl/glsl_lightmap.c +++ b/libs/video/renderer/glsl/glsl_lightmap.c @@ -200,7 +200,7 @@ glsl_R_BuildLightmaps (model_t **models, int num_models) //FIXME RGB support if (!light_scrap) { - light_scrap = GLSL_CreateScrap (2048, GL_LUMINANCE); + light_scrap = GLSL_CreateScrap (2048, GL_LUMINANCE, 1); light_data = malloc (BLOCK_SIZE * MAX_LIGHTMAPS); } else { GLSL_ScrapClear (light_scrap); diff --git a/libs/video/renderer/glsl/glsl_textures.c b/libs/video/renderer/glsl/glsl_textures.c index 5d0969342..62b331662 100644 --- a/libs/video/renderer/glsl/glsl_textures.c +++ b/libs/video/renderer/glsl/glsl_textures.c @@ -279,7 +279,7 @@ GLSL_TextureInit (void) } scrap_t * -GLSL_CreateScrap (int size, int format) +GLSL_CreateScrap (int size, int format, int linear) { int i; int bpp; @@ -326,9 +326,13 @@ GLSL_CreateScrap (int size, int format) size, size, 0, format, GL_UNSIGNED_BYTE, scrap->data); qfeglTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); qfeglTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - //FIXME parameterize (linear for lightmaps) - qfeglTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - qfeglTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + if (linear) { + qfeglTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + qfeglTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + } else { + qfeglTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + qfeglTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + } qfeglGenerateMipmap (GL_TEXTURE_2D); return scrap;