mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-26 03:30:46 +00:00
Little multi-light optimization.
git-svn-id: https://svn.eduke32.com/eduke32@1263 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
a11513c907
commit
6e2bac1c92
1 changed files with 26 additions and 29 deletions
|
@ -1201,28 +1201,6 @@ static void polymer_displayrooms(int16_t dacursectnum)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define OMGDRAWSHITVBO \
|
|
||||||
bglBindBufferARB(GL_ARRAY_BUFFER_ARB, plane->vbo); \
|
|
||||||
bglVertexPointer(3, GL_FLOAT, 5 * sizeof(GLfloat), NULL); \
|
|
||||||
bglTexCoordPointer(2, GL_FLOAT, 5 * sizeof(GLfloat), (GLfloat*)(3 * sizeof(GLfloat))); \
|
|
||||||
if (!plane->indices) \
|
|
||||||
bglDrawArrays(GL_QUADS, 0, 4); \
|
|
||||||
else \
|
|
||||||
{ \
|
|
||||||
bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, plane->ivbo); \
|
|
||||||
bglDrawElements(GL_TRIANGLES, plane->indicescount, GL_UNSIGNED_SHORT, NULL); \
|
|
||||||
} \
|
|
||||||
bglBindBufferARB(GL_ARRAY_BUFFER_ARB, 0); \
|
|
||||||
bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0)
|
|
||||||
|
|
||||||
#define OMGDRAWSHIT \
|
|
||||||
bglVertexPointer(3, GL_FLOAT, 5 * sizeof(GLfloat), plane->buffer); \
|
|
||||||
bglTexCoordPointer(2, GL_FLOAT, 5 * sizeof(GLfloat), &plane->buffer[3]); \
|
|
||||||
if (!plane->indices) \
|
|
||||||
bglDrawArrays(GL_QUADS, 0, 4); \
|
|
||||||
else \
|
|
||||||
bglDrawElements(GL_TRIANGLES, plane->indicescount, GL_UNSIGNED_SHORT, plane->indices)
|
|
||||||
|
|
||||||
static void polymer_drawplane(_prplane* plane)
|
static void polymer_drawplane(_prplane* plane)
|
||||||
{
|
{
|
||||||
int32_t materialbits;
|
int32_t materialbits;
|
||||||
|
@ -1269,6 +1247,18 @@ static void polymer_drawplane(_prplane* plane)
|
||||||
|
|
||||||
bglNormal3f((float)(plane->plane[0]), (float)(plane->plane[1]), (float)(plane->plane[2]));
|
bglNormal3f((float)(plane->plane[0]), (float)(plane->plane[1]), (float)(plane->plane[2]));
|
||||||
|
|
||||||
|
if (plane->vbo && (pr_vbos > 0))
|
||||||
|
{
|
||||||
|
bglBindBufferARB(GL_ARRAY_BUFFER_ARB, plane->vbo);
|
||||||
|
bglVertexPointer(3, GL_FLOAT, 5 * sizeof(GLfloat), NULL);
|
||||||
|
bglTexCoordPointer(2, GL_FLOAT, 5 * sizeof(GLfloat), (GLfloat*)(3 * sizeof(GLfloat)));
|
||||||
|
if (plane->indices)
|
||||||
|
bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, plane->ivbo);
|
||||||
|
} else {
|
||||||
|
bglVertexPointer(3, GL_FLOAT, 5 * sizeof(GLfloat), plane->buffer);
|
||||||
|
bglTexCoordPointer(2, GL_FLOAT, 5 * sizeof(GLfloat), &plane->buffer[3]);
|
||||||
|
}
|
||||||
|
|
||||||
curlight = 0;
|
curlight = 0;
|
||||||
|
|
||||||
while ((curlight == 0) || (curlight < plane->lightcount))
|
while ((curlight == 0) || (curlight < plane->lightcount))
|
||||||
|
@ -1282,19 +1272,26 @@ static void polymer_drawplane(_prplane* plane)
|
||||||
bglVertexAttrib3fvARB(prprograms[materialbits].attrib_N, plane->plane);
|
bglVertexAttrib3fvARB(prprograms[materialbits].attrib_N, plane->plane);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plane->vbo && (pr_vbos > 0))
|
if (plane->indices)
|
||||||
{
|
{
|
||||||
OMGDRAWSHITVBO;
|
if (plane->vbo && (pr_vbos > 0))
|
||||||
}
|
bglDrawElements(GL_TRIANGLES, plane->indicescount, GL_UNSIGNED_SHORT, NULL);
|
||||||
else
|
else
|
||||||
{
|
bglDrawElements(GL_TRIANGLES, plane->indicescount, GL_UNSIGNED_SHORT, plane->indices);
|
||||||
OMGDRAWSHIT;
|
} else
|
||||||
}
|
bglDrawArrays(GL_QUADS, 0, 4);
|
||||||
|
|
||||||
polymer_unbindmaterial(materialbits);
|
polymer_unbindmaterial(materialbits);
|
||||||
|
|
||||||
curlight++;
|
curlight++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (plane->vbo && (pr_vbos > 0))
|
||||||
|
{
|
||||||
|
bglBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
|
||||||
|
if (plane->indices)
|
||||||
|
bglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void polymer_inb4mirror(GLfloat* buffer, GLfloat* plane)
|
static void polymer_inb4mirror(GLfloat* buffer, GLfloat* plane)
|
||||||
|
|
Loading…
Reference in a new issue