[effects] Remove clip plane from Cube effect

It broke the rendering of the reflection.
This commit is contained in:
Martin Gräßlin 2016-01-27 16:58:25 +01:00
parent 613d76f2df
commit 5f15528428

View file

@ -381,10 +381,6 @@ void CubeEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data)
m_reflectionMatrix.translate(0.0, sin(fabs(manualAngle) * M_PI / 360.0f * float(effects->numberOfDesktops())) * addedHeight2 + addedHeight1 - float(rect.height()), 0.0);
}
// TODO: find a solution for GLES
if (!GLPlatform::instance()->isGLES()) {
glEnable(GL_CLIP_PLANE0);
}
reflectionPainting = true;
glEnable(GL_CULL_FACE);
paintCap(true, -point - zTranslate, data.projectionMatrix());
@ -399,10 +395,6 @@ void CubeEffect::paintScreen(int mask, QRegion region, ScreenPaintData& data)
paintCap(false, -point - zTranslate, data.projectionMatrix());
glDisable(GL_CULL_FACE);
reflectionPainting = false;
// TODO: find a solution for GLES
if (!GLPlatform::instance()->isGLES()) {
glDisable(GL_CLIP_PLANE0);
}
const float width = rect.width();
const float height = rect.height();
@ -1713,14 +1705,6 @@ void CubeEffect::setActive(bool active)
desktopChangedWhileRotating = false;
if (reflection) {
QRect rect = effects->clientArea(FullArea, activeScreen, effects->currentDesktop());
// clip parts above the reflection area
if (!GLPlatform::instance()->isGLES()) {
double eqn[4] = {0.0, 1.0, 0.0, 0.0};
glPushMatrix();
glTranslatef(0.0, rect.height(), 0.0);
glClipPlane(GL_CLIP_PLANE0, eqn);
glPopMatrix();
}
float temporaryCoeff = float(rect.width()) / tan(M_PI / float(effects->numberOfDesktops()));
mAddedHeightCoeff1 = sqrt(float(rect.height()) * float(rect.height()) + temporaryCoeff * temporaryCoeff);
mAddedHeightCoeff2 = sqrt(float(rect.height()) * float(rect.height()) + float(rect.width()) * float(rect.width()) + temporaryCoeff * temporaryCoeff);