1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-06-07 09:01:53 +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:
fgenesis 2013-05-02 04:31:07 +02:00
parent 811b015983
commit 12ea97f051
13 changed files with 24 additions and 24 deletions

View file

@ -142,7 +142,7 @@ void Beam::render()
void Beam::onRender()
{
#ifdef BBGE_BUILD_OPENGL
glDisable(GL_CULL_FACE);
//glDisable(GL_CULL_FACE);
Vector diff = endPos - position;
Vector side = diff;
//side.normalize2D();

View file

@ -62,7 +62,7 @@ void CurrentRender::onRender()
{
#ifdef BBGE_BUILD_OPENGL
// note: Leave cull_face disabled!?
glDisable(GL_CULL_FACE);
//glDisable(GL_CULL_FACE);
//int qs = 0;
for (Path *p = dsq->game->getFirstPathOfType(PATH_CURRENT); p; p = p->nextOfType)
{
@ -308,7 +308,7 @@ void CurrentRender::onRender()
//glEnd();
}
glEnable(GL_CULL_FACE);
//glEnable(GL_CULL_FACE);
/*
std::ostringstream os;

View file

@ -130,7 +130,7 @@ HairNode *Hair::getHairNode(int idx)
void Hair::onRender()
{
#ifdef BBGE_BUILD_OPENGL
glDisable(GL_CULL_FACE);
//glDisable(GL_CULL_FACE);
glBegin(GL_QUAD_STRIP);
float texBits = 1.0f / (hairNodes.size()-1);
@ -192,7 +192,7 @@ void Hair::onRender()
}
*/
glEnable(GL_CULL_FACE);
//glEnable(GL_CULL_FACE);
#endif
}

View file

@ -41,7 +41,7 @@ void SteamRender::onUpdate(float dt)
void SteamRender::onRender()
{
#ifdef BBGE_BUILD_OPENGL
glDisable(GL_CULL_FACE);
//glDisable(GL_CULL_FACE);
//int qs = 0;
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
}

View file

@ -150,7 +150,7 @@ void Web::onRender()
//glDisable(GL_BLEND);
glLineWidth(4);
glDisable(GL_CULL_FACE);
//glDisable(GL_CULL_FACE);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glBegin(GL_LINES);

View file

@ -266,9 +266,9 @@ protected:
q->setBlendType(BLEND_ADD);
addChild(q, PM_POINTER);
std::ostringstream os;
os << "children: " << children.size();
debugLog(os.str());
//std::ostringstream os;
//os << "children: " << children.size();
//debugLog(os.str());
}
else
{

View file

@ -301,7 +301,7 @@ bool exists(const std::string &f, bool makeFatal, bool skipVFS)
void drawCircle(float radius, int stepSize)
{
#ifdef BBGE_BUILD_OPENGL
glDisable(GL_CULL_FACE);
//glDisable(GL_CULL_FACE);
glBegin(GL_POLYGON);
{
@ -312,7 +312,7 @@ void drawCircle(float radius, int stepSize)
}
glEnd();
glEnable(GL_CULL_FACE);
//glEnable(GL_CULL_FACE);
#endif
}

View file

@ -317,7 +317,7 @@ void BitmapText::onRender()
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
*/
glDisable(GL_CULL_FACE);
//glDisable(GL_CULL_FACE);
//glScalef(1, -1, 0);
@ -374,7 +374,7 @@ void BitmapText::onRender()
}
}
glEnable(GL_CULL_FACE);
//glEnable(GL_CULL_FACE);
glBindTexture(GL_TEXTURE_2D, 0);
#endif

View file

@ -306,7 +306,7 @@ void Emitter::onRender()
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);
}

View file

@ -499,7 +499,7 @@ void Quad::onRender()
if (!strip.empty())
{
//glDisable(GL_BLEND);gggg
glDisable(GL_CULL_FACE);
//glDisable(GL_CULL_FACE);
const float texBits = 1.0f / (strip.size()-1);
@ -517,7 +517,7 @@ void Quad::onRender()
}
glEnd();
glEnable(GL_CULL_FACE);
//glEnable(GL_CULL_FACE);
glBindTexture( GL_TEXTURE_2D, 0 );
glColor4f(1,0,0,1);
glPointSize(64);

View file

@ -59,7 +59,7 @@ void QuadTrail::onRender()
if (numPoints < 2) return;
#ifdef BBGE_BUILD_OPENGL
glDisable(GL_CULL_FACE);
//glDisable(GL_CULL_FACE);
int c = 0;
Vector p, diff, dl, dr;
Vector lastPoint;

View file

@ -629,7 +629,7 @@ void RenderObject::renderCall()
glTranslatef(position.x, position.y, position.z);
if (isfh())
{
glDisable(GL_CULL_FACE);
//glDisable(GL_CULL_FACE);
glRotatef(180, 0, 1, 0);
}
@ -655,7 +655,7 @@ void RenderObject::renderCall()
glTranslatef(pos.x, pos.y, pos.z);
if (isfh())
{
glDisable(GL_CULL_FACE);
//glDisable(GL_CULL_FACE);
glRotatef(180, 0, 1, 0);
}
glRotatef(rotation.z+rotationOffset.z, 0, 0, 1);
@ -714,7 +714,7 @@ void RenderObject::renderCall()
glRotatef(rotation.z+rotationOffset.z, 0, 0, 1);
if (isfh())
{
glDisable(GL_CULL_FACE);
//glDisable(GL_CULL_FACE);
glRotatef(180, 0, 1, 0);
}
#endif

View file

@ -105,7 +105,7 @@ void RoundedRect::onRender()
//glBindTexture(GL_TEXTURE_2D, 0);
int w2 = width/2;
int h2 = height/2;
glDisable(GL_CULL_FACE);
//glDisable(GL_CULL_FACE);
float iter = 0.1f;
glBegin(GL_QUADS);
@ -167,7 +167,7 @@ void RoundedRect::onRender()
glEnd();
glEnable(GL_CULL_FACE);
//glEnable(GL_CULL_FACE);
}
void RoundedRect::show()