1
0
Fork 0
forked from fte/fteqw

Fix wrong Quake 2 BSP rendering properties and serverinfo allow_skybox

1.


git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5618 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Eukara 2020-02-12 02:09:26 +00:00
parent 7dfdd68dd5
commit e655d13d0e
3 changed files with 8 additions and 2 deletions

View file

@ -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]);
}
}

View file

@ -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"

View file

@ -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)
{
/* 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;
}