diff --git a/engine/gl/gl_model.c b/engine/gl/gl_model.c index 88062ada0..1cd4caa69 100644 --- a/engine/gl/gl_model.c +++ b/engine/gl/gl_model.c @@ -4981,7 +4981,7 @@ void ModBrush_LoadGLStuff(void *ctx, void *data, size_t a, size_t b) // maps |= SHADER_HASNORMALMAP; if (gl_specular.ival) maps |= SHADER_HASGLOSS; - R_BuildLegacyTexnums(mod->textures[a]->shader, mod->textures[a]->name, loadname, maps, IF_WORLDTEX, TF_MIP4_8PAL24, mod->textures[a]->width, mod->textures[a]->height, mod->textures[a]->mips, mod->textures[a]->palette); + R_BuildLegacyTexnums(mod->textures[a]->shader, mod->textures[a]->name, loadname, maps, IF_WORLDTEX, TF_MIP4_8PAL24_T255, mod->textures[a]->width, mod->textures[a]->height, mod->textures[a]->mips, mod->textures[a]->palette); BZ_Free(mod->textures[a]->mips[0]); } } diff --git a/engine/gl/gl_shader.c b/engine/gl/gl_shader.c index 56d6ed61d..269116698 100644 --- a/engine/gl/gl_shader.c +++ b/engine/gl/gl_shader.c @@ -6550,6 +6550,7 @@ void Shader_DefaultBSPQ2(parsestate_t *ps, const char *shortname, const void *ar { Shader_DefaultScript(ps, shortname, "{\n" + "sort sky\n" "surfaceparm nodlight\n" "skyparms - - -\n" "}\n" diff --git a/engine/gl/gl_warp.c b/engine/gl/gl_warp.c index 7532563ed..328e7a2cc 100644 --- a/engine/gl/gl_warp.c +++ b/engine/gl/gl_warp.c @@ -79,7 +79,12 @@ void R_SetSky(const char *sky) tex.reflectcube = R_LoadHiResTexture(sky, "env:gfx/env", IF_LOADNOW|IF_TEXTYPE_CUBE|IF_CLAMP); if (tex.reflectcube->width) { - forcedsky = R_RegisterShader(va("skybox_%s", sky), 0, "{\nsort sky\nprogram defaultskybox\n{\ndepthwrite\nmap \"$cube:$reflectcube\"\ntcgen skybox\n}\nsurfaceparm nodlight\nsurfaceparm sky\n}"); + /* FIXME: Q2/HL require the skybox to not draw over geometry, shouldn't we force it? --eukara */ + if (cls.allow_skyboxes) { + forcedsky = R_RegisterShader(va("skybox_%s", sky), 0, "{\nsort sky\nprogram defaultskybox\n{\nmap \"$cube:$reflectcube\"\ntcgen skybox\n}\nsurfaceparm nodlight\nsurfaceparm sky\n}"); + } else { + forcedsky = R_RegisterShader(va("skybox_%s", sky), 0, "{\nsort sky\nprogram defaultskybox\n{\ndepthwrite\nmap \"$cube:$reflectcube\"\ntcgen skybox\n}\nsurfaceparm nodlight\nsurfaceparm sky\n}"); + } R_BuildDefaultTexnums(&tex, forcedsky, IF_WORLDTEX); return; }