mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-06-07 17:11:56 +00:00
Disable all glEnable/glDisable() calls for GL_CULL_FACE, except one glDisable() during renderer init.
GL_CULL_FACE is effectively always disabled, except for quad strip rendering, and keeping GL_CULL_FACE disabled there does not seem to cause any visual artifacts. Instead, it enhances skeletal animation possibilities (e.g. flipping bone strips over without it disappearing)
This commit is contained in:
parent
811b015983
commit
12ea97f051
13 changed files with 24 additions and 24 deletions
|
@ -142,7 +142,7 @@ void Beam::render()
|
||||||
void Beam::onRender()
|
void Beam::onRender()
|
||||||
{
|
{
|
||||||
#ifdef BBGE_BUILD_OPENGL
|
#ifdef BBGE_BUILD_OPENGL
|
||||||
glDisable(GL_CULL_FACE);
|
//glDisable(GL_CULL_FACE);
|
||||||
Vector diff = endPos - position;
|
Vector diff = endPos - position;
|
||||||
Vector side = diff;
|
Vector side = diff;
|
||||||
//side.normalize2D();
|
//side.normalize2D();
|
||||||
|
|
|
@ -62,7 +62,7 @@ void CurrentRender::onRender()
|
||||||
{
|
{
|
||||||
#ifdef BBGE_BUILD_OPENGL
|
#ifdef BBGE_BUILD_OPENGL
|
||||||
// note: Leave cull_face disabled!?
|
// note: Leave cull_face disabled!?
|
||||||
glDisable(GL_CULL_FACE);
|
//glDisable(GL_CULL_FACE);
|
||||||
//int qs = 0;
|
//int qs = 0;
|
||||||
for (Path *p = dsq->game->getFirstPathOfType(PATH_CURRENT); p; p = p->nextOfType)
|
for (Path *p = dsq->game->getFirstPathOfType(PATH_CURRENT); p; p = p->nextOfType)
|
||||||
{
|
{
|
||||||
|
@ -308,7 +308,7 @@ void CurrentRender::onRender()
|
||||||
//glEnd();
|
//glEnd();
|
||||||
|
|
||||||
}
|
}
|
||||||
glEnable(GL_CULL_FACE);
|
//glEnable(GL_CULL_FACE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
|
|
|
@ -130,7 +130,7 @@ HairNode *Hair::getHairNode(int idx)
|
||||||
void Hair::onRender()
|
void Hair::onRender()
|
||||||
{
|
{
|
||||||
#ifdef BBGE_BUILD_OPENGL
|
#ifdef BBGE_BUILD_OPENGL
|
||||||
glDisable(GL_CULL_FACE);
|
//glDisable(GL_CULL_FACE);
|
||||||
|
|
||||||
glBegin(GL_QUAD_STRIP);
|
glBegin(GL_QUAD_STRIP);
|
||||||
float texBits = 1.0f / (hairNodes.size()-1);
|
float texBits = 1.0f / (hairNodes.size()-1);
|
||||||
|
@ -192,7 +192,7 @@ void Hair::onRender()
|
||||||
}
|
}
|
||||||
|
|
||||||
*/
|
*/
|
||||||
glEnable(GL_CULL_FACE);
|
//glEnable(GL_CULL_FACE);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ void SteamRender::onUpdate(float dt)
|
||||||
void SteamRender::onRender()
|
void SteamRender::onRender()
|
||||||
{
|
{
|
||||||
#ifdef BBGE_BUILD_OPENGL
|
#ifdef BBGE_BUILD_OPENGL
|
||||||
glDisable(GL_CULL_FACE);
|
//glDisable(GL_CULL_FACE);
|
||||||
//int qs = 0;
|
//int qs = 0;
|
||||||
|
|
||||||
for (Path *p = dsq->game->getFirstPathOfType(PATH_STEAM); p; p = p->nextOfType)
|
for (Path *p = dsq->game->getFirstPathOfType(PATH_STEAM); p; p = p->nextOfType)
|
||||||
|
@ -121,7 +121,7 @@ void SteamRender::onRender()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
glEnable(GL_CULL_FACE);
|
//glEnable(GL_CULL_FACE);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -150,7 +150,7 @@ void Web::onRender()
|
||||||
//glDisable(GL_BLEND);
|
//glDisable(GL_BLEND);
|
||||||
|
|
||||||
glLineWidth(4);
|
glLineWidth(4);
|
||||||
glDisable(GL_CULL_FACE);
|
//glDisable(GL_CULL_FACE);
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
|
||||||
glBegin(GL_LINES);
|
glBegin(GL_LINES);
|
||||||
|
|
|
@ -266,9 +266,9 @@ protected:
|
||||||
q->setBlendType(BLEND_ADD);
|
q->setBlendType(BLEND_ADD);
|
||||||
addChild(q, PM_POINTER);
|
addChild(q, PM_POINTER);
|
||||||
|
|
||||||
std::ostringstream os;
|
//std::ostringstream os;
|
||||||
os << "children: " << children.size();
|
//os << "children: " << children.size();
|
||||||
debugLog(os.str());
|
//debugLog(os.str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -301,7 +301,7 @@ bool exists(const std::string &f, bool makeFatal, bool skipVFS)
|
||||||
void drawCircle(float radius, int stepSize)
|
void drawCircle(float radius, int stepSize)
|
||||||
{
|
{
|
||||||
#ifdef BBGE_BUILD_OPENGL
|
#ifdef BBGE_BUILD_OPENGL
|
||||||
glDisable(GL_CULL_FACE);
|
//glDisable(GL_CULL_FACE);
|
||||||
|
|
||||||
glBegin(GL_POLYGON);
|
glBegin(GL_POLYGON);
|
||||||
{
|
{
|
||||||
|
@ -312,7 +312,7 @@ void drawCircle(float radius, int stepSize)
|
||||||
}
|
}
|
||||||
glEnd();
|
glEnd();
|
||||||
|
|
||||||
glEnable(GL_CULL_FACE);
|
//glEnable(GL_CULL_FACE);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -317,7 +317,7 @@ void BitmapText::onRender()
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
*/
|
*/
|
||||||
glDisable(GL_CULL_FACE);
|
//glDisable(GL_CULL_FACE);
|
||||||
|
|
||||||
//glScalef(1, -1, 0);
|
//glScalef(1, -1, 0);
|
||||||
|
|
||||||
|
@ -374,7 +374,7 @@ void BitmapText::onRender()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
glEnable(GL_CULL_FACE);
|
//glEnable(GL_CULL_FACE);
|
||||||
glBindTexture(GL_TEXTURE_2D, 0);
|
glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -306,7 +306,7 @@ void Emitter::onRender()
|
||||||
|
|
||||||
if (data.flipH || (data.copyParentFlip && (pe->isfh() || (pe->getParent() && pe->getParent()->isfh()))))
|
if (data.flipH || (data.copyParentFlip && (pe->isfh() || (pe->getParent() && pe->getParent()->isfh()))))
|
||||||
{
|
{
|
||||||
glDisable(GL_CULL_FACE);
|
//glDisable(GL_CULL_FACE);
|
||||||
glRotatef(180, 0, 1, 0);
|
glRotatef(180, 0, 1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -499,7 +499,7 @@ void Quad::onRender()
|
||||||
if (!strip.empty())
|
if (!strip.empty())
|
||||||
{
|
{
|
||||||
//glDisable(GL_BLEND);gggg
|
//glDisable(GL_BLEND);gggg
|
||||||
glDisable(GL_CULL_FACE);
|
//glDisable(GL_CULL_FACE);
|
||||||
|
|
||||||
const float texBits = 1.0f / (strip.size()-1);
|
const float texBits = 1.0f / (strip.size()-1);
|
||||||
|
|
||||||
|
@ -517,7 +517,7 @@ void Quad::onRender()
|
||||||
}
|
}
|
||||||
glEnd();
|
glEnd();
|
||||||
|
|
||||||
glEnable(GL_CULL_FACE);
|
//glEnable(GL_CULL_FACE);
|
||||||
glBindTexture( GL_TEXTURE_2D, 0 );
|
glBindTexture( GL_TEXTURE_2D, 0 );
|
||||||
glColor4f(1,0,0,1);
|
glColor4f(1,0,0,1);
|
||||||
glPointSize(64);
|
glPointSize(64);
|
||||||
|
|
|
@ -59,7 +59,7 @@ void QuadTrail::onRender()
|
||||||
if (numPoints < 2) return;
|
if (numPoints < 2) return;
|
||||||
|
|
||||||
#ifdef BBGE_BUILD_OPENGL
|
#ifdef BBGE_BUILD_OPENGL
|
||||||
glDisable(GL_CULL_FACE);
|
//glDisable(GL_CULL_FACE);
|
||||||
int c = 0;
|
int c = 0;
|
||||||
Vector p, diff, dl, dr;
|
Vector p, diff, dl, dr;
|
||||||
Vector lastPoint;
|
Vector lastPoint;
|
||||||
|
|
|
@ -629,7 +629,7 @@ void RenderObject::renderCall()
|
||||||
glTranslatef(position.x, position.y, position.z);
|
glTranslatef(position.x, position.y, position.z);
|
||||||
if (isfh())
|
if (isfh())
|
||||||
{
|
{
|
||||||
glDisable(GL_CULL_FACE);
|
//glDisable(GL_CULL_FACE);
|
||||||
glRotatef(180, 0, 1, 0);
|
glRotatef(180, 0, 1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -655,7 +655,7 @@ void RenderObject::renderCall()
|
||||||
glTranslatef(pos.x, pos.y, pos.z);
|
glTranslatef(pos.x, pos.y, pos.z);
|
||||||
if (isfh())
|
if (isfh())
|
||||||
{
|
{
|
||||||
glDisable(GL_CULL_FACE);
|
//glDisable(GL_CULL_FACE);
|
||||||
glRotatef(180, 0, 1, 0);
|
glRotatef(180, 0, 1, 0);
|
||||||
}
|
}
|
||||||
glRotatef(rotation.z+rotationOffset.z, 0, 0, 1);
|
glRotatef(rotation.z+rotationOffset.z, 0, 0, 1);
|
||||||
|
@ -714,7 +714,7 @@ void RenderObject::renderCall()
|
||||||
glRotatef(rotation.z+rotationOffset.z, 0, 0, 1);
|
glRotatef(rotation.z+rotationOffset.z, 0, 0, 1);
|
||||||
if (isfh())
|
if (isfh())
|
||||||
{
|
{
|
||||||
glDisable(GL_CULL_FACE);
|
//glDisable(GL_CULL_FACE);
|
||||||
glRotatef(180, 0, 1, 0);
|
glRotatef(180, 0, 1, 0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -105,7 +105,7 @@ void RoundedRect::onRender()
|
||||||
//glBindTexture(GL_TEXTURE_2D, 0);
|
//glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
int w2 = width/2;
|
int w2 = width/2;
|
||||||
int h2 = height/2;
|
int h2 = height/2;
|
||||||
glDisable(GL_CULL_FACE);
|
//glDisable(GL_CULL_FACE);
|
||||||
float iter = 0.1f;
|
float iter = 0.1f;
|
||||||
|
|
||||||
glBegin(GL_QUADS);
|
glBegin(GL_QUADS);
|
||||||
|
@ -167,7 +167,7 @@ void RoundedRect::onRender()
|
||||||
|
|
||||||
glEnd();
|
glEnd();
|
||||||
|
|
||||||
glEnable(GL_CULL_FACE);
|
//glEnable(GL_CULL_FACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RoundedRect::show()
|
void RoundedRect::show()
|
||||||
|
|
Loading…
Add table
Reference in a new issue