diff options
Diffstat (limited to 'src/render/state.cc')
-rw-r--r-- | src/render/state.cc | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/render/state.cc b/src/render/state.cc index 5f026f0..ce3a0ab 100644 --- a/src/render/state.cc +++ b/src/render/state.cc @@ -299,23 +299,23 @@ void State::use_material(const model::Material * material) { } } else { - // envmapped without texture: use the skybox as envmap - if (material->flags() & model::Material::Environment) { - if (core::localplayer()->zone()->sky().size()) { - gl::enable(GL_TEXTURE_CUBE_MAP); - - glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP); - glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP); - glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP); - - gl::enable(GL_TEXTURE_GEN_S); - gl::enable(GL_TEXTURE_GEN_T); - gl::enable(GL_TEXTURE_GEN_R); - } else { - color.assign(0.0f, 0.0f, 0.0f); - } - glMateriali(GL_FRONT, GL_SHININESS, 4); + // envmapped without texture: use the skybox as envmap + if (material->flags() & model::Material::Environment) { + if (core::localplayer()->zone()->sky().size()) { + gl::enable(GL_TEXTURE_CUBE_MAP); + + glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP); + glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP); + glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP); + + gl::enable(GL_TEXTURE_GEN_S); + gl::enable(GL_TEXTURE_GEN_T); + gl::enable(GL_TEXTURE_GEN_R); + } else { + color.assign(0.0f, 0.0f, 0.0f); } + glMateriali(GL_FRONT, GL_SHININESS, 4); + } } gl::color(color); |