mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-23 12:40:01 -06:00
Merge commit 'c4ff9ec13910a207ce085ea9d4624886588b36db' into feature/websocketnavigation
* commit 'c4ff9ec13910a207ce085ea9d4624886588b36db': Fixed OpenGL invalid state in globebrowsing. Fixed issue 747 and labels orientation.
This commit is contained in:
@@ -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 = {
|
||||
|
||||
@@ -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&) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user