diff options
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/state.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/render/state.cc b/src/render/state.cc index 09e1a59..ffff7e3 100644 --- a/src/render/state.cc +++ b/src/render/state.cc @@ -219,6 +219,14 @@ void State::use_material(const model::Material * material) { gl::color(color); return; } + + // Decal macro + if (material->flags() & model::Material::Decal) { + gl::enable(GL_POLYGON_OFFSET_FILL); + gl::enable(GL_ALPHA_TEST); + glPolygonOffset(-1,-1); + glAlphaFunc(GL_GEQUAL, 0.5f); + } // assign the opengl drawing color according to material flags if (material->flags() & model::Material::Engine) { @@ -312,6 +320,8 @@ void State::use_material(const model::Material * material) { } void State::reset() { + gl::disable(GL_POLYGON_OFFSET_FILL); + gl::disable(GL_ALPHA_TEST); gl::disable(GL_TEXTURE_GEN_S); gl::disable(GL_TEXTURE_GEN_T); gl::disable(GL_TEXTURE_GEN_R); |