But the thing is that you don't. It's actually completely unnecessary.
This one is based on the FitzQuake 0.85 code, but it's easily adaptable to any engine.
First of all, find this code block:
Code: Select all
void Sky_EmitSkyBoxVertex (float s, float t, int axis)
{
vec3_t v, b;
int j, k;
float w, h;
b[0] = s * gl_farclip.value / sqrt(3.0);
b[1] = t * gl_farclip.value / sqrt(3.0);
b[2] = gl_farclip.value / sqrt(3.0);
Code: Select all
void Sky_EmitSkyBoxVertex (float s, float t, int axis)
{
vec3_t v, b;
int j, k;
float w, h;
b[0] = s * 10.0f;
b[1] = t * 10.0f;
b[2] = 10.0f;
Code: Select all
void Sky_SetBoxVert (float s, float t, int axis, vec3_t v)
{
vec3_t b;
int j, k;
b[0] = s * gl_farclip.value / sqrt(3.0);
b[1] = t * gl_farclip.value / sqrt(3.0);
b[2] = gl_farclip.value / sqrt(3.0);
Code: Select all
void Sky_SetBoxVert (float s, float t, int axis, vec3_t v)
{
vec3_t b;
int j, k;
b[0] = s * 10.0f;
b[1] = t * 10.0f;
b[2] = 10.0f;
Code: Select all
if (!r_fastsky.value && !(Fog_GetDensity() > 0 && r_skyfog.value >= 1))
{
glDepthFunc(GL_GEQUAL);
glDepthMask(0);
if (skybox_name[0])
Sky_DrawSkyBox ();
else
Sky_DrawSkyLayers();
glDepthMask(1);
glDepthFunc(GL_LEQUAL);
}
Code: Select all
if (!r_fastsky.value && !(Fog_GetDensity() > 0 && r_skyfog.value >= 1))
{
glDepthRange (1, 1);
glDepthFunc(GL_GEQUAL);
glDepthMask(0);
if (skybox_name[0])
Sky_DrawSkyBox ();
else
Sky_DrawSkyLayers();
glDepthMask(1);
glDepthFunc(GL_LEQUAL);
glDepthRange (0, 1);
}