first shot at composited blending

still missing:
- stencil+depth mask
- alpha compositing
This commit is contained in:
Konstantin Käfer
2014-05-20 17:38:52 +02:00
parent 238fe86571
commit 13939b26d9
23 changed files with 325 additions and 23 deletions

View File

@@ -0,0 +1,25 @@
#include <llmr/renderer/painter.hpp>
#include <iostream>
using namespace llmr;
void Painter::drawComposite(GLuint texture, const CompositeProperties &properties) {
glDisable(GL_STENCIL_TEST);
useProgram(compositeShader->program);
compositeShader->setMatrix(nativeMatrix);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, texture);
compositeShader->setImage(0);
// TODO: layerstyle
compositeShader->setOpacity(properties.opacity);
// Draw the clipping mask
compositeArray.bind(*compositeShader, tileStencilBuffer, BUFFER_OFFSET(0));
glDrawArrays(GL_TRIANGLES, 0, (GLsizei)tileStencilBuffer.index());
glEnable(GL_STENCIL_TEST);
}