fix alpha blending + add depth/stencil buffers

This commit is contained in:
Konstantin Käfer
2014-05-21 18:34:41 +02:00
parent 16a79b42ca
commit 53a6992728
15 changed files with 252 additions and 165 deletions

View File

@@ -20,6 +20,10 @@ Painter::Painter(Map &map)
: map(map) {
}
Painter::~Painter() {
clearFramebuffers();
}
bool Painter::needsAnimation() const {
return frameHistory.needsAnimation(300);
}
@@ -133,24 +137,18 @@ void Painter::clear() {
#endif
}
void Painter::startOpaquePass() {
gl::start_group("opaque pass");
void Painter::setOpaque() {
pass = Opaque;
glDisable(GL_BLEND);
depthMask(true);
}
void Painter::startTranslucentPass() {
gl::start_group("translucent pass");
void Painter::setTranslucent() {
pass = Translucent;
glEnable(GL_BLEND);
depthMask(false);
}
void Painter::endPass() {
gl::end_group();
}
void Painter::setStrata(float value) {
strata = value;
}