mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-30 03:55:40 +00:00
Added opacity support to the BGRA to RGBA shader.
This commit is contained in:
parent
f585f87497
commit
69c1a1259d
|
@ -363,6 +363,8 @@ namespace Renderer
|
|||
if (runShader) {
|
||||
runShader->activateShaders();
|
||||
runShader->setModelViewProjectionMatrix(getProjectionMatrix() * trans);
|
||||
if (vertices->opacity < 1.0f)
|
||||
runShader->setOpacity(vertices->opacity);
|
||||
GL_CHECK_ERROR(glDrawArrays(GL_TRIANGLE_STRIP, 0, numVertices));
|
||||
runShader->deactivateShaders();
|
||||
}
|
||||
|
|
|
@ -21,13 +21,14 @@ void main(void)
|
|||
#elif defined(FRAGMENT)
|
||||
// Fragment section of code:
|
||||
|
||||
uniform float opacity = 1.0;
|
||||
uniform sampler2D myTexture;
|
||||
varying vec2 vTexCoord;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 color = texture2D(myTexture, vTexCoord);
|
||||
gl_FragColor = vec4(color.bgra);
|
||||
gl_FragColor = vec4(color.bgr, color.a * opacity);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue