Changeset View
Changeset View
Standalone View
Standalone View
effects/screenedge/screenedgeeffect.cpp
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Line(s) | 95 | for (QHash<ElectricBorder, Glow*>::iterator it = m_borders.begin(); | |||
---|---|---|---|---|---|
97 | ++it) { | 97 | ++it) { | ||
98 | const qreal opacity = (*it)->strength; | 98 | const qreal opacity = (*it)->strength; | ||
99 | if (opacity == 0.0) { | 99 | if (opacity == 0.0) { | ||
100 | continue; | 100 | continue; | ||
101 | } | 101 | } | ||
102 | if (effects->isOpenGLCompositing()) { | 102 | if (effects->isOpenGLCompositing()) { | ||
103 | GLTexture *texture = (*it)->texture.data(); | 103 | GLTexture *texture = (*it)->texture.data(); | ||
104 | glEnable(GL_BLEND); | 104 | glEnable(GL_BLEND); | ||
105 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 105 | glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); | ||
106 | texture->bind(); | 106 | texture->bind(); | ||
107 | ShaderBinder binder(ShaderTrait::MapTexture | ShaderTrait::Modulate); | 107 | ShaderBinder binder(ShaderTrait::MapTexture | ShaderTrait::Modulate); | ||
108 | const QVector4D constant(opacity, opacity, opacity, opacity); | 108 | const QVector4D constant(opacity, opacity, opacity, opacity); | ||
109 | binder.shader()->setUniform(GLShader::ModulationConstant, constant); | 109 | binder.shader()->setUniform(GLShader::ModulationConstant, constant); | ||
110 | QMatrix4x4 mvp = data.projectionMatrix(); | 110 | QMatrix4x4 mvp = data.projectionMatrix(); | ||
111 | mvp.translate((*it)->geometry.x(), (*it)->geometry.y()); | 111 | mvp.translate((*it)->geometry.x(), (*it)->geometry.y()); | ||
112 | binder.shader()->setUniform(GLShader::ModelViewProjectionMatrix, mvp); | 112 | binder.shader()->setUniform(GLShader::ModelViewProjectionMatrix, mvp); | ||
113 | texture->render(infiniteRegion(), (*it)->geometry); | 113 | texture->render(infiniteRegion(), (*it)->geometry); | ||
▲ Show 20 Lines • Show All 248 Lines • Show Last 20 Lines |