From e02aaa39f703f0db1711781d10156ebc58c1a2ca Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Wed, 24 Apr 2013 14:59:11 -0700 Subject: [PATCH] To fix font rendering on Linux (which uses points), we need to restore the default point size attenuation settings. --- interface/src/Cloud.cpp | 5 +++++ interface/src/Util.cpp | 2 ++ 2 files changed, 7 insertions(+) diff --git a/interface/src/Cloud.cpp b/interface/src/Cloud.cpp index ea27b40d49..1931f53d12 100644 --- a/interface/src/Cloud.cpp +++ b/interface/src/Cloud.cpp @@ -46,6 +46,7 @@ Cloud::Cloud(int num, void Cloud::render() { float particleAttenuationQuadratic[] = { 0.0f, 0.0f, 2.0f }; + float particleAttenuationConstant[] = { 1.0f, 0.0f, 0.0f }; glEnable( GL_TEXTURE_2D ); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); @@ -73,6 +74,10 @@ void Cloud::render() { glEnd(); glDisable( GL_POINT_SPRITE_ARB ); glDisable( GL_TEXTURE_2D ); + + glPointParameterfvARB( GL_POINT_DISTANCE_ATTENUATION_ARB, particleAttenuationConstant ); + glPointParameterfARB( GL_POINT_SIZE_MAX_ARB, 1.0f ); + glPointParameterfARB( GL_POINT_SIZE_MIN_ARB, 0.0f ); } void Cloud::simulate (float deltaTime) { diff --git a/interface/src/Util.cpp b/interface/src/Util.cpp index 4be30cb8cf..17f11cd64c 100644 --- a/interface/src/Util.cpp +++ b/interface/src/Util.cpp @@ -90,6 +90,7 @@ void render_vector(glm::vec3 * vec) // Draw marker dots for magnitude glEnd(); float particleAttenuationQuadratic[] = { 0.0f, 0.0f, 2.0f }; // larger Z = smaller particles + float particleAttenuationConstant[] = { 1.0f, 0.0f, 0.0f }; glPointParameterfvARB( GL_POINT_DISTANCE_ATTENUATION_ARB, particleAttenuationQuadratic ); @@ -104,6 +105,7 @@ void render_vector(glm::vec3 * vec) glVertex3f(0,0,vec->z); glEnd(); + glPointParameterfvARB( GL_POINT_DISTANCE_ATTENUATION_ARB, particleAttenuationConstant ); } void render_world_box()