diff --git a/data/assets/scene/digitaluniverse/grids.asset b/data/assets/scene/digitaluniverse/grids.asset index 042233d864..eed56c362a 100644 --- a/data/assets/scene/digitaluniverse/grids.asset +++ b/data/assets/scene/digitaluniverse/grids.asset @@ -126,15 +126,15 @@ local equatorialLabels = { LabelFile = speck .. "/radec.label", DrawLabels = true, TextColor = { 0.5, 0.5, 0.5, 1.0 }, - TextSize = 15.3, + TextSize = 14.5, TextMinSize = 5.0, - TextMaxSize = 18.0, + TextMaxSize = 70.0, Unit = "pc", TransformationMatrix = { - -0.05487554, 0.4941095, -0.8676661, 0.0, - -0.9938214 , -0.1109906, -0.0003515167, 0.0, - -0.09647644, 0.8622859, 0.4971472, 0.0, - 0.0, 0.0, 0.0, 1.0 + -0.05487554, 0.4941095, -0.8676661, 0.0, + -0.8734371 , -0.4448296, -0.1980764, 0.0, + -0.483835 , 0.7469823, 0.4559838, 0.0, + 0.0 , 0.0 , 0.0 , 1.0 } }, GUI = { diff --git a/modules/base/rendering/renderablesphericalgrid.cpp b/modules/base/rendering/renderablesphericalgrid.cpp index b09741e43b..ce8fa7106a 100644 --- a/modules/base/rendering/renderablesphericalgrid.cpp +++ b/modules/base/rendering/renderablesphericalgrid.cpp @@ -214,9 +214,25 @@ void RenderableSphericalGrid::render(const RenderData& data, RendererTasks&){ _gridProgram->setUniform("gridColor", _gridColor); + // Saves current state: + GLboolean isBlendEnabled = glIsEnabledi(GL_BLEND, 0); + GLboolean isLineSmoothEnabled = glIsEnabled(GL_LINE_SMOOTH); + GLfloat currentLineWidth; + glGetFloatv(GL_LINE_WIDTH, ¤tLineWidth); + + GLenum blendEquationRGB, blendEquationAlpha, blendDestAlpha, + blendDestRGB, blendSrcAlpha, blendSrcRGB; + glGetIntegerv(GL_BLEND_EQUATION_RGB, &blendEquationRGB); + glGetIntegerv(GL_BLEND_EQUATION_ALPHA, &blendEquationAlpha); + glGetIntegerv(GL_BLEND_DST_ALPHA, &blendDestAlpha); + glGetIntegerv(GL_BLEND_DST_RGB, &blendDestRGB); + glGetIntegerv(GL_BLEND_SRC_ALPHA, &blendSrcAlpha); + glGetIntegerv(GL_BLEND_SRC_RGB, &blendSrcRGB); + + // Changes GL state: glLineWidth(_lineWidth); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glEnable(GL_BLEND); + glEnablei(GL_BLEND, 0); glEnable(GL_LINE_SMOOTH); glBindVertexArray(_vaoID); @@ -225,6 +241,17 @@ void RenderableSphericalGrid::render(const RenderData& data, RendererTasks&){ glBindVertexArray(0); _gridProgram->deactivate(); + + // Restores GL State + glLineWidth(currentLineWidth); + glBlendEquationSeparate(blendEquationRGB, blendEquationAlpha); + glBlendFuncSeparate(blendSrcRGB, blendDestRGB, blendSrcAlpha, blendDestAlpha); + if (!isBlendEnabled) { + glDisablei(GL_BLEND, 0); + } + if (!isLineSmoothEnabled) { + glDisable(GL_LINE_SMOOTH); + } } void RenderableSphericalGrid::update(const UpdateData&) { diff --git a/modules/globebrowsing/src/renderableglobe.cpp b/modules/globebrowsing/src/renderableglobe.cpp index d31fd8371a..f92cfb4631 100644 --- a/modules/globebrowsing/src/renderableglobe.cpp +++ b/modules/globebrowsing/src/renderableglobe.cpp @@ -653,7 +653,7 @@ void RenderableGlobe::renderChunks(const RenderData& data, RendererTasks&) { } if (_generalProperties.performShading) { - const bool onr = _generalProperties.orenNayarRoughness; + const float onr = _generalProperties.orenNayarRoughness; _localRenderer.program->setUniform("orenNayarRoughness", onr); _globalRenderer.program->setUniform("orenNayarRoughness", onr); }