mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-13 06:13:18 +00:00
Make sky dome look a bit better
This commit is contained in:
parent
f0b4a609a8
commit
c6f3e4d53d
1 changed files with 14 additions and 19 deletions
|
@ -1456,7 +1456,7 @@ typedef struct
|
||||||
static int rows, columns;
|
static int rows, columns;
|
||||||
static boolean yflip;
|
static boolean yflip;
|
||||||
static int texw, texh;
|
static int texw, texh;
|
||||||
static float yAdd;
|
static float yMult, yAdd;
|
||||||
static boolean foglayer;
|
static boolean foglayer;
|
||||||
static float delta = 0.0f;
|
static float delta = 0.0f;
|
||||||
static int gl_sky_detail = 16;
|
static int gl_sky_detail = 16;
|
||||||
|
@ -1487,30 +1487,24 @@ static void SkyVertex(vbo_vertex_t *vbo, int r, int c)
|
||||||
|
|
||||||
if (!foglayer)
|
if (!foglayer)
|
||||||
{
|
{
|
||||||
|
boolean flip = yflip;
|
||||||
vbo->r = 255;
|
vbo->r = 255;
|
||||||
vbo->g = 255;
|
vbo->g = 255;
|
||||||
vbo->b = 255;
|
vbo->b = 255;
|
||||||
vbo->a = (r == 0 ? 0 : 255);
|
vbo->a = (r == 0 ? 0 : 255);
|
||||||
|
|
||||||
|
// Flip Y coordinate anyway for the top part of the hemisphere
|
||||||
|
if (r <= 1)
|
||||||
|
flip = !flip;
|
||||||
|
|
||||||
// And the texture coordinates.
|
// And the texture coordinates.
|
||||||
if (!yflip) // Flipped Y is for the lower hemisphere.
|
vbo->u = (-timesRepeat * c / (float)columns);
|
||||||
{
|
if (!flip) // Flipped Y is for the lower hemisphere.
|
||||||
vbo->u = (-timesRepeat * c / (float)columns);
|
vbo->v = (r / (float)rows) * 1.f * yMult + yAdd;
|
||||||
vbo->v = (r / (float)rows) * 1.f + yAdd;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
vbo->v = ((rows-r)/(float)rows) * 1.f * yMult + yAdd;
|
||||||
vbo->u = (-timesRepeat * c / (float)columns);
|
|
||||||
vbo->v = ((rows-r)/(float)rows) * 1.f + yAdd;
|
|
||||||
}
|
|
||||||
|
|
||||||
//if (SkyBox.wall.flag == GLDWF_SKYFLIP)
|
|
||||||
// vbo->u = -vbo->u;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r != 4)
|
|
||||||
y += FRACUNIT * 300;
|
|
||||||
|
|
||||||
// And finally the vertex.
|
// And finally the vertex.
|
||||||
vbo->x = (float)x/(float)MAP_SCALE;
|
vbo->x = (float)x/(float)MAP_SCALE;
|
||||||
vbo->y = (float)y/(float)MAP_SCALE + delta;
|
vbo->y = (float)y/(float)MAP_SCALE + delta;
|
||||||
|
@ -1550,7 +1544,8 @@ static void gld_BuildSky(int row_count, int col_count)
|
||||||
|
|
||||||
memset(&SkyColor, 0xFF, sizeof(SkyColor));
|
memset(&SkyColor, 0xFF, sizeof(SkyColor));
|
||||||
|
|
||||||
for (yflip = 0; yflip < 2; yflip++)
|
// Why not?
|
||||||
|
for (yflip = false; yflip <= true; yflip++)
|
||||||
{
|
{
|
||||||
vbo->loops[vbo->loopcount].mode = GL_TRIANGLE_FAN;
|
vbo->loops[vbo->loopcount].mode = GL_TRIANGLE_FAN;
|
||||||
vbo->loops[vbo->loopcount].vertexindex = vertex_p - &vbo->data[0];
|
vbo->loops[vbo->loopcount].vertexindex = vertex_p - &vbo->data[0];
|
||||||
|
@ -1559,6 +1554,7 @@ static void gld_BuildSky(int row_count, int col_count)
|
||||||
vbo->loopcount++;
|
vbo->loopcount++;
|
||||||
|
|
||||||
yAdd = 0.5f;
|
yAdd = 0.5f;
|
||||||
|
yMult = 1.0f;
|
||||||
/*if (yflip == 0)
|
/*if (yflip == 0)
|
||||||
SkyColor = &sky->CeilingSkyColor[vbo_idx];
|
SkyColor = &sky->CeilingSkyColor[vbo_idx];
|
||||||
else
|
else
|
||||||
|
@ -1584,7 +1580,7 @@ static void gld_BuildSky(int row_count, int col_count)
|
||||||
vbo->loops[vbo->loopcount].mode = GL_TRIANGLE_STRIP;
|
vbo->loops[vbo->loopcount].mode = GL_TRIANGLE_STRIP;
|
||||||
vbo->loops[vbo->loopcount].vertexindex = vertex_p - &vbo->data[0];
|
vbo->loops[vbo->loopcount].vertexindex = vertex_p - &vbo->data[0];
|
||||||
vbo->loops[vbo->loopcount].vertexcount = 2 * col_count + 2;
|
vbo->loops[vbo->loopcount].vertexcount = 2 * col_count + 2;
|
||||||
vbo->loops[vbo->loopcount].use_texture = true;
|
vbo->loops[vbo->loopcount].use_texture = true; //(r > 1) ? true : false;
|
||||||
vbo->loopcount++;
|
vbo->loopcount++;
|
||||||
|
|
||||||
for (c = 0; c <= col_count; c++)
|
for (c = 0; c <= col_count; c++)
|
||||||
|
@ -1617,7 +1613,6 @@ static void RenderDomeForReal(INT32 skytexture)
|
||||||
|
|
||||||
for (j = 0; j < 2; j++)
|
for (j = 0; j < 2; j++)
|
||||||
{
|
{
|
||||||
//gld_EnableTexture2D(GL_TEXTURE0_ARB, j != 0);
|
|
||||||
for (i = 0; i < vbo->loopcount; i++)
|
for (i = 0; i < vbo->loopcount; i++)
|
||||||
{
|
{
|
||||||
GLSkyLoopDef *loop = &vbo->loops[i];
|
GLSkyLoopDef *loop = &vbo->loops[i];
|
||||||
|
|
Loading…
Reference in a new issue