From 5f2ce34a2360e37d6c75016fd4c306e03d2a2112 Mon Sep 17 00:00:00 2001 From: Oliver Bock <oliver.bock@aei.mpg.de> Date: Wed, 19 Nov 2008 15:59:27 +0100 Subject: [PATCH] Enabled FSAA (for polygon anti-aliasing) in high quality mode --- src/framework/WindowManager.cpp | 8 ++++++-- src/starsphere/Starsphere.cpp | 6 +----- src/starsphere/StarsphereRadio.cpp | 10 ++++++++++ 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/framework/WindowManager.cpp b/src/framework/WindowManager.cpp index 179d653..476df07 100644 --- a/src/framework/WindowManager.cpp +++ b/src/framework/WindowManager.cpp @@ -122,13 +122,17 @@ bool WindowManager::initialize(const int width, const int height, const int fram SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1); + // enable opt-in quality feature FSAA (4x) + if(m_BoincAdapter->graphicsQualitySetting() == BOINCClientAdapter::HighGraphicsQualitySetting) { + SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4); + SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1); + } + // unused requirements //SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8); //SDL_GL_SetAttribute(SDL_GL_BUFFER_SIZE, 32); //SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); //SDL_GL_SetAttribute(SDL_GL_ACCELERATED_VISUAL, 1); - //SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4); - //SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1); // we always start in windowed mode // (starting in fullscreen fails with high CPU load!) diff --git a/src/starsphere/Starsphere.cpp b/src/starsphere/Starsphere.cpp index 0a66c9e..f4bd782 100644 --- a/src/starsphere/Starsphere.cpp +++ b/src/starsphere/Starsphere.cpp @@ -863,11 +863,7 @@ void Starsphere::render(const double timeOfDay) glPushMatrix(); glLoadIdentity(); - if (isFeature(LOGO)) { - // call subclass implementation - renderLogo(); - } - + if (isFeature(LOGO)) renderLogo(); if (isFeature(SEARCHINFO)) renderSearchInformation(); // restore original state diff --git a/src/starsphere/StarsphereRadio.cpp b/src/starsphere/StarsphereRadio.cpp index 1312eb2..7ebc1a7 100644 --- a/src/starsphere/StarsphereRadio.cpp +++ b/src/starsphere/StarsphereRadio.cpp @@ -371,6 +371,11 @@ void StarsphereRadio::generateObservatories(float dimFactor) m_areciboObservatory = glGenLists(1); glNewList(m_areciboObservatory, GL_COMPILE); + // enable opt-in quality feature FSAA (GL_POLYGON_SMOOTH is discouraged) + if(m_QualitySetting == BOINCClientAdapter::HighGraphicsQualitySetting) { + glEnable(GL_MULTISAMPLE_ARB); + } + // we don't dim Arecibo, just IFOs glColor3f(0.75, 0.75, 0.75); @@ -434,6 +439,11 @@ void StarsphereRadio::generateObservatories(float dimFactor) sphVertex3D(RAdeg+0.7, DEdeg-0.7, radius); glEnd(); + // disable opt-in quality feature FSAA again + if(m_QualitySetting == BOINCClientAdapter::HighGraphicsQualitySetting) { + glDisable(GL_MULTISAMPLE_ARB); + } + glEndList(); } -- GitLab